/* ========================================================================= */
/* CREW PLANNING - Styles principaux                                        */
/* ========================================================================= */

:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --purple: #8b5cf6;
    --dark: #1f2937;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

/* ========================================================================= */
/* HEADER                                                                    */
/* ========================================================================= */

.header {
    background: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.logo i {
    color: var(--primary);
    font-size: 28px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    color: var(--primary);
}

/* ========================================================================= */
/* NAVIGATION SEMAINE                                                        */
/* ========================================================================= */

.week-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.week-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #374151;
    transition: all 0.2s;
}

.week-nav-btn:hover {
    background: var(--primary);
    color: white;
}

.week-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.week-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    min-width: 300px;
    text-align: center;
}

.week-dates {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

.today-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.today-btn:hover {
    background: var(--primary-dark);
}

.export-btn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    font-family: inherit;
}

.export-btn:hover {
    background: #dc2626;
}

.export-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================================================= */
/* STATS BAR                                                                 */
/* ========================================================================= */

.stats-bar {
    display: flex;
    gap: 24px;
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.stat-icon.total {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
}

.stat-icon.arrivals {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-icon.departures {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple);
}

.stat-icon.assigned {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-info .label {
    font-size: 12px;
    color: #6b7280;
}

.stat-info .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.stats-toggle-btn {
    display: none;
}

/* ========================================================================= */
/* PLANNING GRID                                                             */
/* ========================================================================= */

.planning-container {
    padding: 24px;
}

.day-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    overflow: visible;
}

.day-card .day-header {
    border-radius: 12px 12px 0 0;
}

.day-header {
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-header.today {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.day-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-send-day,
.btn-add-mission {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-send-day:hover,
.btn-add-mission:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-send-day i,
.btn-add-mission i {
    font-size: 11px;
}

.day-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.holiday-badge {
    font-size: 13px;
    font-weight: 600;
    color: #d97706;
    background: #ffffff;
    padding: 3px 12px;
    border-radius: 14px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    border: 1px solid #fde68a;
}

.holiday-badge i {
    font-size: 12px;
    margin-right: 4px;
    color: #f59e0b;
}

.day-date {
    font-size: 14px;
    opacity: 0.9;
}

.day-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.day-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e5e7eb;
}

.transfer-column {
    background: white;
    padding: 16px;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.column-header.arrivals {
    color: var(--info);
    border-color: var(--info);
}

.column-header.departures {
    color: var(--purple);
    border-color: var(--purple);
}

/* ========================================================================= */
/* MISSION ITEMS                                                             */
/* ========================================================================= */

.mission-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 8px;
    gap: 12px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.mission-item:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}

.mission-item.assigned {
    border-left: 4px solid var(--success);
}

.mission-item.pending {
    border-left: 4px solid var(--warning);
}

.mission-item.cancelled {
    border-left: 4px solid #9ca3af;
    background: #f9fafb;
    position: relative;
}

.mission-item.cancelled .mission-time,
.mission-item.cancelled .mission-info,
.mission-item.cancelled .mission-pickup {
    opacity: 0.6;
}

.mission-item.cancelled .mission-driver,
.mission-item.cancelled .mission-actions {
    opacity: 0.6;
    position: relative;
    z-index: 2;
}

.mission-item.cancelled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    z-index: 1;
    height: 2px;
    background: #ef4444;
    transform: translateY(-50%);
    pointer-events: none;
}

.mission-item.cancelled .mission-time,
.mission-item.cancelled .mission-flight,
.mission-item.cancelled .mission-pax {
    text-decoration: line-through;
    color: #9ca3af;
}

.mission-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}

.btn-flight-search {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
    background: transparent;
    color: #9ca3af;
    position: relative;
}

.btn-flight-search.has-data {
    color: #3b82f6;
}

.btn-flight-search:hover {
    background: #dbeafe;
    color: #3b82f6;
}

.btn-duplicate,
.btn-edit {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 11px;
    background: transparent;
    color: #9ca3af;
    flex-shrink: 0;
}

.btn-duplicate:hover {
    background: #ede9fe;
    color: #8b5cf6;
}

.btn-edit:hover {
    background: #e0e7ff;
    color: #1F398E;
}

.btn-cancel,
.btn-restore {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
}

.btn-cancel {
    background: transparent;
    color: #9ca3af;
}

.btn-cancel:hover {
    background: #fee2e2;
    color: #ef4444;
}

.btn-restore {
    background: #d1fae5;
    color: #10b981;
}

.btn-restore:hover {
    background: #a7f3d0;
}

.btn-delete-mission {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
    background: #fee2e2;
    color: #ef4444;
}

.btn-delete-mission:hover {
    background: #fca5a5;
    color: #dc2626;
}

.cancel-reason {
    position: absolute;
    bottom: 2px;
    left: 40px;
    right: 40px;
    font-size: 10px;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(254, 226, 226, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
}

.cancel-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.cancel-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.cancel-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.cancel-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #374151;
}

.cancel-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.cancel-modal-body {
    padding: 20px;
}

.cancel-modal-body p {
    margin: 0 0 15px;
    font-size: 14px;
    color: #6b7280;
}

.cancel-modal-body label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.cancel-modal-body textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.cancel-modal-body textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.cancel-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.mission-pickup {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #9ca3af;
    min-width: 60px;
    padding: 4px 8px;
    background: #f9fafb;
    border-radius: 6px;
}

.mission-pickup .editable-pickup {
    font-weight: 700;
    color: #374151;
    font-size: 12px;
}

.mission-pickup .editable-pickup .editable-value {
    cursor: pointer;
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
}

.mission-pickup .editable-pickup .editable-value:hover {
    background: #d1d5db;
}

.mission-pickup .editable-pickup input {
    width: 32px;
    text-align: center;
    font-size: 12px;
    padding: 2px;
    border: 1px solid var(--primary);
    border-radius: 4px;
}

.mission-pickup .pickup-calculated {
    display: none;
}

.mission-pickup.keyboard-field {
    display: none;
}

.mission-time {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    min-width: 50px;
}

.mission-flight {
    display: flex;
    flex-direction: column;
    min-width: 80px;
}

.flight-number {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.flight-delay-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.4;
    white-space: nowrap;
}

.flight-delay-tag.late {
    color: #dc2626;
}

.flight-delay-tag.early {
    color: #16a34a;
}

.flight-delay-tag.ontime {
    color: #9ca3af;
}

.flight-delay-tag.cancelled {
    color: #ffffff;
    background: #dc2626;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flight-origin {
    font-size: 11px;
    color: #6b7280;
}

.mission-pax {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    min-width: 45px;
    justify-content: center;
}

.mission-comment {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 60px;
    max-width: 200px;
    font-size: 11px;
    color: #6b7280;
    overflow: hidden;
    cursor: default;
}

.editable-value.editable-comment {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
    font-size: 11px;
    color: #374151;
    cursor: text;
}

.editable-input.editable-comment {
    width: 160px;
    font-size: 11px;
    padding: 2px 6px;
    color: #374151;
}

.mission-driver {
    margin-left: auto;
}

/* ========================================================================= */
/* DRIVER SELECTOR                                                           */
/* ========================================================================= */

.driver-selector {
    position: relative;
}

.driver-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 2px solid transparent;
    min-width: 60px;
    line-height: 1;
    box-sizing: border-box;
}

