* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    min-height: 100vh;
    color: #e0e0e0;
}

.banner {
    background: #23324a;
    border: 1px solid #2e4366;
    color: #cfe3ff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 300;
}

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

.stat-item {
    background: #2d2d2d;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #404040;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    border-color: #555;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #4a9eff;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Tickets Grid */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.ticket-card {
    background: #2d2d2d;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #404040;
    transition: all 0.3s ease;
    border-left: 4px solid #666;
}

.ticket-card:hover {
    transform: translateY(-2px);
    border-color: #555;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ticket-card.valid {
    border-left-color: #28a745;
}

.ticket-card.invalid {
    border-left-color: #dc3545;
}

.ticket-card.pending {
    border-left-color: #ffc107;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #404040;
}

.ticket-header h3 {
    color: #ffffff;
    font-size: 1.2rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-valid {
    background: #1e4d3a;
    color: #4ade80;
    border: 1px solid #16a34a;
}

.status-invalid {
    background: #4d1e1e;
    color: #f87171;
    border: 1px solid #dc2626;
}

.status-pending {
    background: #4d3d1e;
    color: #fbbf24;
    border: 1px solid #f59e0b;
}

.ticket-info p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #ccc;
}

.description {
    color: #999;
    font-style: italic;
    margin-top: 10px !important;
}

.validation-info {
    background: #1e1e1e;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    border: 1px solid #333;
}

.validation-info p {
    margin: 5px 0;
    color: #e0e0e0;
}

.ticket-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-primary {
    background: #4a9eff;
    color: white;
}

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

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

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #2d2d2d;
    margin: 2% auto;
    padding: 0;
    border-radius: 8px;
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    overflow-y: auto;
    border: 1px solid #404040;
    animation: modalSlideIn 0.3s ease;
}

.modal-large {
    max-width: 1400px;
    width: 98%;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: #1a1a1a;
    color: #ffffff;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #404040;
}

.modal-header h2 {
    margin: 0;
    font-weight: 300;
}

.close {
    color: #ccc;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.modal-body {
    padding: 20px;
    color: #e0e0e0;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #e0e0e0;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    border: 1px solid #404040;
    border-radius: 4px;
    transition: all 0.3s ease;
    background: #1e1e1e;
}

.radio-label:hover {
    border-color: #4a9eff;
    background: #252525;
}

.radio-label input[type="radio"] {
    margin-right: 10px;
}

.radio-label input[type="radio"]:checked + span {
    color: #4a9eff;
    font-weight: 500;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    border: 1px solid #404040;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: normal;
    background: #1e1e1e;
}

.checkbox-label:hover {
    border-color: #4a9eff;
    background: #252525;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
}

select, input[type="text"], textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #404040;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    background: #1e1e1e;
    color: #e0e0e0;
}

select:focus, input[type="text"]:focus, textarea:focus {
    outline: none;
    border-color: #4a9eff;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #404040;
}

/* KM Section */
.km-section {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #404040;
}

#kmOptions {
    margin-top: 15px;
    padding-left: 20px;
}

#kmOptions input, #kmOptions textarea {
    margin-bottom: 10px;
}

/* Ticket Details */
.ticket-detail {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #404040;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    color: #4a9eff;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #404040;
    font-weight: 500;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.detail-item {
    padding: 8px 0;
}

.detail-label {
    font-weight: 500;
    color: #999;
    margin-bottom: 4px;
}

.detail-value {
    color: #e0e0e0;
    word-wrap: break-word;
    white-space: normal;
    max-height: none;
    overflow: visible;
    line-height: 1.5;
}

.detail-value p {
    margin: 8px 0;
}

.detail-value br {
    display: block;
    margin: 4px 0;
}

/* Styles spécifiques pour les suggestions KM simplifiées */
.km-suggestions {
    margin-top: 15px;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #333;
}

.km-suggestion-item-simple {
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.km-suggestion-item-simple:hover {
    border-color: #4a9eff;
    background: #333;
}

.km-suggestion-title-simple {
    color: #e0e0e0;
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 6px;
    line-height: 1.3;
}

.km-suggestion-meta-simple {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.btn-suggestion {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-apply-km {
    background: #4a9eff;
    color: white;
}

.btn-apply-km:hover {
    background: #3b8ae6;
    transform: translateY(-1px);
}

.loading-suggestions {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.no-suggestions {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 15px;
}

.km-applied-notice {
    background: #1e4d3a;
    color: #4ade80;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #16a34a;
    margin-top: 10px;
    font-size: 0.9rem;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
}

.comment-item {
    background: #2d2d2d;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    border-left: 3px solid #4a9eff;
}

.comment-header {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 8px;
}

.comment-body {
    font-size: 0.9rem;
    color: #e0e0e0;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .tickets-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
}
