/* Attachments */
.step-attachments {
    margin-top: 6px;
    border-top: 1px solid var(--white-05);
    padding: 4px 0;
    font-size: 0.7rem;
    margin-left: 0.8em;
}
.attachments-header {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 2px 0;
    color: var(--text-dim);
    transition: color 0.2s;
    user-select: none;
}
.attachments-header:hover {
    color: var(--primary);
}
.attachments-header i.fa-paperclip {
    font-size: 0.75rem;
}
.attachments-count {
    flex: 1;
    font-size: 0.7rem;
}
.attachments-toggle {
    font-size: 0.6rem;
    transition: transform 0.2s;
}
.step-attachments.attachments-expanded .attachments-toggle {
    transform: rotate(180deg);
}
.attachments-list {
    display: none;
    padding: 4px 0 2px 18px;
}
.step-attachments.attachments-expanded .attachments-list {
    display: block;
}
.attachment-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    border-radius: 6px;
    transition: background 0.2s;
}
.attachment-item:hover {
    background: var(--white-05);
}
.attachment-icon {
    width: 14px;
    text-align: center;
    color: var(--primary);
    flex-shrink: 0;
    font-size: 0.75rem;
}
.attachment-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    text-decoration: none;
    font-size: 0.7rem;
    cursor: pointer;
}
.attachment-name:hover {
    color: var(--primary);
    text-decoration: underline;
}
.attachment-download {
    color: var(--text-dim);
    font-size: 0.65rem;
    text-decoration: none;
    flex-shrink: 0;
    padding: 2px;
    opacity: 0.4;
    transition: opacity 0.2s;
}
.attachment-download:hover {
    opacity: 1;
    color: var(--primary);
}
.attachment-size {
    color: var(--text-dim);
    font-size: 0.6rem;
    flex-shrink: 0;
}
.attachment-delete {
    cursor: pointer;
    opacity: 0.3;
    color: var(--danger);
    font-size: 0.65rem;
    transition: opacity 0.2s;
    flex-shrink: 0;
    padding: 2px;
}
.attachment-delete:hover {
    opacity: 1;
}
.attachments-add-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    cursor: pointer;
    padding: 2px 0;
    font-size: 0.7rem;
    transition: color 0.2s;
}
.attachments-add-btn:hover {
    color: var(--primary);
}
.attachments-add-btn svg.lucide {
    width: 12px;
    height: 12px;
}
.attachments-add-text {
    font-size: 0.7rem;
}
.attachments-add-btn.is-inline {
    padding: 3px 4px;
    margin-top: 2px;
}

/* Pièces jointes au niveau du voyage (agenda_renderer) */
.day-title.attachments-title {
    background: var(--primary-10);
    border-color: var(--bg-1);
}
.attachments-title-icon { color: var(--primary); }
.attachments-trip-list { padding: 8px 0; }
.attachments-trip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 12px;
    margin: 0 0 4px 1.5em;
    background: var(--white-02);
    border-radius: 8px;
}
.attachments-trip-icon { color: var(--primary); width: 14px; text-align: center; font-size: 0.75rem; }
.attachments-trip-name { flex: 1; color: var(--text); cursor: pointer; font-size: 0.8rem; }
.attachments-trip-size { color: var(--text-dim); font-size: 0.65rem; }
.attachments-trip-download { color: var(--text-dim); font-size: 0.65rem; text-decoration: none; opacity: 0.4; }
.attachments-trip-delete { font-size: 0.7rem; }
.attachments-trip-add { padding: 3px 12px; margin: 0 0 4px 1.5em; }
.attachments-trip-add .attachments-add-btn { font-size: 0.75rem; }

