﻿/* EMS Grid */
.ems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* Page retraités (/admin/ems) */
.ems-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.retired-toolbar {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.retired-search-bar {
    flex: 1;
    min-width: 220px;
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.retired-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0 0.9rem;
    min-height: 52px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.retired-toolbar-btn:hover {
    background: var(--bg-card);
    border-color: rgba(99, 102, 241, 0.35);
}

.retired-toolbar-btn i {
    width: 16px;
    height: 16px;
}

.retired-toolbar-btn.is-loading {
    opacity: 0.75;
    cursor: wait;
}

.retired-toolbar-btn.is-loading i {
    animation: spin 0.8s linear infinite;
}

.retired-toolbar-btn--primary {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15));
    border-color: rgba(245, 158, 11, 0.45);
    color: #fcd34d;
}

.retired-toolbar-btn--primary:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.22));
}

.retired-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-primary);
    padding: 0.75rem;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.retired-search-input-wrap > i {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.retired-search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.retired-search-clear {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
}

.retired-search-clear:hover {
    color: var(--danger);
}

.retired-search-clear i {
    width: 18px;
    height: 18px;
}

.retired-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.retired-member-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 100%;
    overflow: hidden;
}

.retired-member-card-main {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
}

.retired-member-card--skeleton {
    pointer-events: none;
}

.retired-member-card--skeleton .retired-member-card-main {
    width: 100%;
}

.retired-skeleton-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: retired-shimmer 1.4s ease-in-out infinite;
}

.retired-skeleton-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.retired-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: retired-shimmer 1.4s ease-in-out infinite;
}

.retired-skeleton-line--title { width: 42%; height: 16px; }
.retired-skeleton-line--short { width: 28%; }
.retired-skeleton-line--medium { width: 65%; }
.retired-skeleton-line--long { width: 88%; }

.retired-skeleton-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.retired-skeleton-btn {
    width: 120px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: retired-shimmer 1.4s ease-in-out infinite;
}

.retired-skeleton-btn--small {
    width: 90px;
    height: 32px;
}

@keyframes retired-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.retired-member-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.retired-details-btn {
    background: rgba(99, 102, 241, 0.12);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.35);
    padding: 0.55rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.retired-details-btn:hover,
.retired-details-btn.is-active {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.55);
}

.retired-details-btn i {
    width: 15px;
    height: 15px;
}

.retired-member-details {
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
    padding: 0.85rem 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.retired-member-details[hidden] {
    display: none !important;
}

.retired-member-details-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.retired-member-details-row i {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #a5b4fc;
}

.retired-member-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.retired-copy-id-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.retired-copy-id-btn:hover {
    color: var(--text-primary);
    border-color: rgba(99, 102, 241, 0.45);
}

.retired-copy-id-btn i {
    width: 14px;
    height: 14px;
}

.add-retired-dropdown {
    margin-bottom: 1rem;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(15, 23, 42, 0.6));
    overflow: hidden;
}

.add-retired-dropdown-inner {
    padding: 1rem 1.1rem 1.1rem;
}

.add-retired-dropdown-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.add-retired-dropdown-header strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.add-retired-help {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.add-retired-close,
.add-retired-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.add-retired-close:hover,
.add-retired-icon-btn:hover {
    color: var(--text-primary);
}

.add-retired-close i,
.add-retired-icon-btn i {
    width: 16px;
    height: 16px;
}

.add-retired-search-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-darker);
    margin-bottom: 0.65rem;
}

.add-retired-search-row i {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.add-retired-search-row input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.add-retired-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-height: 1.1rem;
    margin-bottom: 0.55rem;
}

.add-retired-status--error {
    color: #f87171;
}

.add-retired-results {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: 320px;
    overflow-y: auto;
}

.add-retired-result-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.12);
}

.add-retired-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.add-retired-result-info {
    flex: 1;
    min-width: 0;
}

.add-retired-result-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.add-retired-result-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.add-retired-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.add-retired-badge--ems {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.add-retired-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.add-retired-submit-btn:hover {
    filter: brightness(1.05);
}

.add-retired-submit-btn i {
    width: 14px;
    height: 14px;
}

.add-retired-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--text-secondary);
}

