@import url("tokens.css");
@import url("page-transition.css");

/* 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: flex-start;
    gap: 16px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

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

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

.content-header-desc {
    margin: 6px 0 0;
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.45;
    max-width: 640px;
}

.content-header-meta {
    margin: 4px 0 0;
    color: #868e96;
    font-size: 0.85rem;
}

.content-header .header-actions {
    align-self: center;
    flex-shrink: 0;
}

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

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px 16px;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .stat-content h3 {
        font-size: 1.3rem;
    }
    
    .stat-content p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: none;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    gap: 12px;
}

.stat-card:hover {
    border-color: #d1d5db;
    background: #fafafa;
}

.stat-card.is-active {
    border-color: #3b82f6;
    border-width: 2px;
    background: #f8faff;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.stat-card:hover .stat-icon {
    opacity: 0.9;
}

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

.stat-card.pending {
    border-color: #fbbf24;
}

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

.stat-card.progress {
    border-color: #06b6d4;
}

.stat-card.progress .stat-icon {
    background: #06b6d4;
}

.stat-card.resolved {
    border-color: #10b981;
}

.stat-card.resolved .stat-icon {
    background: #10b981;
}

.stat-card.maintenance {
    border-color: #ef4444;
}

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

.stat-card.shopping {
    border-color: #0891b2;
}

.stat-card.shopping .stat-icon {
    background: #0891b2;
}

.stat-card.overdue {
    border-color: #ef4444;
}

.stat-card.overdue .stat-icon {
    background: #ef4444;
}

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

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

.stat-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: #111827;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.stat-content p {
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.3;
    margin: 0;
    font-weight: 400;
}

/* Dashboard stats hierarchy */
.dashboard-stats {
    display: grid;
    grid-template-columns: minmax(320px, 1.35fr) minmax(170px, 0.72fr) minmax(190px, 0.8fr);
    gap: 10px;
    margin-bottom: 18px;
}

.stats-section {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 7px;
    border: 1px solid #edf0f3;
    border-radius: 10px;
    background: #f8fafc;
}

.stats-section--types {
    grid-template-columns: minmax(190px, 1fr) minmax(120px, 0.58fr);
}

.stats-section--workflow {
    background: #f8fbff;
}

.stats-section--outcomes {
    background: #fdfcf9;
    border-color: #ece7de;
}

.stats-breakdown,
.stats-section--workflow,
.stats-section--outcomes {
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.stats-breakdown {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.dashboard-stats .stat-card {
    height: 100%;
}

.dashboard-stats .stat-card.maintenance {
    border-color: #f97316;
}

.dashboard-stats .stat-card.maintenance .stat-icon {
    background: #f97316;
}

.dashboard-stats .stat-card--hero {
    align-items: flex-end;
    padding: 16px;
    min-height: 108px;
    gap: 12px;
}

.dashboard-stats .stat-card--hero .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    font-size: 1.15rem;
}

.dashboard-stats .stat-card--hero .stat-content h3 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.8px;
}

.dashboard-stats .stat-card--hero .stat-content p {
    margin-top: 4px;
    font-size: 0.82rem;
    font-weight: 600;
}

.dashboard-stats .stat-card:not(.stat-card--hero) {
    padding: 9px 11px;
    gap: 9px;
}

.dashboard-stats .stat-card:not(.stat-card--hero) .stat-icon {
    width: 31px;
    height: 31px;
    font-size: 0.86rem;
}

.dashboard-stats .stat-card:not(.stat-card--hero) .stat-content h3 {
    font-size: 1.22rem;
}

.dashboard-stats .stat-card:not(.stat-card--hero) .stat-content p {
    font-size: 0.68rem;
}

.dashboard-stats .stat-card--compact {
    padding: 8px 10px;
    gap: 8px;
}

.dashboard-stats .stat-card--compact .stat-icon {
    width: 29px;
    height: 29px;
    font-size: 0.82rem;
}

.dashboard-stats .stat-card--compact .stat-content h3 {
    font-size: 1.15rem;
}

.dashboard-stats .stat-card--compact .stat-content p {
    font-size: 0.66rem;
}