.driver-badge.empty {
    background: #fef3c7;
    color: #92400e;
    border-style: dashed;
    border-color: #f59e0b;
}

.driver-badge.empty:hover {
    background: #fde68a;
}

.driver-badge.assigned {
    color: white;
}

.driver-badge.assigned:hover {
    transform: scale(1.05);
}

.driver-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 200px;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

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

.driver-code-input-wrapper {
    padding: 8px 10px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.driver-code-input {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.driver-code-input::placeholder {
    text-transform: none;
    font-weight: 400;
    letter-spacing: 0;
    color: #9ca3af;
}

.driver-code-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.driver-dropdown-header {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
}

.driver-option {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.driver-option:hover {
    background: #f3f4f6;
}

.driver-option.selected {
    background: rgba(249, 115, 22, 0.1);
}

.driver-option-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.driver-option-name {
    flex: 1;
    font-size: 14px;
    color: var(--dark);
}

.driver-option-clear {
    color: var(--danger);
}

.driver-option-clear:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ========================================================================= */
/* UPLOAD ZONE                                                               */
/* ========================================================================= */

.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: white;
    transition: all 0.2s;
    cursor: pointer;
    margin: 24px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(249, 115, 22, 0.05);
}

.upload-zone i {
    font-size: 48px;
    color: #9ca3af;
    margin-bottom: 16px;
}

.upload-zone h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 8px;
}

.upload-zone p {
    font-size: 14px;
    color: #6b7280;
}

.upload-zone input {
    display: none;
}

/* ========================================================================= */
/* MODAL                                                                     */
/* ========================================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: scaleIn 0.2s ease;
    position: relative;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.modal-footer .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.modal-footer .btn-secondary {
    background: white;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.modal-footer .btn-secondary:hover {
    background: #f3f4f6;
    color: #374151;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark);
}

.modal-title i {
    color: var(--primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    margin-top: 0;
}

/* ========================================================================= */
/* FORMULAIRES                                                               */
/* ========================================================================= */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: var(--dark);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    background: white;
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input:hover {
    border-color: #d1d5db;
}

.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: var(--dark);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Input color picker */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

/* ========================================================================= */
/* BUTTONS                                                                   */
/* ========================================================================= */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* ========================================================================= */
/* TOAST                                                                     */
/* ========================================================================= */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--info);
}