.add-retired-empty i {
    width: 28px;
    height: 28px;
    margin-bottom: 0.5rem;
    opacity: 0.65;
}

.add-retired-empty p {
    margin: 0;
    font-size: 0.85rem;
}

.retired-member-card--rich .retired-member-avatar img {
    width: 56px;
    height: 56px;
}

.retired-member-card[hidden] {
    display: none !important;
}

.retired-member-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.retired-member-info {
    flex: 1;
    min-width: 0;
}

.retired-member-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.retired-member-since {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.retired-member-since i {
    width: 12px;
    height: 12px;
}

.retired-member-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.9rem;
    margin-top: 0.55rem;
}

.retired-member-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.retired-member-meta-item--wide {
    grid-column: 1 / -1;
}

.retired-member-meta-item i {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

.retired-member-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.retired-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(74, 95, 193, 0.35);
    background: rgba(74, 95, 193, 0.12);
    color: #c7d2fe;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.retired-link-btn:hover {
    background: rgba(74, 95, 193, 0.22);
}

.retired-link-btn i {
    width: 14px;
    height: 14px;
}

.retired-remove-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.retired-remove-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.retired-remove-btn i {
    width: 16px;
    height: 16px;
}

.retired-empty-state,
.retired-no-search-result {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--bg-darker), var(--bg-dark));
    border: 2px solid var(--border);
    border-radius: 16px;
    margin: 1rem auto;
    max-width: 700px;
}

.retired-empty-state h3,
.retired-no-search-title {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.retired-empty-state p,
.retired-no-search-desc {
    margin: 0;
    opacity: 0.75;
    line-height: 1.5;
}

.retired-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.2);
}

.retired-empty-icon i {
    width: 32px;
    height: 32px;
    opacity: 0.6;
    color: var(--primary);
}

.retired-empty-state--error .retired-empty-icon i {
    color: var(--danger);
}

.retired-no-search-result i {
    width: 48px;
    height: 48px;
    opacity: 0.5;
    margin-bottom: 1rem;
    color: var(--warning);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.ems-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ems-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ems-card.onduty {
    border-color: var(--success);
}

.ems-card.retired-card {
    border-color: #d4af37;
    background: linear-gradient(135deg, var(--bg-dark) 0%, rgba(212, 175, 55, 0.05) 100%);
}

.ems-actions-box {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border);
    justify-content: center;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--bg-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.action-btn.warning:hover {
    background: var(--warning);
    border-color: var(--warning);
}

.action-btn.retired:hover {
    background: #d4af37;
    border-color: #d4af37;
}

.ems-avatar {
    position: relative;
}

.ems-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.ems-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}

.ems-status.online { background: var(--success); }
.ems-status.idle { background: var(--warning); }
.ems-status.dnd { background: var(--danger); }
.ems-status.offline { background: #747F8D; }

.ems-info {
    flex: 1;
}

.ems-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ems-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--success);
    color: var(--bg-dark);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Tickets page */
.tickets-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tickets-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.tickets-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.tickets-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid rgba(46, 213, 115, 0.45);
    border-radius: 8px;
    background: rgba(46, 213, 115, 0.12);
    color: #86efac;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.tickets-create-btn:hover:not(:disabled) {
    background: rgba(46, 213, 115, 0.2);
}

.tickets-create-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.tickets-create-btn--submit {
    border-color: rgba(46, 213, 115, 0.55);
}

.tickets-create-btn i {
    width: 15px;
    height: 15px;
}

.create-ticket-panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    padding: 1rem 1.1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.create-ticket-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.create-ticket-panel-head h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    color: var(--text-primary);
}

.create-ticket-panel-head p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.create-ticket-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.create-ticket-panel-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.create-ticket-panel-search .tickets-control-input {
    flex: 1;
}

.create-ticket-paste-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
}

.create-ticket-open-warning {
    margin-bottom: 0.75rem;
}