@media (max-width: 900px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .stats-section--types {
        grid-template-columns: minmax(0, 1fr) minmax(135px, 0.6fr);
    }
}

@media (max-width: 560px) {
    .stats-section,
    .stats-section--types {
        grid-template-columns: 1fr;
    }

    .stats-breakdown,
    .stats-section--workflow,
    .stats-section--outcomes {
        grid-template-rows: none;
    }

    .dashboard-stats .stat-card--hero {
        min-height: 96px;
        align-items: center;
    }

    .dashboard-stats .stat-card--hero .stat-content h3 {
        font-size: 1.9rem;
    }
}

/* Revenue widgets with gradients - minimalist style */
.stat-card[style*="gradient"] {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white;
    position: relative;
    background: var(--hb-surface) !important;
}

.stat-card[style*="gradient"]:hover {
    border-color: rgba(255, 255, 255, 0.3) !important;
    opacity: 0.95;
}

.stat-card[style*="gradient"] .stat-icon {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-card[style*="gradient"] .stat-content h3 {
    color: white;
    font-weight: 600;
}

.stat-card[style*="gradient"] .stat-content p {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

/* Specific gradient colors */
.stat-card[style*="#2563eb"] {
    --gradient-start: #2563eb;
    --gradient-end: #0891b2;
}

.stat-card[style*="#f093fb"] {
    --gradient-start: #f093fb;
    --gradient-end: #f5576c;
}

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

.content-card {
    background: white;
    border-radius: 8px;
    box-shadow: none;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: border-color 0.2s ease;
}

.content-card:hover {
    border-color: #d1d5db;
}

.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;
}

.card-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-weight: 600;
    color: #111827;
    font-size: 1.1rem;
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header-actions h3 {
    margin: 0;
}

.create-tenant-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    align-items: end;
}

/* 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: #0891b2;
    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: 6px;
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
    white-space: nowrap;
    text-align: center;
    box-sizing: border-box;
    background: white;
    color: #374151;
}

.btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-primary {
    background: #3b82f6;
    color: white;
    box-shadow: none;
    border: 1px solid #3b82f6;
}

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: none;
}

.btn-primary:active {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

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

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

.btn-outline {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-sm {
    padding: 6px 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 - minimalist */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: none;
    margin: 12px 0 20px;
    animation: alertFade .2s ease;
    border-left-width: 3px;
}

.alert-success {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.alert-danger {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.alert-info {
    border-left-color: #06b6d4;
    background: #ecfeff;
}

.alert-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}
.alert i { 
    font-size: 1rem;
    flex-shrink: 0;
}

.alert-success i { color: #10b981; }
.alert-danger i { color: #ef4444; }
.alert-info i { color: #06b6d4; }
.alert-warning i { color: #f59e0b; }

@keyframes alertFade { 
    from { 
        opacity: 0; 
        transform: translateY(-4px); 
    } 
    to { 
        opacity: 1; 
        transform: none; 
    } 
}

/* Testimonial Banner */
.testimonial-banner {
    background: linear-gradient(135deg, #fff5f5 0%, #fff9f5 100%);
    border: 2px solid #ffe0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.1);
    position: relative;
}

.testimonial-banner-content {
    max-width: 100%;
}

.testimonial-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.testimonial-banner-header > div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    color: #2c3e50;
}

.testimonial-banner-close {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.testimonial-banner-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.testimonial-banner form label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
}

.testimonial-banner form input[type="text"],
.testimonial-banner form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.testimonial-banner form input[type="text"]:focus,
.testimonial-banner form textarea:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.testimonial-banner form input[readonly] {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .testimonial-banner {
        padding: 16px;
    }
    
    .testimonial-banner form > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }
}

@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;
    background: white;
}

.table-sticky-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #eef1f4;
}

.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: 8px;
    box-shadow: none;
    border: 1px solid #e5e7eb;
    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: #f2f4f6;
    color: var(--hb-text);
}

.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: #0891b2;
    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 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #ced4da;
}

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

/* Compact inputs for tables */
.input-sm,
.input-xs,
.input-xxs {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: white;
}

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

.input-code {
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 0.85rem;
}