.toast.warning {
    background: var(--warning);
}

/* ========================================================================= */
/* EMPTY STATE                                                               */
/* ========================================================================= */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #9ca3af;
}

/* ========================================================================= */
/* LOADING                                                                   */
/* ========================================================================= */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay p {
    margin-top: 16px;
    font-size: 16px;
    color: #6b7280;
}

/* Variante avec barre de progression (chargement planning) */
.loading-overlay--progress {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
}

.progress-card {
    width: min(420px, 90vw);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.progress-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.progress-card__title i {
    color: var(--primary);
    font-size: 18px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 10px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #fb923c);
    border-radius: 999px;
    transition: width 180ms ease-out;
    width: 0%;
}

.progress-bar--indeterminate .progress-bar__fill {
    width: 40% !important;
    animation: progress-indeterminate 1.4s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0%   { transform: translateX(-110%); }
    100% { transform: translateX(260%); }
}

.progress-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #6b7280;
}

.progress-card__count {
    font-variant-numeric: tabular-nums;
}

.progress-card__pct {
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

/* Mini loader fixé en bas - prend le relais de l'overlay au-delà
   de 50 requêtes traitées pour libérer l'interaction sur la page. */
.progress-toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 32px));
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 32px -10px rgba(15, 23, 42, 0.22);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 2500; /* en dessous des modales (3000) mais au-dessus du contenu */
    animation: progress-toast-in 220ms ease-out;
}

@keyframes progress-toast-in {
    from { transform: translate(-50%, 24px); opacity: 0; }
    to   { transform: translate(-50%, 0);    opacity: 1; }
}

.progress-toast__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff7ed;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 200ms ease, color 200ms ease;
}

.progress-toast__icon--flights {
    background: #eff6ff;
    color: #2563eb;
}

.progress-toast__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.progress-toast__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.progress-toast__title {
    font-weight: 600;
    color: #111827;
}

.progress-toast__count {
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.progress-toast__pct {
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.progress-bar--thin {
    height: 6px;
}

@media (max-width: 640px) {
    .progress-toast {
        bottom: 12px;
        padding: 10px 12px;
        gap: 10px;
    }
    .progress-toast__icon { width: 28px; height: 28px; font-size: 12px; }
    .progress-toast__top { font-size: 12px; }
    .progress-toast__pct { font-size: 13px; min-width: 36px; }
}

/* ========================================================================= */
/* SEARCH                                                                    */
/* ========================================================================= */

.search-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding-left: 24px;
}

.search-input {
    width: 280px;
    padding: 10px 16px 10px 40px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
    background: white;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-wrapper {
    position: relative;
}

.search-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    font-size: 12px;
    transition: color 0.2s;
}

.search-clear:hover {
    color: var(--danger);
}

.search-menu-container {
    position: relative;
}

.search-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.search-mode-btn:hover, .search-mode-btn.active {
    border-color: var(--primary);
    color: var(--primary);
}

.search-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.search-menu-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    min-width: 200px;
    padding: 6px 0;
}