/* Drag & drop attachments */
.step-attachments.is-drag-over {
    border: 2px dashed var(--primary);
    background: var(--primary-10);
    border-radius: 8px;
    padding: 4px 6px;
}
.attachments-manager.is-drag-over-mgr {
    border: 3px dashed var(--primary);
    background: rgba(142, 68, 173, 0.08);
    border-radius: 12px;
    margin: -3px;
}
.attachments-drop-zone {
    border: 2px dashed var(--white-20);
    border-radius: 12px;
    padding: 25px 15px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: rgba(0,0,0,0.15);
}
.attachments-drop-zone.is-drag-over {
    border-color: var(--primary);
    background: var(--primary-15);
}
.attachments-drop-zone i {
    font-size: 2rem;
    color: var(--primary);
    display: block;
    margin-bottom: 10px;
}
.attachments-drop-zone span {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Attachment Manager View */
.attachments-manager {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
}
.attachments-mgr-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}
.att-mgr-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--white-03);
    border: 1px solid var(--white-05);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s;
}
.att-mgr-item:hover {
    background: var(--white-06);
    border-color: var(--primary);
}
.att-mgr-icon {
    font-size: 1.3rem;
    color: var(--primary);
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}
.att-mgr-info {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 220px;
}
.att-mgr-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.att-mgr-name:hover { color: var(--primary); }
.att-mgr-size {
    font-size: 0.65rem;
    color: var(--text-dim);
}
.att-mgr-steps {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}
.att-mgr-step-tag {
    background: var(--primary-15);
    color: var(--text);
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.att-mgr-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}
.att-mgr-edit, .att-mgr-dl, .att-mgr-del {
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
    padding: 4px;
    font-size: 0.85rem;
    color: var(--text-dim);
    text-decoration: none;
}
.att-mgr-edit:hover { opacity: 1; color: var(--primary); }
.att-mgr-dl:hover { opacity: 1; color: var(--success); }
.att-mgr-del:hover { opacity: 1; color: var(--danger); }

.att-mgr-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.85rem;
}
.att-mgr-check-row:hover {
    background: var(--white-05);
}
.att-mgr-check-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Attachment Step Editor */
.att-editor-search-wrap {
    position: relative;
    margin-bottom: 10px;
}
.att-editor-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 0.85rem;
}
.att-editor-search {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border-radius: 8px;
    border: 1px solid var(--white-10);
    background: var(--black-20);
    color: var(--text);
    font-size: 0.85rem;
    box-sizing: border-box;
    outline: none;
}
.att-editor-search:focus {
    border-color: var(--primary);
}
.swal-attachment-editor {
    height: 80vh !important;
}
.swal-attachment-editor .swal2-html-container {
    height: calc(80vh - 150px) !important;
    overflow-y: auto !important;
}
.att-editor-group {
    margin-bottom: 6px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--white-06);
}
.att-editor-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--white-04);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.att-editor-group-header:hover {
    background: var(--white-08);
}
.att-editor-toggle {
    width: 16px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
}
.att-editor-group-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.8rem;
}
.att-editor-group-count {
    font-size: 0.7rem;
    color: var(--text-dim);
    background: var(--white-06);
    padding: 2px 8px;
    border-radius: 10px;
}
.att-editor-toggle-all {
    font-size: 0.7rem;
    color: var(--primary);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.att-editor-toggle-all:hover {
    opacity: 1;
    background: var(--primary-15);
}
.att-editor-group-body {
    overflow: hidden;
    transition: max-height 0.25s ease;
    max-height: 2000px;
}
.att-editor-group-body.collapsed {
    max-height: 0;
}
.att-editor-group-body .att-mgr-check-row {
    padding: 6px 12px 6px 28px;
    font-size: 0.8rem;
}
.att-editor-group-body .att-mgr-check-row:hover {
    background: var(--white-04);
}
.att-editor-group.is-backlog {
    opacity: 0.8;
}
.att-editor-group.is-backlog .att-editor-group-title {
    font-style: italic;
}

/* Attachment highlight */
.att-mgr-highlighted {
    background: var(--primary-20) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary-30);
    transition: all 0.3s;
}

/* Map attachment chip */
.map-chip.att {
    cursor: pointer;
    font-size: 0.7rem;
    background: rgba(155,89,182,0.15);
    color: #bb8fce;
    border: 1px solid rgba(155,89,182,0.3);
}

