/* ═══════════════════════════════════════════════════════════════
   SUPPORT AMRW — High-Tech Dark Blue UI
   ═══════════════════════════════════════════════════════════════ */

/* ── Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
::selection { background: rgba(33,150,243,0.3); color: white; }

/* ── Glass Card ── */
.glass-card {
    background: linear-gradient(135deg, rgba(17,27,41,0.8) 0%, rgba(14,22,33,0.9) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.3s ease;
}
.glass-card:hover {
    border-color: rgba(33,150,243,0.15);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05), 0 0 0 1px rgba(33,150,243,0.05);
}

/* ── Stat Card ── */
.stat-card {
    background: linear-gradient(135deg, rgba(17,27,41,0.7) 0%, rgba(14,22,33,0.85) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(33,150,243,0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover { transform: translateY(-2px); border-color: rgba(33,150,243,0.2); }

/* ── Input Fields ── */
.input-field {
    background: rgba(17,27,41,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e2e8f0;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
}
.input-field:focus {
    outline: none;
    border-color: rgba(33,150,243,0.5);
    box-shadow: 0 0 0 3px rgba(33,150,243,0.1), 0 0 20px rgba(33,150,243,0.05);
    background: rgba(17,27,41,0.8);
}
.input-field::placeholder { color: rgba(148,163,184,0.4); }

select.input-field { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center; background-repeat: no-repeat; background-size: 1.5em; padding-right: 2.5rem;
}

/* ── Buttons ── */
.btn-primary {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 50%, #0d47a1 100%);
    color: white; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(21,101,192,0.3);
    position: relative; overflow: hidden;
}
.btn-primary::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(21,101,192,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: white; border-color: rgba(255,255,255,0.2); }

.btn-danger {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #ef4444; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.btn-danger:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.3); }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-delete-ticket {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.15);
    color: #f87171; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.btn-delete-ticket:hover {
    background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.35);
    color: #ef4444; transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239,68,68,0.15);
}
.btn-delete-sm {
    background: transparent;
    border: 1px solid rgba(239,68,68,0.12);
    color: #6b7280; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.btn-delete-sm:hover {
    background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: #f87171;
}

#delete-confirm-overlay { opacity: 0; transition: opacity 0.2s ease; }
#delete-confirm-overlay.active { opacity: 1; }
.delete-confirm-modal {
    background: linear-gradient(145deg, rgba(17,27,41,0.98), rgba(10,16,25,0.98));
    border: 1px solid rgba(239,68,68,0.15); border-radius: 20px;
    padding: 32px; max-width: 420px; width: 100%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 40px rgba(239,68,68,0.08);
    backdrop-filter: blur(20px);
    transform: scale(0.9); transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
#delete-confirm-overlay.active .delete-confirm-modal { transform: scale(1); }
.delete-confirm-icon {
    width: 64px; height: 64px; margin: 0 auto;
    background: rgba(239,68,68,0.1); border: 2px solid rgba(239,68,68,0.2);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #f87171;
    animation: deleteIconPulse 2s ease-in-out infinite;
}
@keyframes deleteIconPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.2); }
    50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

/* ─── Active Project ─── */
.project-card-active {
    border-color: rgba(99,102,241,0.4) !important;
    box-shadow: 0 0 20px rgba(99,102,241,0.1), inset 0 0 0 1px rgba(99,102,241,0.15);
}
.project-card-active::before {
    content: ''; position: absolute; top: 12px; right: 12px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #818cf8; box-shadow: 0 0 8px rgba(99,102,241,0.5);
}
.project-card { position: relative; }

/* ─── Sidebar Project Selector ─── */
.sidebar-project-selector {
    appearance: none; -webkit-appearance: none;
    background: rgba(99,102,241,0.06); border: 1px solid rgba(99,102,241,0.15);
    color: #c7d2fe; font-size: 12px; font-weight: 600;
    padding: 8px 30px 8px 12px; border-radius: 10px; width: 100%;
    cursor: pointer; transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23818cf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-project-selector:hover {
    background-color: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3);
}
.sidebar-project-selector:focus {
    outline: none; border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.sidebar-project-selector option {
    background: #0f172a; color: #e2e8f0; padding: 8px;
}

/* ─── Topbar Project Selector ─── */
.topbar-project-selector {
    appearance: none; -webkit-appearance: none;
    background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2);
    color: #a5b4fc; font-size: 12px; font-weight: 600;
    padding: 4px 28px 4px 10px; border-radius: 8px;
    cursor: pointer; transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23818cf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
    max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-project-selector:hover {
    background-color: rgba(99,102,241,0.14); border-color: rgba(99,102,241,0.35);
}
.topbar-project-selector:focus {
    outline: none; border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.topbar-project-selector option {
    background: #0f172a; color: #e2e8f0; padding: 8px;
}

/* ─── Platform Badge ─── */
.platform-badge {
    background: rgba(99,102,241,0.1); color: #818cf8;
    border: 1px solid rgba(99,102,241,0.15);
}

/* ─── Voice Recorder ─── */
.voice-btn {
    background: rgba(99,102,241,0.1); border: 2px solid rgba(99,102,241,0.2);
    color: #818cf8; cursor: pointer;
}
.voice-btn:hover { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.4); transform: scale(1.05); }
.voice-btn.recording {
    background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.5);
    color: #f87171; animation: voicePulse 1.5s ease-in-out infinite;
}
.voice-btn.recording i::before { content: "\f04d"; } /* fa-stop icon */
@keyframes voicePulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
    50% { box-shadow: 0 0 0 14px rgba(239,68,68,0); }
}
.voice-waveform-bar {
    width: 3px; border-radius: 2px; background: #818cf8;
    transition: height 0.1s ease;
}
.recording .voice-waveform-bar { background: #f87171; }

/* ── Contact Creator Modal ── */
.btn-contact-creator {
    background: rgba(33,150,243,0.1);
    border: 1px solid rgba(33,150,243,0.2);
    color: #60a5fa; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.btn-contact-creator:hover {
    background: rgba(33,150,243,0.2); border-color: rgba(33,150,243,0.35);
    color: #93bbfc; transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33,150,243,0.15);
}

#contact-creator-overlay { opacity: 0; transition: opacity 0.2s ease; }
#contact-creator-overlay.active { opacity: 1; }
.contact-creator-modal {
    background: linear-gradient(145deg, rgba(17,27,41,0.98), rgba(10,16,25,0.98));
    border: 1px solid rgba(33,150,243,0.15); border-radius: 20px;
    padding: 28px; max-width: 540px; width: 100%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 40px rgba(33,150,243,0.06);
    backdrop-filter: blur(20px);
    transform: scale(0.9); transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
#contact-creator-overlay.active .contact-creator-modal { transform: scale(1); }

/* ── Navigation Items ── */
.nav-item {
    width: 100%; display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 0.75rem; border-radius: 0.625rem;
    color: #6b7888; font-size: 0.8125rem; font-weight: 500;
    transition: all 0.25s ease; cursor: pointer;
    border: 1px solid transparent; background: transparent;
    text-align: left;
}
.nav-item:hover { color: #e2e8f0; background: rgba(255,255,255,0.03); }
.nav-item.active {
    color: #42a5f5; background: rgba(33,150,243,0.08);
    border-color: rgba(33,150,243,0.15);
    box-shadow: 0 0 20px rgba(33,150,243,0.05);
}
.nav-item.active i { color: #42a5f5; }

/* ── Login Tabs ── */
.login-tab { color: #6b7888; background: transparent; border: none; cursor: pointer; }
.login-tab.active { color: white; background: rgba(33,150,243,0.15); box-shadow: 0 2px 8px rgba(33,150,243,0.1); }

/* ── Field Label ── */
.field-label {
    display: block; font-size: 0.6875rem; font-weight: 600;
    color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* ── Priority Badges ── */
.badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.25rem 0.625rem; border-radius: 9999px; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.025em; }
.badge-critique { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-haute { background: rgba(251,146,60,0.15); color: #fb923c; border: 1px solid rgba(251,146,60,0.2); }
.badge-moyenne { background: rgba(250,204,21,0.15); color: #fbbf24; border: 1px solid rgba(250,204,21,0.2); }
.badge-basse { background: rgba(52,211,153,0.15); color: #34d399; border: 1px solid rgba(52,211,153,0.2); }

/* ── Status Badges ── */
.status-a-traiter { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.15); }
.status-en-cours { background: rgba(251,191,36,0.1); color: #fbbf24; border: 1px solid rgba(251,191,36,0.15); }
.status-tests-push { background: rgba(168,85,247,0.1); color: #a78bfa; border: 1px solid rgba(168,85,247,0.15); }
.status-resolu { background: rgba(52,211,153,0.1); color: #34d399; border: 1px solid rgba(52,211,153,0.15); }
.status-ferme { background: rgba(107,114,128,0.1); color: #9ca3af; border: 1px solid rgba(107,114,128,0.15); }

/* ── Type Badges ── */
.type-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.5rem; border-radius: 0.375rem; font-size: 0.625rem; font-weight: 600; }
.type-bug { background: rgba(239,68,68,0.1); color: #f87171; }
.type-dysfonctionnement { background: rgba(251,146,60,0.1); color: #fb923c; }
.type-erreur { background: rgba(244,63,94,0.1); color: #fb7185; }
.type-ajustement { background: rgba(59,130,246,0.1); color: #60a5fa; }
.type-amelioration { background: rgba(168,85,247,0.1); color: #a78bfa; }
.type-question { background: rgba(20,184,166,0.1); color: #2dd4bf; }

/* ── Ticket Row ── */
.ticket-row {
    transition: all 0.2s ease; cursor: pointer;
}
.ticket-row:hover {
    background: rgba(33,150,243,0.03);
}
.ticket-row td { padding: 0.75rem 1rem; vertical-align: middle; }

/* ── Toast ── */
.toast {
    padding: 0.875rem 1.25rem; border-radius: 0.75rem;
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.8125rem; font-weight: 500;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideInRight 0.3s ease forwards;
    min-width: 300px; max-width: 420px;
}
.toast-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.toast-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.toast-info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: #60a5fa; }
.toast-warning { background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.3); color: #fbbf24; }

/* ── Project Card ── */
.project-card {
    transition: all 0.3s ease;
    position: relative; overflow: hidden;
}
.project-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #1976d2, #42a5f5, #00d4ff);
    opacity: 0; transition: opacity 0.3s ease;
}
.project-card:hover::after { opacity: 1; }
.project-card:hover { transform: translateY(-2px); }

/* ── Team Member Card ── */
.team-card { transition: all 0.3s ease; }
.team-card:hover { transform: translateY(-2px); border-color: rgba(33,150,243,0.2); }

/* ── Comment ── */
.comment-bubble {
    background: rgba(33,150,243,0.05);
    border: 1px solid rgba(33,150,243,0.1);
    border-radius: 0 0.75rem 0.75rem 0.75rem;
    padding: 0.75rem 1rem;
}
.comment-bubble.support {
    background: rgba(168,85,247,0.05);
    border-color: rgba(168,85,247,0.1);
    border-radius: 0.75rem 0 0.75rem 0.75rem;
}

/* ── Pulse animation for critical ── */
.pulse-critical {
    animation: pulseCritical 2s ease-in-out infinite;
}

/* ── File preview ── */
.file-preview-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem 0.75rem; border-radius: 0.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}

/* ── Timeline dot ── */
.timeline-dot {
    width: 10px; height: 10px; border-radius: 50%;
    border: 2px solid currentColor;
    background: rgba(10,16,25,1);
    position: relative; z-index: 2;
}

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOutRight { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }
@keyframes pulseCritical { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }
.animate-slideUp { animation: slideUp 0.6s ease forwards; }
.animate-spin { animation: spin 1s linear infinite; }

/* ── Loading skeleton ── */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 1023px) {
    #sidebar.open { transform: translateX(0); }
    #main-content { margin-left: 0; }
    .stat-card { padding: 1rem; }
}

@media (max-width: 640px) {
    .toast { min-width: 260px; font-size: 0.75rem; }
    #page-container { padding: 1rem; }
}

/* ── Z-index for sidebar overlay ── */
#sidebar-overlay { z-index: 35; }

/* ── Modal scrollbar ── */
#modal-content { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }

/* ── Drag over state ── */
.drag-over { border-color: rgba(33,150,243,0.5) !important; background: rgba(33,150,243,0.05) !important; }

/* ── Pagination button ── */
.page-btn {
    width: 28px; height: 28px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6875rem; font-weight: 600;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    color: #94a3b8; cursor: pointer; transition: all 0.2s ease;
}
.page-btn:hover { background: rgba(33,150,243,0.1); border-color: rgba(33,150,243,0.2); color: white; }
.page-btn.active { background: rgba(33,150,243,0.15); border-color: rgba(33,150,243,0.3); color: #42a5f5; }

/* ── Copy button ── */
.copy-btn {
    opacity: 0; transition: opacity 0.2s ease; cursor: pointer;
    color: #6b7888; font-size: 0.625rem;
}
.copy-btn:hover { color: #42a5f5; }
*:hover > .copy-btn { opacity: 1; }

/* ── Edit Form ── */
.edit-existing-file {
    transition: all 0.3s ease;
}
.edit-existing-file.opacity-30 {
    opacity: 0.3;
    text-decoration: line-through;
}
.edit-existing-file.opacity-30 img {
    filter: grayscale(1);
}

#edit-ticket-form .field-label {
    margin-top: 0;
}

#edit-ticket-form textarea {
    min-height: 3rem;
}

/* ── Tags ── */
.tag-item {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.2rem 0.6rem; border-radius: 9999px;
    font-size: 0.65rem; font-weight: 600;
    background: rgba(33,150,243,0.1); color: #60a5fa;
    border: 1px solid rgba(33,150,243,0.2);
    transition: all 0.2s ease;
}
.tag-item button {
    background: none; border: none; color: inherit;
    cursor: pointer; font-size: 0.8rem; line-height: 1;
    padding: 0; margin-left: 0.15rem;
    opacity: 0.6; transition: opacity 0.2s ease;
}
.tag-item button:hover { opacity: 1; color: #f87171; }

.tag-item-display {
    display: inline-flex; align-items: center;
    padding: 0.25rem 0.75rem; border-radius: 9999px;
    font-size: 0.65rem; font-weight: 600;
    background: rgba(33,150,243,0.1); color: #60a5fa;
    border: 1px solid rgba(33,150,243,0.2);
}

.tag-preset {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.5rem; border-radius: 9999px;
    font-size: 0.6rem; font-weight: 500;
    background: rgba(255,255,255,0.03); color: #94a3b8;
    border: 1px dashed rgba(255,255,255,0.1);
    cursor: pointer; transition: all 0.2s ease;
}
.tag-preset:hover {
    background: rgba(33,150,243,0.08); color: #60a5fa;
    border-color: rgba(33,150,243,0.3);
}

/* ── SLA Badges ── */
.sla-badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.6rem; border-radius: 9999px;
    font-size: 0.6rem; font-weight: 700;
    letter-spacing: 0.02em;
}
.sla-badge-sm {
    display: inline-flex; align-items: center; gap: 0.2rem;
    padding: 0.15rem 0.45rem; border-radius: 9999px;
    font-size: 0.55rem; font-weight: 600;
    white-space: nowrap;
}
.sla-ok, .sla-badge-sm.sla-ok {
    background: rgba(52,211,153,0.1); color: #34d399;
    border: 1px solid rgba(52,211,153,0.2);
}
.sla-warning, .sla-badge-sm.sla-warning {
    background: rgba(251,191,36,0.15); color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.25);
    animation: pulseCritical 2s ease-in-out infinite;
}
.sla-breached, .sla-badge-sm.sla-breached {
    background: rgba(239,68,68,0.15); color: #f87171;
    border: 1px solid rgba(239,68,68,0.25);
    animation: pulseCritical 1.5s ease-in-out infinite;
}
.sla-met, .sla-badge-sm.sla-met {
    background: rgba(107,114,128,0.1); color: #9ca3af;
    border: 1px solid rgba(107,114,128,0.15);
}

/* ── SLA Info Bar (ticket detail) ── */
.sla-info-bar {
    padding: 0.875rem 1rem; border-radius: 0.75rem;
    border: 1px solid; display: flex; align-items: center;
}
.sla-icon-wrapper {
    width: 2rem; height: 2rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; flex-shrink: 0;
}
.sla-bar-ok {
    background: rgba(52,211,153,0.05); border-color: rgba(52,211,153,0.15); color: #34d399;
}
.sla-bar-ok .sla-icon-wrapper { background: rgba(52,211,153,0.15); }
.sla-bar-warning {
    background: rgba(251,191,36,0.05); border-color: rgba(251,191,36,0.15); color: #fbbf24;
}
.sla-bar-warning .sla-icon-wrapper { background: rgba(251,191,36,0.15); }
.sla-bar-breached {
    background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.15); color: #f87171;
}
.sla-bar-breached .sla-icon-wrapper { background: rgba(239,68,68,0.15); }
.sla-bar-met {
    background: rgba(107,114,128,0.05); border-color: rgba(107,114,128,0.15); color: #9ca3af;
}
.sla-bar-met .sla-icon-wrapper { background: rgba(107,114,128,0.15); }

/* ── Guide Steps ── */
.guide-step {
    position: relative;
    padding: 1.25rem 1.5rem;
    background: rgba(17,27,41,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 1rem;
    transition: all 0.3s ease;
}
.guide-step:hover {
    border-color: rgba(33,150,243,0.2);
    background: rgba(17,27,41,0.7);
}
.step-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.75rem; height: 1.75rem; border-radius: 50%;
    background: linear-gradient(135deg, #1976d2, #42a5f5);
    color: white; font-size: 0.75rem; font-weight: 700;
    flex-shrink: 0; box-shadow: 0 2px 8px rgba(33,150,243,0.3);
}

/* ── Code Blocks ── */
.code-inline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 0.375rem;
    background: rgba(33,150,243,0.08);
    color: #60a5fa;
    border: 1px solid rgba(33,150,243,0.15);
}
.code-block {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: rgba(10,16,25,0.8);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
    position: relative;
}
.code-block::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, #1976d2, #42a5f5, #00d4ff);
    border-radius: 0.75rem 0.75rem 0 0;
}

/* ═══════════════════════════════════════════════════════════════
   MEDIA SECTION — Gallery & Attachments
   ═══════════════════════════════════════════════════════════════ */

.media-section {
    margin-top: 0.5rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: rgba(17,27,41,0.3);
    border: 1px solid rgba(255,255,255,0.04);
}

/* ── Image Gallery Grid ── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.gallery-item {
    position: relative;
    border-radius: 0.625rem;
    overflow: hidden;
    cursor: zoom-in;
    min-height: 180px;
    max-height: 300px;
    background: rgba(10,16,25,0.6);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.3s ease;
}
.gallery-item:hover {
    border-color: rgba(33,150,243,0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4), 0 0 0 1px rgba(33,150,243,0.1);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}

/* Overlay with expand icon on hover */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gallery-overlay::after {
    content: 'Cliquer pour agrandir';
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
}
.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Label at bottom of gallery item */
.gallery-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0.35rem 0.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    font-size: 0.6rem;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Error state when image fails to load */
.gallery-error .gallery-img {
    display: none;
}
.gallery-error {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239,68,68,0.05);
    border-color: rgba(239,68,68,0.15);
}
.gallery-error::after {
    content: '\f03e'; /* fa-image fallback */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.5rem;
    color: rgba(239,68,68,0.3);
}
.gallery-error .gallery-overlay,
.gallery-error .gallery-label {
    display: none;
}

/* ── Chargement des pièces jointes à la demande ──
   Les images vivent hors du ticket (table ticket_files) : cet état couvre
   le court instant entre l'ouverture du ticket et l'arrivée de l'image. */
.gallery-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
}
.gallery-spinner {
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.25rem;
}
.gallery-loading .gallery-label {
    opacity: .6;
}

/* ── File Icon Wrapper ── */
.file-icon-wrapper {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: rgba(33,150,243,0.08);
    border: 1px solid rgba(33,150,243,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #60a5fa;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.file-preview-item:hover .file-icon-wrapper {
    background: rgba(33,150,243,0.15);
    border-color: rgba(33,150,243,0.3);
}

/* ═══════════════════════════════════════════════════════════════
   LIGHTBOX — Full-screen Image Viewer
   ═══════════════════════════════════════════════════════════════ */

.lightbox-container {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    background: rgba(2,6,12,0.96);
    backdrop-filter: blur(30px);
    animation: fadeIn 0.25s ease;
}

/* Top bar with counter + action buttons */
.lightbox-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(10,16,25,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.lightbox-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #94a3b8;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.lightbox-btn:hover {
    background: rgba(255,255,255,0.12);
    color: white;
    border-color: rgba(255,255,255,0.15);
}

/* Main image area — Fit mode (default) */
.lightbox-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem;
    overflow: hidden;
    min-height: 0;
    cursor: zoom-in;
}

/* Zoomed mode — scrollable full-size */
.lightbox-body.lightbox-body-zoomed {
    overflow: auto;
    align-items: flex-start;
    justify-content: flex-start;
    cursor: zoom-out;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.lightbox-body.lightbox-body-zoomed::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.lightbox-body.lightbox-body-zoomed::-webkit-scrollbar-track {
    background: transparent;
}
.lightbox-body.lightbox-body-zoomed::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}
.lightbox-body.lightbox-body-zoomed::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

/* Image — Fit mode */
.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: lightboxZoomIn 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
    transition: none;
}

/* Image — Full-size / zoomed mode */
.lightbox-image.lightbox-image-zoomed {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    object-fit: none;
    border-radius: 0;
    box-shadow: none;
    animation: lightboxZoomExpand 0.3s ease;
    cursor: zoom-out;
}

.lightbox-btn-active {
    background: rgba(33,150,243,0.2) !important;
    border-color: rgba(33,150,243,0.4) !important;
    color: #60a5fa !important;
}

@keyframes lightboxZoomIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes lightboxZoomExpand {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Navigation arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(10,16,25,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
}
.lightbox-nav:hover {
    background: rgba(33,150,243,0.2);
    border-color: rgba(33,150,243,0.4);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 20px rgba(33,150,243,0.2);
}
.lightbox-nav-prev {
    left: 1rem;
}
.lightbox-nav-next {
    right: 1rem;
}

/* Thumbnail strip */
.lightbox-thumbs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(10,16,25,0.6);
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.lightbox-thumbs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.lightbox-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 0.375rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.08);
    opacity: 0.5;
    transition: all 0.25s ease;
    flex-shrink: 0;
    background: rgba(10,16,25,0.6);
}
.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lightbox-thumb:hover {
    opacity: 0.85;
    border-color: rgba(255,255,255,0.2);
}
.lightbox-thumb.active {
    opacity: 1;
    border-color: #42a5f5;
    box-shadow: 0 0 10px rgba(33,150,243,0.3);
}

/* ── Lightbox Responsive ── */
@media (max-width: 640px) {
    .lightbox-nav {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.85rem;
    }
    .lightbox-nav-prev { left: 0.5rem; }
    .lightbox-nav-next { right: 0.5rem; }
    
    .lightbox-thumb {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   ESCALATION / RELANCE BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn-escalate {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.btn-escalate:hover {
    background: rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.5);
    color: #fca5a5; transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239,68,68,0.25);
}
.btn-escalate-sm {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    color: #f87171; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.btn-escalate-sm:hover {
    background: rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.5);
    color: #fca5a5;
}
.animate-pulse-slow {
    animation: escalatePulse 2.5s ease-in-out infinite;
}
@keyframes escalatePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.35); }
    50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* Escalation comment in message thread */
.comment-bubble.escalation {
    background: rgba(239,68,68,0.08) !important;
    border-left: 3px solid #f87171 !important;
}
/* Republish comment in message thread */
.comment-bubble.republish {
    background: rgba(249,115,22,0.08) !important;
    border-left: 3px solid #fb923c !important;
}

/* ── Republish Button ── */
.btn-republish {
    background: rgba(249,115,22,0.12);
    border: 1px solid rgba(249,115,22,0.3);
    color: #fb923c; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.btn-republish:hover {
    background: rgba(249,115,22,0.25); border-color: rgba(249,115,22,0.5);
    color: #fdba74; transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(249,115,22,0.25);
}

/* ── Republished Badge (detail view) ── */
.badge-republished {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.7rem; border-radius: 9999px;
    font-size: 0.65rem; font-weight: 700;
    background: rgba(249,115,22,0.15);
    color: #fb923c;
    border: 1px solid rgba(249,115,22,0.3);
    animation: republishGlow 3s ease-in-out infinite;
}
/* ── Republished Badge Small (table row) ── */
.badge-republished-sm {
    display: inline-flex; align-items: center;
    padding: 0.1rem 0.45rem; border-radius: 9999px;
    font-size: 0.55rem; font-weight: 700;
    background: rgba(249,115,22,0.15);
    color: #fb923c;
    border: 1px solid rgba(249,115,22,0.25);
    white-space: nowrap;
}
@keyframes republishGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.3); }
    50% { box-shadow: 0 0 0 6px rgba(249,115,22,0); }
}

/* ═══════════════════════════════════════════════════════════════
   SECTIONS PICKER (Admin Project Modal)
   ═══════════════════════════════════════════════════════════════ */

.sections-picker {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0.75rem;
    background: rgba(10,16,25,0.5);
    max-height: 280px;
    overflow-y: auto;
}
.sections-picker::-webkit-scrollbar { width: 4px; }
.sections-picker::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.section-group-header {
    padding: 0.5rem 0.75rem;
    background: rgba(33,150,243,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: sticky; top: 0; z-index: 1;
}
.section-group-header label {
    font-weight: 700; font-size: 0.7rem; color: #94a3b8;
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
}
.section-item {
    padding: 0.35rem 0.75rem 0.35rem 1.5rem;
    display: flex; align-items: center; gap: 0.5rem;
    transition: background 0.15s ease;
}
.section-item:hover {
    background: rgba(33,150,243,0.05);
}
.section-item label {
    font-size: 0.7rem; color: #cbd5e1; cursor: pointer;
    display: flex; align-items: center; gap: 0.4rem; flex: 1;
}
.section-item input[type="checkbox"] {
    width: 0.875rem; height: 0.875rem; border-radius: 3px;
    accent-color: #2196f3;
}
.section-group-header input[type="checkbox"] {
    width: 0.875rem; height: 0.875rem; border-radius: 3px;
    accent-color: #2196f3;
}
.custom-section-input {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.custom-section-input input {
    flex: 1; font-size: 0.7rem;
}
.custom-section-tag {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.2rem 0.6rem; border-radius: 9999px;
    font-size: 0.65rem; font-weight: 600;
    background: rgba(168,85,247,0.15);
    color: #c084fc;
    border: 1px solid rgba(168,85,247,0.25);
}
.custom-section-tag button {
    background: none; border: none; color: #c084fc; cursor: pointer;
    font-size: 0.6rem; padding: 0; line-height: 1;
    opacity: 0.6; transition: opacity 0.15s;
}
.custom-section-tag button:hover { opacity: 1; }

/* ─── Team Members Picker (project modal) ─── */
.team-members-picker {
    max-height: 210px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 0.75rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: rgba(0,0,0,0.15);
}
.team-members-picker::-webkit-scrollbar { width: 4px; }
.team-members-picker::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.team-member-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.team-member-option:hover {
    background: rgba(255,255,255,0.04);
}
.team-member-option.selected {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.25);
}
.team-member-option input[type="checkbox"] {
    display: none;
}
.team-member-option .check-icon {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}
.team-member-option.selected .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* ─── Team Add Inline (project modal) ─── */
.team-add-inline {
    border-top: 1px dashed rgba(255,255,255,0.06);
    padding-top: 0.5rem;
}

/* ─── Settings Team Row ─── */
.settings-team-row {
    border: 1px solid rgba(255,255,255,0.03);
}
.settings-team-row:hover {
    border-color: rgba(255,255,255,0.06);
}