.search-menu-section {
    padding: 2px 0;
}

.search-menu-label {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s;
}

.search-menu-item:hover {
    background: #f3f4f6;
}

.search-menu-item.selected {
    color: var(--primary);
    font-weight: 600;
}

.search-menu-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

.search-menu-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s;
}

.search-menu-checkbox:hover {
    background: #f3f4f6;
}

.search-menu-checkbox input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.search-results-count {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.search-results-count strong {
    color: var(--primary);
    font-weight: 700;
}

.filter-pending-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    user-select: none;
    border: 1.5px solid transparent;
}

.filter-pending-toggle:hover {
    background: #e5e7eb;
    color: #374151;
}

.filter-pending-toggle.active {
    background: #fef3c7;
    color: #92400e;
    border-color: #f59e0b;
}

.filter-pending-toggle.active i {
    color: #f59e0b;
}

/* ========================================================================= */
/* HIGHLIGHTED ROW                                                           */
/* ========================================================================= */

.mission-item.highlight {
    background: #fef3c7;
    border-color: #f59e0b;
}

/* Lignes non trouvées (grisées) lors de la recherche */
.mission-item.dimmed {
    opacity: 0.35;
    filter: grayscale(60%);
}

/* Lignes trouvées (mises en évidence) */
.mission-item.search-match {
    background: #fef3c7 !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.mission-item.search-match .mission-time,
.mission-item.search-match .flight-number {
    color: var(--primary-dark);
    font-weight: 700;
}

/* Jour card grisée si aucun résultat */
.day-card.dimmed .day-header {
    opacity: 0.5;
}

/* ========================================================================= */
/* ÉDITION INLINE                                                            */
/* ========================================================================= */

.editable-value {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
    border: 1px dashed transparent;
}

.editable-value:hover {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
}

.editable-input {
    padding: 2px 6px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    color: inherit;
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
    min-width: 50px;
}

.editable-input.editable-time {
    width: 60px;
    text-align: center;
}

.editable-input.editable-flight {
    width: 90px;
}

.editable-input.editable-pax {
    width: 45px;
    text-align: center;
}

/* ========================================================================= */
/* ICÔNE HISTORIQUE                                                          */
/* ========================================================================= */

.history-icon-container {
    position: absolute;
    top: -6px;
    right: -6px;
    z-index: 10;
}

.history-icon {
    width: 20px;
    height: 20px;
    background: var(--info);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.history-icon:hover {
    transform: scale(1.1);
    background: var(--primary);
}

.history-icon i {
    font-size: 10px;
    color: white;
}

/* Popup historique */
.history-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 280px;
    max-width: 350px;
    z-index: 100;
    overflow: hidden;
    animation: historySlideIn 0.2s ease;
}

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

.history-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 13px;
    color: var(--dark);
}

.history-popup-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.history-popup-close:hover {
    color: var(--danger);
}

.history-popup-content {
    max-height: 250px;
    overflow-y: auto;
}

.history-loading,
.history-empty {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.history-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}

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

.history-item:hover {
    background: #f9fafb;
}

.history-item-field {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.history-item-change {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 4px;
}

.history-old {
    color: var(--danger);
    text-decoration: line-through;
    opacity: 0.7;
}

.history-arrow {
    color: #9ca3af;
    font-size: 10px;
}

.history-new {
    color: var(--success);
    font-weight: 600;
}

.history-item-date {
    font-size: 11px;
    color: #9ca3af;
}

/* Position relative sur mission-item pour l'icône historique */
.mission-item {
    position: relative;
}

/* ========================================================================= */
/* EXPORT PDF MODAL                                                          */
/* ========================================================================= */

.export-modal {
    max-width: 480px;
}

.export-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.export-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid #fde68a;
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* ========================================================================= */
/* PROCEDURES & CONTACTS MODALS                                              */
/* ========================================================================= */

.modal-large {
    max-width: 800px;
    width: 90%;
}

.modal-large .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.form-row {
    display: flex;
    gap: 16px;
}

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

/* Procedures list */
.procedures-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.procedure-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

.procedure-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.procedure-code {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
}

.procedure-name {
    font-weight: 600;
    color: var(--dark);
    flex: 1;
}

.procedure-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: white;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
}