.create-ticket-open-warning-inner {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.1);
    color: var(--text-primary);
}

.create-ticket-open-warning-inner i {
    width: 20px;
    height: 20px;
    color: #fbbf24;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.create-ticket-open-warning-inner strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

.create-ticket-open-warning-inner p {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.create-ticket-open-warning-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #60a5fa;
    text-decoration: none;
}

.create-ticket-open-warning-link:hover {
    text-decoration: underline;
}

.create-ticket-results {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    margin-bottom: 0.85rem;
}

.create-ticket-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    text-align: center;
}

.create-ticket-empty i {
    width: 28px;
    height: 28px;
    opacity: 0.5;
}

.create-ticket-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.create-ticket-candidate {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.create-ticket-candidate:last-child {
    border-bottom: none;
}

.create-ticket-candidate:hover {
    background: rgba(59, 130, 246, 0.08);
}

.create-ticket-candidate.is-selected {
    background: rgba(46, 213, 115, 0.12);
    outline: 1px solid rgba(46, 213, 115, 0.35);
}

.create-ticket-candidate-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.create-ticket-candidate-info {
    min-width: 0;
    flex: 1;
}

.create-ticket-candidate-name {
    font-weight: 600;
    color: var(--text-primary);
}

.create-ticket-candidate-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.create-ticket-panel-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.create-ticket-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-height: 1.2em;
}

.create-ticket-status--error {
    color: #fca5a5;
}

.create-ticket-status--success {
    color: #86efac;
}

.tickets-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid rgba(59, 130, 246, 0.45);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.tickets-refresh-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.18);
}

.tickets-refresh-btn:disabled {
    cursor: wait;
}

.tickets-refresh-btn.is-loading {
    opacity: 0.75;
}

.tickets-refresh-btn i {
    width: 15px;
    height: 15px;
}

.tickets-refresh-btn.is-loading i {
    animation: spin 0.8s linear infinite;
}

.tickets-list--loading {
    pointer-events: none;
}

.ticket-section-title--skeleton {
    min-height: 1.5rem;
}

.ticket-skeleton-line {
    display: inline-block;
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: tickets-shimmer 1.4s ease-in-out infinite;
}

.ticket-skeleton-line--title {
    width: 180px;
    height: 16px;
}

.ticket-item-skeleton {
    pointer-events: none;
}

.ticket-item-skeleton--open {
    grid-template-columns: 24px 120px minmax(230px, 1fr) 190px 110px 190px 128px;
}

.ticket-item-skeleton--history {
    grid-template-columns: 24px 120px minmax(200px, 1fr) 170px 100px 100px 100px 155px 170px 128px;
}

.ticket-skeleton-cell {
    display: block;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: tickets-shimmer 1.4s ease-in-out infinite;
}

@keyframes tickets-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.tickets-history-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bg-darker), var(--bg-dark));
}

.tickets-control-input {
    flex: 1;
    min-width: 220px;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text-primary);
    outline: none;
}

.tickets-control-select {
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text-primary);
}

.tickets-active-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.filter-badge-clear {
    margin-left: 0.25rem;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

.filter-badge-clear i {
    width: 12px;
    height: 12px;
}

.tickets-empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 2rem;
    margin: 1.5rem auto;
    max-width: 520px;
    background: linear-gradient(135deg, var(--bg-darker), var(--bg-dark));
    border: 2px solid var(--border);
    border-radius: 16px;
}

.tickets-empty-state h3 {
    margin: 0 0 0.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.tickets-empty-state p {
    margin: 0;
    line-height: 1.5;
    opacity: 0.75;
}

.tickets-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(79, 70, 229, 0.1));
    border: 2px solid rgba(99, 102, 241, 0.2);
}

.tickets-empty-icon i {
    width: 32px;
    height: 32px;
    opacity: 0.6;
    color: #6366f1;
}

.tickets-empty-state--error .tickets-empty-icon i {
    color: var(--danger);
}

.ticket-section-title i {
    width: 16px;
    height: 16px;
}

