/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Layout principal */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
    text-align: center;
}

.sidebar-logo-wrapper {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-logo {
    width: 64px;
    height: 64px;
    object-fit: cover;
    display: block;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-logo.square {
    border-radius: 2px;
}

.sidebar-logo.circle {
    border-radius: 50%;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.sidebar-header p {
    color: #bdc3c7;
    font-size: 0.9rem;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover {
    background: #34495e;
    color: white;
}

/* Style pour le bouton de déconnexion */
.sidebar-menu .logout-item {
    margin-top: auto;
    border-top: 1px solid #34495e;
    padding-top: 10px;
}

.sidebar-menu .logout-item a {
    color: #e74c3c !important;
}

.sidebar-menu .logout-item a:hover {
    background: #e74c3c !important;
    color: white !important;
}

.sidebar-menu a i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
}

.sidebar-menu li.active a {
    background: #3498db;
    color: white;
}

/* Contenu principal */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.content-header h1 {
    font-size: 2rem;
    color: #2c3e50;
}

/* Grille de statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
    color: white;
}

.stat-card:not(.pending):not(.progress):not(.resolved):not(.maintenance):not(.shopping) .stat-icon {
    background: #6c757d;
}

.stat-card.pending {
    border: 2px solid #ffc107;
}

.stat-card.pending .stat-icon {
    background: #ffc107;
}

.stat-card.progress {
    border: 2px solid #17a2b8;
}

.stat-card.progress .stat-icon {
    background: #17a2b8;
}

.stat-card.resolved {
    border: 2px solid #28a745;
}

.stat-card.resolved .stat-icon {
    background: #28a745;
}

.stat-card.maintenance {
    border: 2px solid #dc3545;
}

.stat-card.maintenance .stat-icon {
    background: #dc3545;
}

.stat-card.shopping {
    border: 2px solid #6f42c1;
}

.stat-card.shopping .stat-icon {
    background: #6f42c1;
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.stat-content p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Grille de contenu */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.content-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.card-header h3 {
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-content {
    padding: 20px;
}

/* Items de tickets */
.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ticket-item:last-child {
    border-bottom: none;
}

.ticket-item.overdue {
    background: #fff5f5;
    margin: 0 -20px;
    padding: 15px 20px;
    border-left: 4px solid #dc3545;
}

.ticket-info h4 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1rem;
}

.ticket-info p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.ticket-info i {
    width: 12px;
    margin-right: 5px;
}

.ticket-actions {
    margin-left: 15px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    margin-right: 5px;
}

.badge-maintenance {
    background: #dc3545;
    color: white;
}

.badge-shopping {
    background: #6f42c1;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

/* Status classes */
.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-progress {
    background: #d1ecf1;
    color: #0c5460;
}

.status-resolved {
    background: #d4edda;
    color: #155724;
}

/* Priority classes - ensure they work with badge class */
.badge.priority-low,
.priority-low {
    background: #fff9c4; /* light yellow */
    color: #7a6a00;
}

.badge.priority-medium,
.priority-medium {
    background: #ffcc80; /* orange */
    color: #7a3e00;
}

.badge.priority-high,
.priority-high {
    background: #f8d7da;
    color: #721c24;
}

/* Boutons - Système de grille uniforme */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 40px;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-height: 32px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 1rem;
    min-height: 48px;
}

/* Grille de boutons pour alignement */
.btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    align-items: center;
}

.btn-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-group .btn {
    flex: 1;
    min-width: 0;
}

/* Statistiques par zone */
.zone-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.zone-stat:last-child {
    border-bottom: none;
}

.zone-name {
    font-weight: 600;
    color: #2c3e50;
}

.zone-count {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .menu-toggle { position: fixed; top: calc(14px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); left: auto; z-index: 1001; }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .ticket-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .ticket-actions {
        margin-left: 0;
        align-self: flex-end;
    }
}

/* Host-scoped tweaks on m. subdomain */
.is-mobile-host .main-content {
    padding: 12px;
}
.is-mobile-host .content-header h1 {
    font-size: 1.6rem;
}
.is-mobile-host .tickets-table-container,
.is-mobile-host .table-responsive {
    -webkit-overflow-scrolling: touch;
}
.is-mobile-host .btn {
    min-height: 44px; /* touch target */
}

/* Force compact stacked table on m. host */
.is-mobile-host .tickets-table { display: block; width: 100%; min-width: 0; }
.is-mobile-host .tickets-table thead { display: none; }
.is-mobile-host .tickets-table tbody { display: block; }
.is-mobile-host .tickets-table tr { display: block; margin-bottom: 16px; background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); padding: 12px; }
.is-mobile-host .tickets-table td { display: block; padding: 8px 0; border: none; text-align: left; }
.is-mobile-host .tickets-table td:before { content: attr(data-label) ": "; font-weight: 700; color: #2c3e50; display: inline-block; width: 110px; }
.is-mobile-host .tickets-table .ticket-photo { text-align: left; margin-bottom: 6px; }
.is-mobile-host .tickets-table .ticket-actions .btn-group { width: 100%; gap: 8px; }
.is-mobile-host .tickets-table .ticket-actions .btn-group .btn { width: 48%; min-height: 40px; }

/* 1) Design tokens for mobile (2025) */
.is-mobile-host {
    --m-space-2: 8px;
    --m-space-3: 12px;
    --m-space-4: 16px;
    --m-space-5: 20px;
    --m-space-6: 24px;
    --m-radius: 14px;
    --m-radius-lg: 18px;
    --m-shadow: 0 6px 18px rgba(0,0,0,0.08);
    --m-font-base: clamp(15px, 1.9vh, 17px);
    --m-font-sm: clamp(13px, 1.6vh, 15px);
    --m-font-lg: clamp(18px, 2.2vh, 20px);
    --m-font-xl: clamp(20px, 2.6vh, 24px);
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

/* 2) Global typography and layout */
.is-mobile-host body { font-size: var(--m-font-base); line-height: 1.45; }
.is-mobile-host h1 { font-size: clamp(22px, 3.2vh, 28px); margin: var(--m-space-4) 0; }
.is-mobile-host h2 { font-size: clamp(18px, 2.6vh, 22px); margin: var(--m-space-3) 0; }
.is-mobile-host h3 { font-size: clamp(16px, 2.3vh, 20px); margin: var(--m-space-2) 0; }
.is-mobile-host .admin-container { padding-left: var(--safe-left, 0); padding-right: var(--safe-right, 0); }

/* 3) Buttons and controls */
.is-mobile-host .btn { min-height: 48px; padding: 12px 16px; border-radius: var(--m-radius); font-size: var(--m-font-base); box-shadow: var(--m-shadow); }
.is-mobile-host .btn-sm { min-height: 44px; padding: 10px 14px; border-radius: var(--m-radius); font-size: var(--m-font-sm); }
.is-mobile-host .action-buttons .btn-sm, .is-mobile-host .btn-group .btn-sm { min-width: 44px; min-height: 44px; }
.is-mobile-host .btn-primary:hover, .is-mobile-host .btn-secondary:hover, .is-mobile-host .btn-warning:hover, .is-mobile-host .btn-danger:hover { transform: translateY(-1px); }

/* 4) Card/table pattern enhancements */
.is-mobile-host .content-card, .is-mobile-host .tickets-table-container, .is-mobile-host .table-responsive { border-radius: var(--m-radius-lg); box-shadow: var(--m-shadow); }
.is-mobile-host .tickets-table tr, .is-mobile-host .data-table tr { padding: var(--m-space-3); }
.is-mobile-host .tickets-table td:before, .is-mobile-host .data-table td:before { width: 96px; color: #6b7280; }
.is-mobile-host .title-content h4 { font-size: var(--m-font-lg); }

/* 5) Media and badges */
.is-mobile-host .photo-gallery { width: 96px; height: 96px; }
.is-mobile-host .photo-container { border-radius: var(--m-radius-lg); }
.is-mobile-host .badge { border-radius: 999px; padding: 8px 12px; font-size: var(--m-font-sm); }

/* 6) Sticky headers and safe areas */
.is-mobile-host .content-header { position: sticky; top: calc(0px + var(--safe-top)); z-index: 50; backdrop-filter: saturate(180%) blur(8px); background: rgba(255,255,255,0.82); border-bottom: 1px solid #eef1f4; padding-top: calc(var(--m-space-3) + var(--safe-top)); }
.is-mobile-host .main-content { padding-bottom: calc(var(--m-space-6) + var(--safe-bottom)); }

/* Tickets list: toggle cards on mobile and table on desktop */
.tickets-cards-container { display: none; }
@media (max-width: 768px) {
    .tickets-table-container { display: none; }
    .tickets-cards-container { display: block; }
    /* Prevent page-level horizontal scroll */
    html, body { overflow-x: hidden; }
    .admin-container, .main-content { overflow-x: hidden; }
    /* Neutralize wide table sizing just in case */
    .tickets-table { min-width: 0 !important; width: 100% !important; }
}
.is-mobile-host .tickets-table-container { display: none !important; }
.is-mobile-host .tickets-cards-container { display: block !important; }
/* Also suppress horizontal scroll when on mobile host */
.is-mobile-host { overflow-x: hidden; }
.is-mobile-host .admin-container, .is-mobile-host .main-content { overflow-x: hidden; }
.is-mobile-host .tickets-table { min-width: 0 !important; width: 100% !important; }

/* Thumbnail inside mobile ticket card */
.tickets-cards-container .ticket-item {
    display: flex;
    gap: 12px;
    align-items: center;
}
.tickets-cards-container .ticket-item { justify-content: space-between; }
.tickets-cards-container .ticket-info { flex: 1; min-width: 0; }
.tickets-cards-container .ticket-card-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tickets-cards-container .ticket-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tickets-cards-container .ticket-card-thumb i { color: #9aa4b2; font-size: 1.4rem; }
/* Force inline actions for mobile card view */
.tickets-cards-container .ticket-actions { display: flex; align-items: center; }
.tickets-cards-container .ticket-actions .btn-group { display: flex !important; flex-direction: row !important; flex-wrap: nowrap; gap: 12px; justify-content: flex-end; width: auto !important; }
.tickets-cards-container .ticket-actions .btn-group .btn { width: auto; min-width: 44px; }
.is-mobile-host .tickets-cards-container .ticket-actions .btn-group { display: flex !important; flex-direction: row !important; grid-template-columns: none !important; width: auto !important; }
.is-mobile-host .tickets-cards-container .ticket-actions .btn-group .btn { width: auto !important; }

/* 7) Page-specific quick refinements */
.is-mobile-host .ticket-actions .btn-group { grid-template-columns: 1fr 1fr; display: grid; gap: var(--m-space-3); }
.is-mobile-host .ticket-actions .btn-group .btn { width: 100%; }
.is-mobile-host .user-avatar, .is-mobile-host .artisan-avatar, .is-mobile-host .zone-icon { width: 44px; height: 44px; font-size: 1.1rem; }
.is-mobile-host .stats-grid { gap: var(--m-space-3); }

/* Flash alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #eef1f4;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    margin: 12px 0 20px;
    animation: alertFade .25s ease;
}
.alert i { font-size: 1.1rem; }
.alert-success { border-left: 6px solid #28a745; }
.alert-success i { color: #28a745; }
.alert-danger { border-left: 6px solid #dc3545; }
.alert-danger i { color: #dc3545; }
.alert-info { border-left: 6px solid #17a2b8; }
.alert-info i { color: #17a2b8; }
.alert-warning { border-left: 6px solid #ffc107; }
.alert-warning i { color: #ffc107; }
@keyframes alertFade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .stat-content h3 {
        font-size: 1.5rem;
    }
    
    .card-header,
    .card-content {
        padding: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card {
    animation: fadeIn 0.5s ease;
}

/* Table styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

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

/* Zebra striping and sticky headers for platform tables */
.table tbody tr:nth-child(even) {
    background: #fbfcfe;
}

.table-sticky-container {
    max-height: 70vh;
    overflow: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #eef1f4;
    background: #fff;
}

.table.table-sticky thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 0 1px 0 0 #e9ecef;
}

/* Tickets Table Styles */
.tickets-table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tickets-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tickets-table th {
    padding: 15px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    position: relative;
    user-select: none;
}

.tickets-table th.sortable {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.tickets-table th.sort-asc::after {
    content: ' ↑';
    color: #fff;
    font-weight: bold;
}

.tickets-table th.sort-desc::after {
    content: ' ↓';
    color: #fff;
    font-weight: bold;
}

.tickets-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

/* Highlight overdue rows */
.tickets-table tbody tr.is-overdue {
    background: #fff5f5;
    box-shadow: inset 3px 0 0 #dc2626;
}

/* Preserve overdue styling on hover */
.tickets-table tbody tr.is-overdue:hover {
    background: #fff5f5;
    transform: translateY(-1px);
    box-shadow: inset 3px 0 0 #dc2626, 0 2px 8px rgba(0,0,0,0.1);
}

.tickets-table tbody tr:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tickets-table td {
    padding: 15px 12px;
    vertical-align: middle;
    border: none;
}

/* Ticket ID */
.ticket-id {
    width: 80px;
}

.ticket-number {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1rem;
}

/* Photo Thumbnail - Styles supprimés, gérés dans les styles du tableau */

.photo-thumbnail {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.photo-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

/* Large attachments in ticket details modal (used by archive.php and tickets.php) */
.ticket-details .attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.ticket-details .attachment-item {
    text-align: center;
}
.ticket-details .attachment-item img,
.ticket-details .attachment-item video {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-thumbnail:hover .photo-overlay {
    opacity: 1;
}

.no-photo {
    width: 50px;
    height: 50px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.2rem;
}

/* Ticket Title - Styles supprimés, gérés dans les styles du tableau */

.title-content h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.description-preview {
    margin: 0 0 5px 0;
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
}

.equipment-info {
    color: #007bff;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.equipment-info i {
    font-size: 0.7rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge i {
    font-size: 0.7rem;
}

.badge-maintenance {
    background: #dc3545;
    color: white;
}

.badge-shopping {
    background: #6f42c1;
    color: white;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-progress {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-resolved {
    background: #d4edda;
    color: #155724;
}

.badge-low {
    background: #fff9c4; /* light yellow */
    color: #7a6a00;
}

.badge-medium {
    background: #ffcc80; /* orange */
    color: #7a3e00;
}

.badge-high {
    background: #f8d7da;
    color: #721c24;
}

/* Zone Badge */
.zone-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: #e3f2fd;
    color: #0d47a1;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.zone-badge i {
    font-size: 0.7rem;
}

/* Reporter Info */
.reporter-info {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6c757d;
    font-size: 0.85rem;
}

.reporter-info i {
    color: #007bff;
    font-size: 0.8rem;
}

/* Date Info */
.date-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.date {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.85rem;
}

.time {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.action-buttons .btn-group {
    display: flex;
    gap: 4px;
}

/* Ensure actions are always clickable above any overlays */
.ticket-row .action-buttons { position: relative; z-index: 2; }

.action-buttons .btn-sm {
    padding: 6px 8px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    white-space: nowrap;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

.assigned-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: help;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.empty-state p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Bouton dans l'état vide - utilise les styles par défaut pour être identique au bouton header */
.empty-state .btn {
    /* Utilise les styles par défaut de .btn - pas de redéfinition nécessaire */
}

/* Responsive Table */
@media (max-width: 1200px) {
    .tickets-table {
        font-size: 0.8rem;
    }
    
    .tickets-table th,
    .tickets-table td {
        padding: 10px 8px;
    }
    
    .ticket-title {
        width: 300px;
        min-width: 300px;
        max-width: 300px;
    }
}

/* Responsive Buttons */
@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .filter-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .filter-actions .btn-group {
        flex-direction: row;
        justify-content: center;
    }
    
    .filter-count {
        text-align: center;
        margin: 0;
    }
    
    .header-actions .btn-group {
        flex-direction: column;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .table-responsive {
        border: none;
    }
    
    .tickets-table {
        display: block;
        width: 100%;
    }
    
    .tickets-table thead {
        display: none;
    }
    
    .tickets-table tbody {
        display: block;
    }
    
    .tickets-table tr {
        display: block;
        margin-bottom: 20px;
        background: white;
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        padding: 15px;
    }
    
    .tickets-table td {
        display: block;
        padding: 8px 0;
        border: none;
        text-align: left;
    }
    
    .tickets-table td:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        color: #2c3e50;
        display: inline-block;
        width: 120px;
    }
    /* Improve stacking and touch targets on mobile tables */
    .tickets-table td > * { vertical-align: middle; }
    .tickets-table .ticket-title .title-content { margin-top: 4px; }
    .tickets-table .ticket-actions .btn-group { width: 100%; gap: 8px; }
    .tickets-table .ticket-actions .btn-group .btn { width: 48%; min-height: 40px; }
    
    .ticket-photo {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .action-buttons {
        justify-content: center;
        margin-top: 10px;
    }
}

/* Filters Card Styles */
.filters-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.filters-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 25px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters-header h3 i {
    color: #007bff;
}

.filters-toggle .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-height: 32px;
    white-space: nowrap;
}

.filters-toggle .btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.filters-form {
    padding: 25px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label i {
    color: #007bff;
    font-size: 0.8rem;
    width: 14px;
}

.filter-select {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.filter-select:hover {
    border-color: #adb5bd;
}

.search-group {
    grid-column: span 2;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.search-clear:hover {
    background: #f8f9fa;
    color: #dc3545;
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.filter-actions .btn-group {
    display: flex;
    gap: 10px;
}

.filter-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e9ecef;
}

.filter-count span {
    font-weight: 600;
    color: #007bff;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Enhanced color picker */
.color-picker {
    display: grid;
    grid-template-columns: 40px 1fr 44px;
    gap: 10px;
    align-items: center;
}
.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--color, #888888);
    border: 2px solid #e9ecef;
    cursor: pointer;
}
.color-hex-input {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
}
.color-hex-input:focus { border-color: #007bff; box-shadow: 0 0 0 3px rgba(0,123,255,0.1); outline: none; }
.color-native {
    width: 44px;
    height: 40px;
    padding: 0;
    border: 2px solid #e9ecef;
    border-radius: 6px;
}
.color-swatches {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}
.color-swatches button {
    width: 100%;
    padding-top: 100%;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: var(--c, #888888);
    cursor: pointer;
}
.color-swatches button:focus { outline: 2px solid #007bff; outline-offset: 2px; }

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 0;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden; /* prevent horizontal scroll in modals */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    border-radius: 0;
}

.modal-header h3 {
    color: #2c3e50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Styles spécifiques pour le module employés */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 1.2rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.ticket-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}

.ticket-stats .total {
    color: #6c757d;
}

.ticket-stats .active {
    color: #dc3545;
    font-weight: 500;
}

.data-table tr.inactive {
    opacity: 0.6;
    background-color: #f8f9fa;
}

.data-table tr.inactive td {
    color: #6c757d;
}

/* Styles pour les nouveaux rôles */
.badge-manager {
    background-color: #17a2b8;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.badge-staff {
    background-color: #6c757d;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.badge-admin {
    background-color: #dc3545;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.stat-card.manager {
    border: 2px solid #17a2b8;
}

.stat-card.manager .stat-icon {
    background: #17a2b8;
}

.stat-card.staff {
    border: 2px solid #6c757d;
}

.stat-card.staff .stat-icon {
    background: #6c757d;
}

/* Amélioration du tableau des employés */
.data-table {
    table-layout: fixed;
    width: 100%;
}

.data-table th:nth-child(1) { width: 25%; } /* Nom */
.data-table th:nth-child(2) { width: 15%; } /* Rôle */
.data-table th:nth-child(3) { width: 12%; } /* Statut */
.data-table th:nth-child(4) { width: 15%; } /* Tickets */
.data-table th:nth-child(5) { width: 15%; } /* Créé le */
.data-table th:nth-child(6) { width: 18%; } /* Actions */

.data-table td {
    padding: 12px 8px;
    vertical-align: middle;
    word-wrap: break-word;
}

.ticket-stats {
    font-size: 0.8rem;
    line-height: 1.3;
}

/* Users table actions: compact inline, vertically centered */
.actions-cell { display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.actions-cell .btn-sm { min-width: 32px; height: 32px; padding: 4px 6px; font-size: 0.8rem; }

/* Responsive pour le module employés */
@media (max-width: 768px) {
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .data-table {
        table-layout: auto;
    }
    
    .data-table th:nth-child(1) { width: auto; }
    .data-table th:nth-child(2) { width: auto; }
    .data-table th:nth-child(3) { width: auto; }
    .data-table th:nth-child(4) { width: auto; }
    .data-table th:nth-child(5) { width: auto; }
    .data-table th:nth-child(6) { width: auto; }
    
    .actions-cell { flex-direction: row; gap: 6px; }
    
    .action-buttons .btn-sm {
        width: 100%;
        min-width: auto;
    }
}

/* Platform layout (standalone admin) */
.platform-container {
    max-width: none; /* allow full-width on desktop */
    width: 100%;
    margin: 20px 0; /* vertical breathing room, no horizontal centering */
    padding: 0 20px; /* keep small side padding */
}

.platform-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.platform-header h1 {
    font-size: 2rem;
    color: #2c3e50;
}

.platform-grid-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.platform-link-card {
    display: block;
    background: white;
    border-radius: 10px;
    padding: 18px;
    color: #2c3e50;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #eef1f4;
    transition: transform .2s ease, box-shadow .2s ease;
}

.platform-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.platform-link-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.platform-link-subtitle {
    color: #6c757d;
    font-size: .9rem;
}

/* Platform tables: compact, content-fit columns to avoid unnecessary horizontal scroll */
.platform-container .data-table { table-layout: auto; width: 100%; }
.platform-container .data-table th,
.platform-container .data-table td { white-space: normal; word-break: break-word; }
/* Narrow ID column */
.platform-container .data-table th:nth-child(1),
.platform-container .data-table td:nth-child(1) { width: 80px; white-space: nowrap; }
/* Keep last column (usually actions) compact */
.platform-container .data-table th:last-child,
.platform-container .data-table td:last-child { width: 1%; white-space: nowrap; }

/* Compact inputs for inline tables */
.input-sm { width: 160px; }
.input-xs { width: 120px; }
.input-xxs { width: 90px; }
.input-code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.table .actions-cell {
    text-align: right;
    white-space: nowrap;
}

.table .muted {
    color: #6c757d;
    font-size: .85rem;
}

/* Styles pour les artisans */
.badge-specialty {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-zone {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.contact-info {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Styles complets pour le tableau des tickets */
.tickets-table {
    table-layout: fixed;
    width: 100%;
    min-width: 1200px; /* desktop baseline */
    border-collapse: separate;
    border-spacing: 0;
}

/* Largeurs des colonnes optimisées */
.tickets-table th:nth-child(1), .tickets-table td:nth-child(1) { width: 60px; } /* ID - réduit */
.tickets-table th:nth-child(2), .tickets-table td:nth-child(2) { width: 80px; } /* Photo - ajusté à la taille image */
.tickets-table th:nth-child(3), .tickets-table td:nth-child(3) { width: 420px; } /* Titre élargi pour inclure description */
.tickets-table th:nth-child(4), .tickets-table td:nth-child(4) { width: 45px; } /* Type - icône seule (élargi) */
.tickets-table th:nth-child(5), .tickets-table td:nth-child(5) { width: 140px; } /* Statut */
.tickets-table th:nth-child(6), .tickets-table td:nth-child(6) { width: 130px; } /* Priorité */
.tickets-table th:nth-child(7), .tickets-table td:nth-child(7) { width: 120px; } /* Zone */
.tickets-table th:nth-child(8), .tickets-table td:nth-child(8) { width: 120px; } /* Signalé par */
.tickets-table th:nth-child(9), .tickets-table td:nth-child(9) { width: 120px; } /* Date */
.tickets-table th:nth-child(10), .tickets-table td:nth-child(10) { width: 120px; text-align: center; } /* Actions - aligné centre */

/* Styles des cellules */
.tickets-table td {
    padding: 12px 8px;
    vertical-align: middle;
    border: none;
    word-wrap: break-word;
    overflow: hidden;
}

/* Colonne Photo */
.ticket-photo {
    width: 80px;
    text-align: center;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Alignements par colonne */
.tickets-table td.ticket-id,
.tickets-table td.ticket-photo,
.tickets-table td.ticket-type,
.tickets-table td.ticket-status,
.tickets-table td.ticket-priority,
.tickets-table td.ticket-zone,
.tickets-table td.ticket-actions { text-align: center; }

.tickets-table td.ticket-title,
.tickets-table td.ticket-reporter,
.tickets-table td.ticket-date { text-align: left; }

/* TYPE: icône 16px, pas de label visible */
.tickets-table td.ticket-type .badge {
    background: transparent !important;
    color: inherit !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    font-size: 0; /* masque le label texte pour tenir dans 30px */
}
.tickets-table td.ticket-type .badge i {
    font-size: 16px !important;
    line-height: 1;
}

/* TYPE column: remove horizontal padding */
.tickets-table th:nth-child(4),
.tickets-table td.ticket-type { padding-left: 0; padding-right: 0; }

/* Thumbnail gallery (table) */
.photo-gallery { position: relative; width: 64px; height: 64px; margin: 0 auto; }
.photo-container { position: relative; width: 100%; height: 100%; border-radius: 8px; overflow: hidden; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.photo-main { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s ease; display: block; }
.photo-container:hover .photo-main { transform: scale(1.04); }
.photo-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s ease; }
.photo-container:hover .photo-overlay { opacity: 1; }
.photo-navigation { position: absolute; top: 50%; left: 6px; right: 6px; transform: translateY(-50%); display: flex; justify-content: space-between; pointer-events: none; }
.nav-btn { background: rgba(17,24,39,0.85); color: #fff; border: none; border-radius: 999px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; pointer-events: all; transition: all 0.2s ease; opacity: 0; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.photo-gallery:hover .nav-btn { opacity: 1; }
.nav-btn:hover { background: rgba(17,24,39,0.95); transform: scale(1.06); }
.nav-btn i { font-size: 0.9rem; line-height: 1; }
.photo-counter { position: absolute; right: 4px; bottom: 4px; background: rgba(17,24,39,0.8); color: #fff; padding: 2px 6px; border-radius: 10px; font-size: 0.7rem; }

/* Colonne Titre - permet retour à la ligne */
.ticket-title {
    width: 420px;
    max-width: 420px;
    padding: 8px 12px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Badges - Correction complète */
.badge {
    display: inline-block;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Conteneur du tableau */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Actions en 2x2 */
.action-buttons {
    display: inline-grid; /* permet l'alignement à droite via text-align du td */
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    width: auto;
    max-width: 140px;
    justify-items: center;
}

.action-buttons .btn {
    width: 100%;
    height: 32px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    min-width: auto;
}

.action-buttons .btn i {
    font-size: 0.9rem;
}

.contact-info div {
    margin-bottom: 2px;
}

.contact-info i {
    width: 16px;
    color: #666;
}

.zone-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.zone-stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    text-align: center;
}

.zone-stat-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.zone-stat-count {
    font-size: 1.2rem;
    color: #3498db;
    font-weight: 600;
}

/* Styles pour le tableau des artisans */
.artisans-table {
    table-layout: fixed;
    width: 100%;
}

.artisan-info-compact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.artisan-avatar {
    width: 32px;
    height: 32px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.artisan-details {
    min-width: 0;
}

.artisan-details strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artisan-details small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-info-compact {
    font-size: 0.85rem;
    line-height: 1.3;
}

.contact-info-compact div {
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-info-compact i {
    width: 14px;
    color: #666;
    font-size: 0.8rem;
}

.ticket-stats-compact {
    font-size: 0.8rem;
    line-height: 1.2;
}

.ticket-stats-compact .total {
    color: #2c3e50;
    font-weight: 500;
}

.ticket-stats-compact .active {
    color: #e74c3c;
    font-weight: 500;
}

/* Styles pour le tableau des zones */
.zone-stats-table {
    table-layout: fixed;
    width: 100%;
}

.zone-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zone-icon {
    width: 24px;
    height: 24px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.zone-name {
    min-width: 0;
}

.zone-name strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.zone-count {
    text-align: center;
}

.count-number {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.count-label {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.zone-percentage {
    text-align: center;
}

.percentage-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.percentage-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.percentage-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Responsive pour les tableaux */
@media (max-width: 768px) {
    .artisans-table th,
    .artisans-table td {
        padding: 8px 4px;
        font-size: 0.85rem;
    }
    
    .artisan-info-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .artisan-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .contact-info-compact div {
        white-space: normal;
        word-break: break-word;
    }
    
    .zone-stats-table th,
    .zone-stats-table td {
        padding: 8px 4px;
        font-size: 0.85rem;
    }
    
    .zone-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .zone-icon {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}

/* iOS-style switch (global) */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
    vertical-align: middle;
}
.switch input {
    position: absolute;
    opacity: 0;
    inset: 0;
}
.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cfd4da;
    transition: background-color .25s ease;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
.switch .slider::before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
    transition: transform .25s ease;
}
.switch input:checked + .slider {
    background: #007bff;
}
.switch input:checked + .slider::before {
    transform: translateX(18px);
}
.switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.switch-row label.switch {
    display: inline-block; /* override .form-group label { display:block } */
    margin-bottom: 0;      /* avoid extra spacing collapsing into row height */
    flex: 0 0 auto;        /* prevent stretching in flex container */
    line-height: 0;        /* remove inline spacing around the control */
}
.form-group label.switch { /* extra safety when nested directly inside .form-group */
    display: inline-block;
    margin-bottom: 0;
}
.switch-row .switch-help {
    color: #6c757d;
    font-size: .9rem;
}