.btn-icon.danger:hover {
    background: var(--danger);
    color: white;
}

.procedure-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.procedure-detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #4b5563;
}

.procedure-detail i {
    color: var(--primary);
    width: 16px;
    text-align: center;
    margin-top: 2px;
}

.procedure-instructions {
    background: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    border-left: 3px solid var(--primary);
    margin-top: 8px;
}

/* Contacts list */
.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-card {
    background: #f9fafb;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #e5e7eb;
}

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

.contact-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 15px;
}

.contact-actions {
    display: flex;
    gap: 8px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #4b5563;
}

.contact-detail i {
    color: var(--primary);
    width: 16px;
    text-align: center;
    margin-top: 2px;
}

.contact-info-text span {
    line-height: 1.6;
}

/* ========================================================================= */
/* RESPONSIVE                                                                */
/* ========================================================================= */

@media (max-width: 768px) {

    /* ===== HEADER : barre app mobile ===== */
    .header {
        padding: 10px 16px;
        position: relative;
    }
    .header-left img[alt="Rey"],
    .header-left .logo {
        display: none !important;
    }
    .header-left {
        gap: 0;
    }
    .header-left .back-btn {
        margin-right: 0 !important;
        font-size: 16px;
    }
    .header::after {
        content: 'Planning';
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        font-size: 17px;
        font-weight: 700;
        color: var(--dark);
        pointer-events: none;
    }
    .header-actions {
        display: none !important;
    }

    /* ===== NAVIGATION ===== */
    .week-nav {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
        justify-content: center;
        align-items: center;
    }

    /* Mode switch : pleine largeur, ligne 1 */
    .nav-mode-switch {
        order: 1;
        width: 100%;
        justify-content: center;
        margin-right: 0 !important;
    }
    .nav-mode-btn {
        padding: 7px 12px;
        font-size: 13px;
    }

    /* Bouton Home (Aujourd'hui) : icône seule, à gauche */
    .week-nav > .today-btn:not(.datepicker-btn) {
        order: 2;
        font-size: 0;
        padding: 0;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        flex-shrink: 0;
    }
    .week-nav > .today-btn:not(.datepicker-btn) i {
        font-size: 15px;
        margin: 0 !important;
    }

    /* Flèche gauche */
    .week-nav > .week-nav-btn:first-of-type {
        order: 3;
    }
    .week-nav-btn {
        width: 32px;
        height: 36px;
        font-size: 13px;
        flex-shrink: 0;
    }

    /* Label central */
    .week-label {
        order: 4;
        min-width: unset;
        font-size: 14px;
        flex: 1;
        text-align: center;
    }

    /* Flèche droite */
    .week-nav > .week-nav-btn:nth-of-type(2) {
        order: 5;
    }

    /* Calendrier : icône seule, à droite */
    .datepicker-container {
        order: 6;
        flex-shrink: 0;
    }
    .datepicker-container .today-btn {
        font-size: 0;
        padding: 0;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
    }
    .datepicker-container .today-btn i {
        font-size: 15px;
        margin: 0 !important;
    }

    /* Export PDF : en haut à droite à côté de Envoyer PDF */
    .btn-export-pdf {
        position: fixed !important;
        top: 8px;
        right: 58px;
        z-index: 100;
        font-size: 0;
        padding: 0 !important;
        width: 36px;
        height: 36px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 50% !important;
        gap: 0;
    }
    .btn-export-pdf i {
        font-size: 15px;
        margin: 0 !important;
    }
    .btn-export-pdf span {
        display: none;
    }

    /* Envoyer PDF : déplacé en haut à droite dans le header */
    .btn-send-pdf {
        position: fixed !important;
        top: 8px;
        right: 16px;
        z-index: 100;
        font-size: 0;
        padding: 0 !important;
        width: 36px;
        height: 36px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 50% !important;
        gap: 0;
    }
    .btn-send-pdf i {
        font-size: 15px;
        margin: 0 !important;
    }
    .btn-send-pdf span {
        display: none;
    }

    /* Range picker */
    .range-picker-inline {
        order: 3;
        width: 100%;
        margin: 0;
        justify-content: center;
    }
    .range-date-input {
        flex: 1;
        min-width: 0;
    }

    /* ===== STATS BAR ===== */
    .stats-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 10px 12px;
    }
    .stat-item {
        display: none;
    }
    .stats-bar.stats-expanded .stat-item {
        display: flex;
    }
    .stats-toggle-btn {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 6px 14px;
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 500;
        color: #6b7280;
        cursor: pointer;
        transition: all 0.2s;
    }
    .stats-toggle-btn:hover {
        background: #e5e7eb;
        color: #374151;
    }
    .stats-bar.stats-expanded .stats-toggle-btn {
        color: var(--primary);
        border-color: var(--primary);
        background: #fff7ed;
    }
    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 13px;
        border-radius: 8px;
    }
    .stat-info .value {
        font-size: 16px;
    }
    .stat-info .label {
        font-size: 11px;
    }

    /* ===== PLANNING CONTENT ===== */
    .planning-container {
        padding: 10px;
    }
    .day-card {
        margin-bottom: 12px;
    }
    .day-content {
        grid-template-columns: 1fr;
    }
    .day-header {
        padding: 12px 14px;
    }
    .day-title {
        font-size: 15px;
    }
    .day-stats {
        font-size: 11px;
        gap: 10px;
    }
    .day-header-right {
        gap: 6px;
    }
    .btn-send-day,
    .btn-add-mission {
        font-size: 0;
        padding: 6px;
        gap: 0;
        width: 30px;
        height: 30px;
        justify-content: center;
    }
    .btn-send-day i,
    .btn-add-mission i {
        font-size: 12px;
    }
    .btn-send-day span,
    .btn-add-mission span {
        display: none;
    }
    .transfer-column {
        padding: 10px;
    }
    .column-header {
        font-size: 12px;
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    .mission-item {
        padding: 8px 10px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .mission-time {
        font-size: 14px;
        min-width: 42px;
    }
    .mission-flight {
        min-width: 65px;
    }
    .flight-number {
        font-size: 13px;
    }
    .mission-pax {
        padding: 3px 6px;
        font-size: 11px;
        min-width: 38px;
    }
    .mission-comment {
        max-width: 120px;
        font-size: 10px;
    }
    .driver-badge {
        padding: 4px 8px;
        font-size: 12px;
        min-width: 50px;
    }
    .mission-actions {
        gap: 2px;
    }

    /* ===== SEARCH ===== */
    .search-container {
        padding-left: 0;
        width: 100% !important;
        margin-left: 0;
        margin-top: 4px;
        flex-wrap: wrap;
        gap: 6px;
        box-sizing: border-box;
        grid-column: 1 / -1;
    }
    .search-wrapper {
        width: 100%;
        order: 1;
    }
    .search-input {
        width: 100%;
        font-size: 15px;
        padding: 10px 16px 10px 38px;
    }
    .search-menu-container {
        order: 2;
        flex-shrink: 0;
    }
    .filter-pending-toggle {
        order: 3;
        margin-left: auto;
    }
    .filter-pending-toggle span {
        display: none;
    }

    /* ===== MODALS ===== */
    .modal {
        width: 95%;
        max-height: 90vh;
    }
    .modal-large {
        width: 95%;
    }
    .modal-body {
        padding: 16px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    /* ===== TOAST ===== */
    .toast-container {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }
    .toast {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* ========================================================================= */
/* NAVIGATION CLAVIER                                                        */
/* ========================================================================= */

/* Mission sélectionnée */
.mission-item.keyboard-focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    background: #fff7ed;
}

/* Champs focusables */
.mission-item .keyboard-field {
    position: relative;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.mission-item .keyboard-field.field-focus {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 2px var(--primary);
}

.mission-item .keyboard-field.field-focus .editable-value {
    color: white;
}

.mission-item .keyboard-field.field-focus i {
    color: white;
}

/* Driver badge focus */
.driver-badge.field-focus {
    box-shadow: 0 0 0 3px var(--primary), 0 0 0 5px rgba(249, 115, 22, 0.3) !important;
    transform: scale(1.1);
}

/* Dropdown avec navigation clavier */
.driver-dropdown.keyboard-nav {
    border: 2px solid var(--primary);
}

.driver-option.keyboard-selected {
    background: var(--primary) !important;
    color: white !important;
}

.driver-option.keyboard-selected .driver-option-name {
    color: white !important;
}

.driver-option.keyboard-selected .driver-option-color {
    box-shadow: 0 0 0 2px white;
}

/* Indicateur mode clavier */
.keyboard-mode-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--dark);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
}

.keyboard-mode-indicator kbd {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation du focus */
@keyframes pulseFocus {
    0%, 100% {
        box-shadow: 0 0 0 2px var(--primary);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.4);
    }
}

.keyboard-field.field-focus {
    animation: pulseFocus 1.5s ease-in-out infinite;
}

/* ========================================================================= */
/* DATE PICKER                                                               */
/* ========================================================================= */

.datepicker-container {
    position: relative;
}

.datepicker-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 16px;
    z-index: 1000;
    min-width: 280px;
    animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

.datepicker-nav {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: all 0.2s;
}

.datepicker-nav:hover {
    background: var(--primary);
    color: white;
}

.datepicker-month {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.datepicker-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    padding: 4px;
}

.datepicker-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.datepicker-day {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: all 0.15s;
}

.datepicker-day:hover:not(.empty) {
    background: #fff7ed;
    color: var(--primary);
}

.datepicker-day.empty {
    cursor: default;
}

.datepicker-day.today {
    background: #fee2e2;
    color: #dc2626;
    font-weight: 600;
}

.datepicker-day.selected {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

/* Calendrier multi-sélection (modal de duplication) */
.multi-date-picker {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
}

.multi-date-picker .datepicker-day {
    width: 100%;
    aspect-ratio: 1;
    height: auto;
    border: 1px solid transparent;
}

.multi-date-picker .datepicker-day:hover:not(.empty) {
    background: #ede9fe;
    color: #6d28d9;
    border-color: #c4b5fd;
}

.multi-date-picker .datepicker-day.selected {
    background: #8b5cf6;
    color: white;
    border-color: #7c3aed;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

.multi-date-picker .datepicker-day.today {
    background: #fee2e2;
    color: #dc2626;
}

.multi-date-picker .datepicker-day.today.selected {
    background: #8b5cf6;
    color: white;
}

/* ========================================================================= */
/* NAVIGATION MODE SWITCH                                                    */
/* ========================================================================= */

.nav-mode-switch {
    display: flex;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 3px;
    margin-right: 15px;
}

.nav-mode-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-mode-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-mode-btn:hover:not(.active) {
    color: #374151;
}

/* ========================================================================= */
/* RANGE PICKER INLINE                                                       */
/* ========================================================================= */

.range-picker-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 10px;
}

.range-picker-inline label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
}

.range-date-input {
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    color: #374151;
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

.range-date-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* ========================================================================= */
/* TOGGLE SWITCH                                                             */
/* ========================================================================= */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* ========================================================================= */
/* ALERTS BUTTON                                                             */
/* ========================================================================= */

.alerts-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.alerts-btn:hover {
    background: #fde68a !important;
}

/* ========================================================================= */
/* ALERTS MODAL                                                              */
/* ========================================================================= */

.alerts-modal .alert-section {
    background: white;
}

.alerts-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* ========================================================================= */
/* FLIGHT SEARCH SIDEBAR                                                     */
/* ========================================================================= */

.flight-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    cursor: pointer;
}

.flight-search-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: #f8fafc;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
    cursor: default;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.flight-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.flight-sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.flight-sidebar-title i {
    font-size: 18px;
}

.flight-sidebar-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.flight-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.flight-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.flight-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: #6b7280;
}

.flight-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 10px;
    color: #ef4444;
    text-align: center;
}