/* Budget per-person toggle — même géométrie que .swal-custom-input */
.budget-toggle {
    white-space: nowrap;
    width: auto;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid var(--white-10);
    background: var(--black-30);
    color: #fff;
    font-size: 0.85rem;
    line-height: normal;
    box-sizing: border-box;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.budget-toggle i,
.budget-toggle svg.lucide {
    font-size: 0.95rem;
    width: 0.95rem;
    height: 0.95rem;
}
.budget-toggle:hover {
    border-color: var(--primary);
    background: rgba(0,0,0,0.45);
}
.budget-toggle.is-active {
    background: linear-gradient(135deg, var(--success), #2ecc71);
    border-color: var(--success);
    color: #fff;
}
.budget-toggle:active {
    transform: scale(0.97);
}

/* Overlays */
.overlay-btn { cursor: pointer; transition: all 0.2s; }
.overlay-btn:hover { transform: scale(1.15); }
.header-action-btn {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--white-10); border: 1px solid rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.95rem; cursor: pointer;
    transition: all 0.2s; flex-shrink: 0;
}
.header-action-btn:hover { background: var(--white-20); border-color: rgba(255,255,255,0.45); transform: scale(1.1); }
/* Boutons Calques / Fond de carte dans la barre Leaflet (map) */
.leaflet-bar.leaflet-control-custom .header-action-btn {
    width: 34px; height: 34px;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0;
    color: #555;
    font-size: 0.95rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: none;
}
.leaflet-bar.leaflet-control-custom .header-action-btn + .header-action-btn { border-top: 1px solid #ccc; }
.leaflet-bar.leaflet-control-custom .header-action-btn:last-child { border-radius: 0 0 5px 5px; }
.leaflet-bar.leaflet-control-custom .header-action-btn:hover {
    background: #f4f4f4;
    border-color: #ccc;
    transform: none;
}
.overlay-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--white-03); border: 1px solid var(--white-05); margin-bottom: 8px; }
.overlay-color { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--white-10); }
.overlay-name { flex: 1; font-size: 0.85rem; }
.overlay-del { background: none; border: none; color: var(--danger); cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 0.85rem; opacity: 0.5; transition: all 0.2s; }
.overlay-del:hover { opacity: 1; background: rgba(231,76,60,0.15); }
.overlay-toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.overlay-toggle input { opacity: 0; width: 0; height: 0; }
.overlay-toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--white-15); border-radius: 20px; transition: 0.3s; }
.overlay-toggle-slider::before { content: ''; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
.overlay-toggle input:checked + .overlay-toggle-slider { background: var(--primary); }
.overlay-toggle input:checked + .overlay-toggle-slider::before { transform: translateX(16px); }
.overlay-predef-item:hover { background: var(--white-07) !important; border-color: var(--primary) !important; }

/* Tile provider selector */
.tile-provider-item:hover { background: var(--white-07) !important; border-color: var(--primary) !important; }
.tile-provider-item.active { background: var(--white-08) !important; border-color: var(--primary) !important; }

.poi-btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.poi-btn {
    flex: 1; min-width: 120px; padding: 10px 8px; border: 1px solid var(--white-10);
    border-radius: 8px; background: var(--white-03); color: var(--text);
    cursor: pointer; font-size: 0.82rem; transition: all 0.2s; text-align: center;
}
.poi-btn:hover { background: var(--white-08); border-color: var(--primary); }
.poi-btn:disabled { opacity: 0.4; cursor: wait; }
.poi-route-btn {
    flex: 1; min-width: 120px; padding: 6px 8px; border: 1px dashed var(--white-15);
    border-radius: 8px; background: var(--white-02); color: var(--text);
    cursor: pointer; font-size: 0.75rem; transition: all 0.2s; text-align: center;
}
.poi-route-btn:hover { background: var(--white-06); border-color: var(--primary); }

/* --- Utilitaires --- */
.text-dim { color: var(--text-dim); }
.text-right { text-align: right; }
.text-left { text-align: left; }
.icon-primary { color: var(--primary); }
.icon-dim { color: var(--text-dim); }
.icon-info { color: #3498db; }
.icon-warning { color: var(--warning); }
.icon-success { color: var(--success); }

/* --- Header voyage / accueil --- */
.shared-by { font-size: 0.65rem; color: var(--text-dim); font-weight: normal; display: block; line-height: 1.2; }
.shared-by i { color: var(--primary); }
.stat-item.mode-car { color: #3498db; }
.stat-item.mode-walk { color: #2ecc71; }
.stat-item.mode-plane { color: #e74c3c; }
.stat-item.mode-train { color: #f39c12; }
.agenda-header-row { display: flex; justify-content: space-between; align-items: center; }
#tool-title { display: flex; align-items: center; gap: 8px; margin: 0; }
#tool-title svg.lucide { flex-shrink: 0; }
.tool-meta { font-size: 0.8rem; color: var(--text-dim); }

/* --- Formulaires SweetAlert (voyages) --- */
.swal-form-left { text-align: left; }
.swal-label { font-size: 0.8rem; color: #a0a0a0; margin-left: 10px; }
.swal-label--spaced { display: block; margin-top: 15px; }
.swal-input--gap { margin-top: 5px; }