/* 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: 0;
    border-radius: var(--hb-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-content > form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

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

.modal-header h3 {
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.close {
    color: #aaa;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 1.35rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
    background: #f8f9fa;
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding: 22px;
}

.modal-body,
.modal-scroll-body,
#ticketModalContent,
#archiveTicketModalContent {
    scrollbar-color: #b8bec6 transparent;
    scrollbar-width: thin;
}

.modal-body::-webkit-scrollbar,
.modal-scroll-body::-webkit-scrollbar,
#ticketModalContent::-webkit-scrollbar,
#archiveTicketModalContent::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track,
.modal-scroll-body::-webkit-scrollbar-track,
#ticketModalContent::-webkit-scrollbar-track,
#archiveTicketModalContent::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb,
.modal-scroll-body::-webkit-scrollbar-thumb,
#ticketModalContent::-webkit-scrollbar-thumb,
#archiveTicketModalContent::-webkit-scrollbar-thumb {
    background: #b8bec6;
    border: 3px solid #ffffff;
    border-radius: 999px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.modal-scroll-body::-webkit-scrollbar-thumb:hover,
#ticketModalContent::-webkit-scrollbar-thumb:hover,
#archiveTicketModalContent::-webkit-scrollbar-thumb:hover {
    background: #9aa3af;
}

.modal-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #e9ecef;
    background: #ffffff;
}

.modal-body > .form-group:last-child,
.modal-body > .form-row:last-child {
    margin-bottom: 0;
}

/* 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;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.platform-header h1 {
    font-size: 1.5rem;
    color: #111827;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.3px;
}

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

.platform-link-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    background: white;
    border-radius: 10px;
    padding: 16px 12px;
    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, border-color .2s ease;
}

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

.platform-link-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.88rem;
    text-align: center;
    line-height: 1.2;
}

.platform-link-title i {
    font-size: 1.35rem;
    color: #0f766e;
}

.platform-link-subtitle {
    display: none;
}

/* 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;
}

/* Ticket count styling */
.ticket-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #6b7280;
    background: #f3f4f6;
}

.ticket-count-active {
    color: #059669;
    background: #d1fae5;
}

.ticket-count[title]:hover {
    cursor: help;
}

/* Styles pour les artisans */
.badge-specialty {
    background: #ecfeff;
    color: #155e75;
    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;
}

/* HB refined visual system: crisp, flat, neutral */
body {
    font-family: var(--hb-font);
    background: var(--hb-bg);
    color: var(--hb-text);
}

.sidebar {
    background: var(--hb-sidebar);
    border-right: 1px solid #263244;
}

.sidebar-header,
.sidebar-menu .logout-item {
    border-color: #263244;
}

