.main-container {
    height: calc(100vh - 56px);
    overflow: hidden;
}
.panel-left {
    height: 100%;
    overflow-y: auto;
    background: white;
    border-right: 1px solid #dee2e6;
    padding: 1.25rem;
}
.panel-left::-webkit-scrollbar { width: 6px; }
.panel-left::-webkit-scrollbar-thumb { background: #bdc3c7; border-radius: 3px; }

#map { height: 100%; width: 100%; }

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7f8c8d;
    margin-bottom: 0.75rem;
}

/* --- Champs adresse --- */
.address-input-group {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.address-input-group:focus-within {
    border-color: #a0c4e8;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}
.address-input-group.start { border-left: 4px solid #27ae60; }
.address-input-group.end { border-left: 4px solid #e74c3c; }
.address-input-group.stop { border-left: 4px solid #3498db; }
.address-input-group.resolved { background: #eafaf1; }
.address-input-group.start.resolved { background: #eafaf1; }
.address-input-group.end.resolved { background: #fdedec; }
.address-input-group.stop.resolved { background: #ebf5fb; }

.address-input-group input {
    border: none;
    background: transparent;
    font-size: 0.88rem;
    padding: 0.2rem 0;
    width: 100%;
}
.address-input-group input:focus { outline: none; }

.label-sm {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.address-input-group.start .label-sm { color: #27ae60; }
.address-input-group.end .label-sm { color: #e74c3c; }
.address-input-group.stop .label-sm { color: #3498db; }

.label-sm .resolved-icon { display: none; }
.address-input-group.resolved .label-sm .resolved-icon { display: inline; }

.btn-remove-stop {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.15rem 0.3rem;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.15s;
}
.btn-remove-stop:hover { color: #e74c3c; background: rgba(231,76,60,0.08); }

.btn-add-stop {
    width: 100%;
    border: 2px dashed #bdc3c7;
    background: transparent;
    color: #7f8c8d;
    border-radius: 10px;
    padding: 0.55rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1rem;
}
.btn-add-stop:hover {
    border-color: #3498db;
    color: #3498db;
    background: rgba(52,152,219,0.05);
}

/* --- Autocomplete --- */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: white;
    border: 1px solid #d5dce4;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: none;
}
.autocomplete-item {
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    font-size: 0.84rem;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    transition: background 0.1s;
}
.autocomplete-item:hover, .autocomplete-item.active { background: #eef5fc; }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item .ac-icon {
    color: #95a5a6;
    margin-top: 2px;
    flex-shrink: 0;
}
.autocomplete-item .ac-text { flex: 1; }
.autocomplete-item .ac-main { color: #2c3e50; font-weight: 500; }
.autocomplete-item .ac-sub { color: #95a5a6; font-size: 0.78rem; }

/* --- Boutons --- */
.btn-optimize {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    color: white;
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-optimize:hover {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52,152,219,0.4);
}
.btn-optimize:disabled {
    background: #bdc3c7;
    transform: none;
    box-shadow: none;
    cursor: wait;
}
.btn-optimize .spinner-border { display: none; width: 1rem; height: 1rem; border-width: 2px; }
.btn-optimize.loading .spinner-border { display: inline-block; }
.btn-optimize.loading .btn-text-ready { display: none; }

.btn-reset {
    width: 100%;
    border: 1px solid #dee2e6;
    background: white;
    color: #7f8c8d;
    border-radius: 10px;
    padding: 0.5rem;
    font-size: 0.82rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s;
}
.btn-reset:hover { border-color: #e74c3c; color: #e74c3c; }

/* --- Resultats --- */
.results-section {
    display: none;
    margin-top: 1rem;
}
.results-section.visible { display: block; }

.summary-box {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.summary-box .stat { text-align: center; }
.summary-box .stat-value { font-size: 1.3rem; font-weight: 700; }
.summary-box .stat-label { font-size: 0.7rem; opacity: 0.7; text-transform: uppercase; }

.day-separator {
    background: #2c3e50;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    margin-top: 0.75rem;
}
.day-separator:first-child { margin-top: 0; }

.rdv-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.35rem;
    border-left: 3px solid #3498db;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.rdv-card:hover {
    background: #eef5fc;
    transform: translateX(3px);
}
.rdv-card .rdv-time { font-weight: 700; color: #2c3e50; font-size: 0.88rem; }
.rdv-card .rdv-address { color: #555; font-size: 0.8rem; margin-top: 1px; }
.rdv-card .rdv-info { font-size: 0.73rem; color: #7f8c8d; margin-top: 2px; }
.rdv-card.lunch {
    border-left-color: #e67e22;
    background: #fef9e7;
    cursor: default;
}
.rdv-card.lunch:hover { transform: none; background: #fef9e7; }

/* --- Spinner overlay --- */
.spinner-overlay {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.85);
    z-index: 500;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.spinner-overlay.active { display: flex; }

/* --- Preview markers on map --- */
.preview-marker {
    background: none;
    border: none;
}

/* --- Champs heure --- */
.time-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}
.time-row label {
    font-size: 0.75rem;
    color: #7f8c8d;
    white-space: nowrap;
    margin: 0;
}
.time-input {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.25rem 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    width: 90px;
    text-align: center;
    background: white;
    color: #2c3e50;
}
.time-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}

/* --- Bouton copier adresse --- */
.btn-same-address {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: 1px dashed #bdc3c7;
    border-radius: 6px;
    color: #7f8c8d;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.35rem;
}
.btn-same-address:hover {
    border-color: #3498db;
    color: #3498db;
    background: rgba(52,152,219,0.05);
}
.btn-same-address.copied {
    border-color: #27ae60;
    color: #27ae60;
    border-style: solid;
}

/* --- Bouton parametres --- */
.btn-settings {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    color: #7f8c8d;
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-settings:hover { border-color: #3498db; color: #3498db; }
.btn-settings i { font-size: 0.9rem; }

/* --- Offcanvas parametres --- */
.offcanvas-settings { max-width: 360px; }
.offcanvas-settings .offcanvas-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 1rem 1.25rem;
}
.offcanvas-settings .offcanvas-header .btn-close { filter: invert(1); }
.param-group {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}
.param-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #7f8c8d;
    margin-bottom: 0.6rem;
}
.param-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0;
}
.param-row + .param-row { border-top: 1px solid #eee; }
.param-label {
    font-size: 0.84rem;
    color: #2c3e50;
    flex: 1;
}
.param-input {
    width: 80px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.25rem 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    color: #2c3e50;
}
.param-input:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 2px rgba(52,152,219,0.15); }
.param-unit {
    font-size: 0.75rem;
    color: #95a5a6;
    width: 35px;
    text-align: left;
    margin-left: 0.4rem;
}
.param-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-save-params {
    background: linear-gradient(135deg, #27ae60, #229954);
    border: none;
    color: white;
    width: 100%;
    padding: 0.65rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-top: 0.5rem;
}
.btn-save-params:hover { background: linear-gradient(135deg, #229954, #1e8449); color: white; transform: translateY(-1px); }
.btn-reset-params {
    background: none;
    border: 1px solid #dee2e6;
    color: #7f8c8d;
    width: 100%;
    padding: 0.45rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 0.4rem;
    transition: all 0.2s;
}
.btn-reset-params:hover { border-color: #e74c3c; color: #e74c3c; }

/* --- Avensys dossier cards --- */
.avensys-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.8rem;
}
.avensys-card:hover { border-color: #3498db; background: rgba(52,152,219,0.03); }
.avensys-card.selected { border-color: #27ae60; background: rgba(39,174,96,0.06); }
.avensys-card .card-ref { font-weight: 700; color: #2c3e50; font-size: 0.78rem; }
.avensys-card .card-name { color: #555; font-size: 0.76rem; }
.avensys-card .card-addr { color: #7f8c8d; font-size: 0.72rem; margin-top: 2px; }
.avensys-card .card-badge {
    display: inline-block;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 10px;
    background: #eee;
    color: #555;
    margin-top: 3px;
}

/* --- Hotel suggestions --- */
.hotel-suggestions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d1c4e9;
}
.hotel-suggestions-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #7b1fa2;
    margin-bottom: 6px;
}
.hotel-suggestion-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    background: white;
    border: 1px solid #e1bee7;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
    cursor: pointer;
}
.hotel-suggestion-card:hover {
    border-color: #9b59b6;
    background: rgba(155,89,182,0.05);
    transform: translateX(2px);
}
.hotel-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hotel-details {
    flex: 1;
    min-width: 0;
}
.hotel-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hotel-meta {
    font-size: 0.68rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}
.hotel-rating {
    font-weight: 700;
    color: #f39c12;
}
.hotel-avis {
    color: #999;
}
.hotel-price {
    background: #e8f5e9;
    color: #27ae60;
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.65rem;
}
.hotel-addr {
    font-size: 0.66rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hotel-link-icon {
    color: #bbb;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.hotel-suggestion-card:hover .hotel-link-icon {
    color: #9b59b6;
}

/* --- Alerte proximité expert --- */
.proximity-alert {
    background: #fdecea;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    padding: 4px 8px;
    margin-top: 5px;
    font-size: 0.68rem;
    color: #c0392b;
    line-height: 1.3;
}
.proximity-alert i {
    color: #e74c3c;
    font-size: 0.72rem;
}
.proximity-alert strong {
    color: #c0392b;
}

/* --- Tri dossiers --- */
.sort-bar {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}
.sort-bar .btn-sort {
    flex: 1;
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    color: #7f8c8d;
    transition: all 0.15s;
    text-align: center;
}
.sort-bar .btn-sort:hover { border-color: #3498db; color: #3498db; }
.sort-bar .btn-sort.active { background: #3498db; color: white; border-color: #3498db; }

/* Calendar mini */
.cal-day-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2c3e50;
    padding: 0.4rem 0.5rem 0.2rem;
    border-bottom: 2px solid #3498db;
    margin-top: 0.5rem;
}
.cal-day-header:first-child { margin-top: 0; }
.cal-day-header .day-name { text-transform: capitalize; }
.cal-day-header .day-count {
    font-size: 0.65rem;
    font-weight: 400;
    color: #95a5a6;
}
.cal-event {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    border-left: 3px solid #3498db;
    margin: 0.2rem 0;
    background: rgba(52,152,219,0.04);
    border-radius: 0 4px 4px 0;
}
.cal-event.confirmed { border-left-color: #27ae60; background: rgba(39,174,96,0.04); }
.cal-event.all-day { border-left-color: #9b59b6; background: rgba(155,89,182,0.06); }
.cal-event-time {
    font-weight: 700;
    white-space: nowrap;
    min-width: 42px;
    color: #2c3e50;
}
.cal-event-info {
    flex: 1;
    color: #555;
    line-height: 1.3;
}
.cal-event-title { font-weight: 600; color: #2c3e50; }
.cal-empty-day {
    font-size: 0.75rem;
    color: #bdc3c7;
    padding: 0.3rem 0.5rem;
    font-style: italic;
}