.flight-error i {
    font-size: 32px;
}

.flight-no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    text-align: center;
}

.flight-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.flight-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flight-section-title i {
    font-size: 14px;
}

.flight-status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flight-status-badge[data-status="landed"] {
    background: #dcfce7;
    color: #166534;
}

.flight-status-badge[data-status="en-route"],
.flight-status-badge[data-status="active"] {
    background: #dbeafe;
    color: #1e40af;
}

.flight-status-badge[data-status="scheduled"] {
    background: #f3f4f6;
    color: #4b5563;
}

.flight-status-badge[data-status="cancelled"] {
    background: #fef2f2;
    color: #dc2626;
}

.flight-status-badge[data-status="diverted"] {
    background: #fef3c7;
    color: #d97706;
}

.flight-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 14px;
    border-bottom: 1px solid #f3f4f6;
}

.flight-airport {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.airport-code {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 1px;
}

.airport-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flight-route-line {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 16px;
}

.flight-route-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, #e5e7eb 0%, #6366f1 50%, #e5e7eb 100%);
}

.flight-route-line i {
    color: #6366f1;
    font-size: 16px;
    background: #f8fafc;
    padding: 0 8px;
    z-index: 1;
    position: relative;
}

.flight-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.flight-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
}

.detail-label {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.detail-value.highlight {
    color: #6366f1;
}

.detail-value.success {
    color: #16a34a;
}

.detail-value.warning {
    color: #d97706;
}

.flight-last-update {
    margin-top: 12px;
    font-size: 11px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.flight-airline-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.flight-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.flight-delay-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.flight-delay-badge.late {
    background: #fef2f2;
    color: #dc2626;
}

.flight-delay-badge.early {
    background: #dcfce7;
    color: #16a34a;
}

.flight-progress-bar {
    position: relative;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin-bottom: 14px;
    overflow: hidden;
}

.flight-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transition: width 0.5s ease;
}

.flight-progress-text {
    position: absolute;
    right: 0;
    top: -16px;
    font-size: 10px;
    font-weight: 600;
    color: #6366f1;
}

.airport-city {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
}

.flight-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
    gap: 8px;
}