.sidebar-logo {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-logo-wrapper {
    display: none;
}

.sidebar-header {
    padding-top: 18px;
    padding-bottom: 18px;
}

.sidebar-header h2,
.content-header h1,
.content-card h3,
.filters-header h3,
.tickets-section h2,
.platform-header h1,
.table-header h3,
.modal-header h3 {
    color: var(--hb-text);
    letter-spacing: -0.02em;
}

.sidebar-header h2,
.sidebar-menu a,
.sidebar-header p {
    color: #d7dde5;
}

.sidebar-menu a {
    border-left: 2px solid transparent;
    transition: background var(--hb-transition), color var(--hb-transition), border-color var(--hb-transition);
}

.sidebar-menu a:hover {
    background: var(--hb-sidebar-hover);
    color: #ffffff;
}

.sidebar-menu li.active a {
    background: #223044;
    border-left-color: var(--hb-accent);
    color: #ffffff;
}

.main-content {
    background: var(--hb-bg);
}

.content-header {
    border-bottom: 1px solid var(--hb-border);
}

.content-card,
.filters-card,
.tickets-table-container,
.table-responsive,
.modal-content,
.platform-card,
.billing-card,
.settings-section,
.testimonial-banner,
.stat-card,
.dashboard-stats .stats-section {
    background: var(--hb-surface);
    border: 1px solid var(--hb-border);
    box-shadow: none !important;
}

.content-card,
.filters-card,
.tickets-table-container,
.table-responsive,
.modal-content,
.platform-card,
.billing-card,
.settings-section,
.testimonial-banner {
    border-radius: var(--hb-radius-lg);
}

.stat-card,
.dashboard-stats .stats-section {
    border-radius: var(--hb-radius-md);
}

.stat-card:hover,
.content-card:hover,
.platform-card:hover,
.ticket-row:hover,
.data-table tr:hover,
.tickets-table tbody tr:hover {
    background: var(--hb-surface-muted);
    box-shadow: none !important;
    transform: none !important;
}

.stat-card.is-active {
    border-color: var(--hb-accent);
    background: var(--hb-accent-soft);
}

.stat-card.shopping,
.badge-shopping,
.dashboard-stats .stat-card.shopping {
    border-color: var(--hb-shopping) !important;
}

.stat-card.shopping .stat-icon,
.dashboard-stats .stat-card.shopping .stat-icon,
.badge-shopping {
    background: var(--hb-shopping) !important;
    color: #ffffff !important;
}

.stat-card.maintenance,
.dashboard-stats .stat-card.maintenance {
    border-color: var(--hb-maintenance) !important;
}

.stat-card.maintenance .stat-icon,
.dashboard-stats .stat-card.maintenance .stat-icon,
.badge-maintenance {
    background: var(--hb-maintenance) !important;
    color: #ffffff !important;
}

.stat-card.pending .stat-icon,
.badge-pending {
    background: var(--hb-warning) !important;
}

.badge.priority-medium,
.priority-medium {
    background: #f4ead8 !important;
    color: #7a4a12 !important;
    border: 1px solid #e2cda8 !important;
}

.badge.priority-low,
.priority-low {
    background: #eef2f1 !important;
    color: #475467 !important;
    border: 1px solid #d5ddda !important;
}

.stat-card.progress .stat-icon,
.badge-progress,
.badge-in_progress,
.stat-card.overdue .stat-icon {
    background: var(--hb-info) !important;
}

.stat-card.overdue,
.badge-high,
.priority-high {
    border-color: var(--hb-danger) !important;
}

.stat-card.overdue .stat-icon,
.badge-overdue,
.badge-high,
.priority-high {
    background: var(--hb-danger) !important;
    color: #ffffff !important;
}

.stat-card.resolved .stat-icon,
.badge-resolved,
.badge-success {
    background: var(--hb-success) !important;
}

.badge.priority-high,
.priority-high {
    background: #f8e8e5 !important;
    color: #9f2d20 !important;
    border: 1px solid #efc9c2 !important;
}

.stat-content h3,
.ticket-title,
.data-table td,
.tickets-table td {
    color: var(--hb-text);
}

.stat-content p,
.ticket-description,
.text-muted,
.empty-state,
.data-table small,
.tickets-table small {
    color: var(--hb-text-muted);
}

.tickets-table th,
.data-table th,
.table-header,
.modal-header {
    background: var(--hb-surface-subtle) !important;
    color: var(--hb-text) !important;
    border-color: var(--hb-border) !important;
}

.modal-header h3,
.modal-header h3 i,
.modal-header .close {
    color: var(--hb-text) !important;
}

.modal-header .close:hover {
    background: var(--hb-surface-muted) !important;
    color: var(--hb-text) !important;
}

.tickets-table td,
.data-table td,
.modal-body,
.modal-footer,
.filters-header,
.content-card .card-header {
    border-color: var(--hb-border) !important;
}

.btn,
.btn-sm,
button,
input,
select,
textarea,
.filter-select,
.filter-input {
    border-radius: var(--hb-radius) !important;
    box-shadow: none !important;
}

.btn-primary,
.switch input:checked + .slider {
    background: var(--hb-accent) !important;
    border-color: var(--hb-accent) !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background: var(--hb-accent-hover) !important;
    border-color: var(--hb-accent-hover) !important;
}

.btn-secondary,
.btn-outline,
.btn.btn-outline {
    background: var(--hb-surface) !important;
    border: 1px solid var(--hb-border-strong) !important;
    color: var(--hb-text) !important;
}

.btn-secondary:hover,
.btn-outline:hover,
.btn.btn-outline:hover {
    background: var(--hb-surface-muted) !important;
    border-color: var(--hb-border-strong) !important;
}

input:focus,
select:focus,
textarea:focus,
.filter-select:focus,
.filter-input:focus,
.stat-card[role="button"]:focus {
    border-color: var(--hb-accent) !important;
    box-shadow: var(--hb-focus-ring) !important;
    outline: none;
}

.badge,
.priority-badge,
.status-badge {
    border-radius: var(--hb-radius-pill);
    box-shadow: none !important;
    letter-spacing: 0.02em;
}

.stat-card[style*="gradient"],
.modal-header[style*="gradient"] {
    background: var(--hb-surface) !important;
    border-color: var(--hb-border) !important;
    color: var(--hb-text) !important;
    box-shadow: none !important;
}

.stat-card[style*="gradient"] .stat-content h3,
.stat-card[style*="gradient"] .stat-content p,
.stat-card[style*="gradient"] .stat-icon {
    color: var(--hb-text) !important;
}

.is-mobile-host {
    --m-shadow: none;
}

.is-mobile-host .btn,
.is-mobile-host .content-card,
.is-mobile-host .tickets-table-container,
.is-mobile-host .table-responsive,
.is-mobile-host .tickets-table tr {
    box-shadow: none !important;
    border: 1px solid var(--hb-border);
}

/* Ticket details modal cleanup */
#ticketModal .modal-content,
#archiveTicketModal .modal-content {
    padding: 0;
    max-width: 760px;
    border-radius: var(--hb-radius-lg);
    max-height: 86vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#ticketModal .modal-header,
#archiveTicketModal .modal-header {
    flex: 0 0 auto;
}