.ticket-actions-item--disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.ticket-btn i,
.ticket-actions-item i,
.ticket-closed-by i,
.ticket-status i {
    width: 14px;
    height: 14px;
}

/* Tickets Table */
.tickets-table {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.ticket-table-head {
    display: grid;
    gap: 0.9rem;
    align-items: center;
    padding: 0.72rem 1.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.98);
    color: #cbd5e1;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 150;
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.08);
}

.ticket-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: 0.9rem;
    align-items: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.01), rgba(255,255,255,0));
    transition: background 0.2s ease;
}

.ticket-table-head > *:not(:first-child),
.ticket-item > *:not(:first-child) {
    border-left: 1px solid rgba(148, 163, 184, 0.14);
    padding-left: 0.72rem;
}

.ticket-table-head--open {
    grid-template-columns: 24px 120px minmax(230px, 1fr) 190px 110px 190px 128px;
}

.ticket-table-head--history {
    grid-template-columns: 24px 120px minmax(200px, 1fr) 170px 100px 100px 100px 155px 170px 128px;
}

.ticket-item--open {
    grid-template-columns: 24px 120px minmax(230px, 1fr) 190px 110px 190px 128px;
}

.ticket-item--history {
    grid-template-columns: 24px 120px minmax(200px, 1fr) 170px 100px 100px 100px 155px 170px 128px;
}

.ticket-table-head > *,
.ticket-item > * {
    min-width: 0;
}

.ticket-cell {
    color: var(--text-secondary);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-cell--mono {
    font-family: 'Consolas', 'Courier New', monospace;
    color: #cbd5e1;
    font-size: 0.78rem;
}

.ticket-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.02));
}

.ticket-item:last-child {
    border-bottom: none;
}

.ticket-type {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.ticket-type.Direction { background: #5865F2; }
.ticket-type.Recrutement { background: #57F287; color: #23272A; }
.ticket-type.CSE { background: #FEE75C; color: #23272A; }
.ticket-type.Logistique { background: #EB459E; }

.ticket-user {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-user-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    overflow: hidden;
}

.ticket-user-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ticket-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--bg-darker);
    object-fit: cover;
}

.ticket-avatar[data-lazy="loading"] {
    opacity: 0.5;
}

/* Filtres actifs */
.filter-badge-active {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.filter-badge-active button {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.filter-badge-active button:hover {
    opacity: 1;
}

/* Loading spinner */
.tickets-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
    color: var(--text-secondary);
}

.tickets-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ticket-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ticket-select input {
    width: 15px;
    height: 15px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.ticket-select--placeholder {
    width: 15px;
    height: 15px;
    opacity: 0;
}

.ticket-closed-by {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-closed-by--empty {
    opacity: 0.4;
}

.ticket-status {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.ticket-status.claimed {
    background: var(--success);
    color: var(--bg-dark);
}

.ticket-status.unclaimed {
    background: var(--warning);
    color: var(--bg-dark);
}

.ticket-status--history {
    padding: 0.3rem 0.58rem;
    font-size: 0.69rem;
    border-radius: 7px;
    gap: 0.3rem;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: nowrap;
}

.ticket-actions--history {
    justify-content: flex-start;
    gap: 0.32rem;
}

.ticket-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.78rem;
    border-radius: 9px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.16s ease;
}

.ticket-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.ticket-btn--primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: rgba(59,130,246,0.65);
}

.ticket-btn--danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-color: rgba(239,68,68,0.65);
}

.ticket-btn--muted {
    background: linear-gradient(135deg, #3c4452, #2c3442);
    border-color: rgba(148, 163, 184, 0.35);
}

.ticket-btn:disabled,
.ticket-btn.is-loading {
    opacity: 0.65;
    cursor: wait;
    transform: none;
    filter: none;
}

.ticket-history-toolbar {
    margin-top: 0;
    margin-bottom: 0.8rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: linear-gradient(135deg, rgba(71, 85, 105, 0.2), rgba(51, 65, 85, 0.14));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.ticket-history-toolbar--outside {
    margin-top: 0.75rem;
    margin-bottom: 0;
    border-color: rgba(99, 102, 241, 0.2);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.45));
}

.ticket-history-section {
    margin-top: 1.7rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 0.95rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.34), rgba(15, 23, 42, 0.2));
    overflow: visible;
}

.ticket-created-section {
    margin-top: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 12px;
    padding: 0.95rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.16));
    overflow: visible;
}