.countdown-icon {
    margin-bottom: 6px;
}

.countdown-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.countdown-timer {
    font-size: 28px;
    font-weight: 700;
    color: #f59e0b;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    padding: 8px 0;
}

.countdown-sub {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    max-width: 280px;
    line-height: 1.4;
}

.countdown-mission {
    font-size: 12px;
    color: #6b7280;
    margin: 8px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.countdown-mission i {
    color: #6366f1;
    font-size: 11px;
}

.flight-expired {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
    gap: 8px;
}

.expired-icon {
    margin-bottom: 6px;
}

.expired-title {
    font-size: 15px;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
}

.expired-sub {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    max-width: 280px;
    line-height: 1.4;
}

.flight-source-tag {
    margin-top: 10px;
    text-align: right;
    font-size: 10px;
    color: #c4c8cd;
    font-style: italic;
    letter-spacing: 0.3px;
}

.source-cache-badge {
    font-weight: 600;
    font-style: normal;
}

.source-cache-badge.cached {
    color: #9ca3af;
}

.source-cache-badge.live {
    color: #16a34a;
}

.flight-section-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin: 14px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.flight-section-subtitle i {
    font-size: 12px;
    color: #6366f1;
}

.flight-aircraft-info {
    border-top: 1px solid #f3f4f6;
    margin-top: 12px;
    padding-top: 4px;
}

@media (max-width: 768px) {
    .flight-search-sidebar {
        width: 100%;
    }
}

/* ============================================= */
/* OPTIONS MODAL                                 */
/* ============================================= */

.options-modal {
    max-width: 460px;
    width: 90%;
}

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

.options-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.options-toggle-group {
    display: flex;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.options-toggle-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: #f9fafb;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-toggle-btn:not(:last-child) {
    border-right: 1px solid #e5e7eb;
}

.options-toggle-btn:hover {
    background: #f3f4f6;
}

.options-toggle-btn.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}