#ticketModalContent,
#archiveTicketModalContent,
.modal-scroll-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

/* Dashboard ticket actions: match Employes compact action buttons */
.tickets-table td.ticket-actions {
    text-align: center;
}

.tickets-table td.ticket-actions .action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.tickets-table td.ticket-actions .btn-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: auto;
}

.tickets-table td.ticket-actions .btn-sm {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 4px 6px;
    border-radius: var(--hb-radius);
    font-size: 0.8rem;
    flex: 0 0 auto;
}

.tickets-table td.ticket-actions .btn-sm i {
    font-size: 0.8rem;
}

/* Unified action button system */
.action-buttons,
.actions-cell,
.table .actions-cell,
.tickets-table td.ticket-actions .action-buttons,
.tickets-cards-container .ticket-actions,
.ticket-actions .btn-group,
.action-buttons .btn-group,
.actions-cell .btn-group {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    white-space: nowrap;
}

.actions-cell {
    text-align: center;
}

.tickets-table td.ticket-actions,
.data-table td.actions-cell,
.table td.actions-cell,
.platform-container .data-table td:last-child {
    text-align: center !important;
    vertical-align: middle !important;
}

.action-buttons .btn,
.action-buttons .btn-sm,
.actions-cell .btn,
.actions-cell .btn-sm,
.tickets-table td.ticket-actions .btn,
.tickets-table td.ticket-actions .btn-sm,
.table .actions-cell .btn,
.table .actions-cell .btn-sm,
.btn-icon,
.batch-action-btn {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--hb-radius-md) !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    flex: 0 0 36px !important;
    transition: background-color var(--hb-transition), border-color var(--hb-transition), color var(--hb-transition), transform var(--hb-transition) !important;
}

.action-buttons .btn i,
.action-buttons .btn-sm i,
.actions-cell .btn i,
.actions-cell .btn-sm i,
.tickets-table td.ticket-actions .btn i,
.tickets-table td.ticket-actions .btn-sm i,
.table .actions-cell .btn i,
.table .actions-cell .btn-sm i,
.btn-icon i,
.batch-action-btn i {
    margin: 0 !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
}

.action-buttons .btn:hover,
.actions-cell .btn:hover,
.tickets-table td.ticket-actions .btn:hover,
.table .actions-cell .btn:hover,
.btn-icon:hover,
.batch-action-btn:hover {
    transform: translateY(-1px);
}