.ticket-section-title {
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(79,70,229,0.05));
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.ticket-actions {
    position: relative;
}

.ticket-actions-toggle.is-active {
    border-color: rgba(99, 102, 241, 0.65);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.ticket-actions-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 210px;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.28);
    background: #131b28;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    z-index: 25;
}

.ticket-actions-menu.is-open {
    display: flex;
    flex-direction: column;
}

.ticket-actions-item {
    border: 0;
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.79rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.58rem 0.72rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ticket-actions-item:hover {
    background: rgba(99, 102, 241, 0.16);
}

.ticket-actions-item--danger {
    color: #fda4af;
}

.ticket-actions-item--danger:hover {
    background: rgba(239, 68, 68, 0.18);
}

.ticket-actions-item:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ticket-history-toolbar-left,
.ticket-history-toolbar-right {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.ticket-history-selection,
.ticket-history-page {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.ticket-details-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(8, 11, 18, 0.68);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ticket-details-modal.is-open {
    display: flex;
}

.ticket-details-card {
    width: min(660px, 100%);
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: linear-gradient(170deg, #171d28, #10151f);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.ticket-details-head,
.ticket-details-foot {
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ticket-details-head {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.ticket-details-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.ticket-details-close {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.65);
    color: var(--text-primary);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ticket-details-body {
    padding: 0.9rem 1rem 1rem;
    display: grid;
    gap: 0.4rem;
}

.ticket-details-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.7rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.45);
}

.ticket-details-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.ticket-details-value {
    color: var(--text-primary);
    font-size: 0.83rem;
    font-weight: 600;
    word-break: break-word;
}

.ticket-actions-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.ticket-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(59, 130, 246, 0.08));
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ticket-action-btn:hover {
    border-color: rgba(99, 102, 241, 0.8);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(59, 130, 246, 0.15));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.ticket-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
}

.ticket-action-btn span {
    font-weight: 500;
}

.ticket-details-section {
    margin-bottom: 0.8rem;
}

.ticket-details-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.3);
}

.ticket-details-section-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ticket-details-section-header i {
    color: rgba(99, 102, 241, 0.7);
}

.ticket-details-section-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ticket-details-row-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

@media (max-width: 1100px) {
    .ticket-table-head {
        display: none;
    }

    .ticket-item > *:not(:first-child) {
        border-left: 0;
        padding-left: 0;
    }

    .ticket-item--open,
    .ticket-item--history,
    .ticket-item {
        grid-template-columns: auto auto 1fr auto;
        row-gap: 0.65rem;
    }

    .ticket-cell,
    .ticket-closed-by,
    .ticket-status {
        justify-self: start;
    }

    .ticket-actions {
        grid-column: 3 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .ticket-history-section {
        padding: 0.7rem;
    }

    .ticket-created-section {
        padding: 0.7rem;
    }

    .ticket-item--open,
    .ticket-item--history,
    .ticket-item {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding: 0.9rem 0.95rem;
    }

    .ticket-select,
    .ticket-type,
    .ticket-closed-by,
    .ticket-status,
    .ticket-actions {
        justify-self: start;
    }

    .ticket-actions {
        width: 100%;
    }

    .ticket-actions-menu {
        left: 0;
        right: auto;
        width: min(260px, 100%);
    }

    .ticket-btn {
        flex: 1;
        justify-content: center;
    }

    .ticket-history-toolbar {
        align-items: stretch;
    }

    .ticket-history-toolbar-left,
    .ticket-history-toolbar-right {
        width: 100%;
    }

    .ticket-details-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .ticket-actions-buttons {
        gap: 0.4rem;
    }

    .ticket-action-btn {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    .ticket-action-btn span {
        display: none;
    }
}