.action-buttons .btn-primary,
.action-buttons .btn-info,
.actions-cell .btn-primary,
.actions-cell .btn-info,
.tickets-table td.ticket-actions .btn-primary,
.tickets-table td.ticket-actions .btn-info,
.table .actions-cell .btn-primary,
.table .actions-cell .btn-info,
.btn-view {
    background: var(--hb-accent) !important;
    border-color: var(--hb-accent) !important;
    color: #ffffff !important;
}

.action-buttons .btn-primary:hover,
.action-buttons .btn-info:hover,
.actions-cell .btn-primary:hover,
.actions-cell .btn-info:hover,
.tickets-table td.ticket-actions .btn-primary:hover,
.tickets-table td.ticket-actions .btn-info:hover,
.table .actions-cell .btn-primary:hover,
.table .actions-cell .btn-info:hover,
.btn-view:hover {
    background: var(--hb-accent-hover) !important;
    border-color: var(--hb-accent-hover) !important;
}

.action-buttons .btn-secondary,
.action-buttons .btn-outline,
.actions-cell .btn-secondary,
.actions-cell .btn-outline,
.tickets-table td.ticket-actions .btn-secondary,
.tickets-table td.ticket-actions .btn-outline,
.table .actions-cell .btn-secondary,
.table .actions-cell .btn-outline,
.btn-edit,
.btn-edit-complete {
    background: var(--hb-surface) !important;
    border-color: var(--hb-border-strong) !important;
    color: var(--hb-text) !important;
}

.action-buttons .btn-secondary:hover,
.action-buttons .btn-outline:hover,
.actions-cell .btn-secondary:hover,
.actions-cell .btn-outline:hover,
.tickets-table td.ticket-actions .btn-secondary:hover,
.tickets-table td.ticket-actions .btn-outline:hover,
.table .actions-cell .btn-secondary:hover,
.table .actions-cell .btn-outline:hover,
.btn-edit:hover,
.btn-edit-complete:hover {
    background: var(--hb-surface-muted) !important;
    border-color: var(--hb-border-strong) !important;
}

.action-buttons .btn-warning,
.actions-cell .btn-warning,
.tickets-table td.ticket-actions .btn-warning,
.table .actions-cell .btn-warning,
.btn-restore {
    background: #fbbf24 !important;
    border-color: #fbbf24 !important;
    color: #111827 !important;
}

.action-buttons .btn-warning:hover,
.actions-cell .btn-warning:hover,
.tickets-table td.ticket-actions .btn-warning:hover,
.table .actions-cell .btn-warning:hover,
.btn-restore:hover {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #111827 !important;
}

.action-buttons .btn-success,
.actions-cell .btn-success,
.tickets-table td.ticket-actions .btn-success,
.table .actions-cell .btn-success {
    background: var(--hb-success) !important;
    border-color: var(--hb-success) !important;
    color: #ffffff !important;
}

.action-buttons .btn-danger,
.actions-cell .btn-danger,
.tickets-table td.ticket-actions .btn-danger,
.table .actions-cell .btn-danger,
.btn-delete {
    background: var(--hb-surface) !important;
    border-color: var(--hb-border-strong) !important;
    color: #374151 !important;
}

.action-buttons .btn-danger:hover,
.actions-cell .btn-danger:hover,
.tickets-table td.ticket-actions .btn-danger:hover,
.table .actions-cell .btn-danger:hover,
.btn-delete:hover {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: var(--hb-danger) !important;
}

@media (max-width: 768px) {
    .is-mobile-host .action-buttons,
    .is-mobile-host .actions-cell,
    .is-mobile-host .ticket-actions .btn-group,
    .is-mobile-host .tickets-cards-container .ticket-actions .btn-group {
        gap: 8px !important;
        justify-content: flex-end !important;
        display: flex !important;
        grid-template-columns: none !important;
    }

    .is-mobile-host .action-buttons .btn,
    .is-mobile-host .actions-cell .btn,
    .is-mobile-host .ticket-actions .btn-group .btn,
    .is-mobile-host .tickets-cards-container .ticket-actions .btn-group .btn {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        flex-basis: 40px !important;
    }
}
