/* ========================================
   VARIABLES & RESET
======================================== */

:root {
    --primary: #007bff;
    --primary-dark: #0056b3;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --dark: #212529;
    --light: #f8f9fa;
    --gray: #6c757d;
    --border: #dee2e6;
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--light);
    color: var(--dark);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   LAYOUT
======================================== */

#app {
    position: relative;
    min-height: 100vh;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--light);
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    padding-bottom: 100px;
}

/* ========================================
   HEADER
======================================== */

.header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--dark);
}

.header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--dark);
}

.header p {
    color: var(--gray);
    font-size: 0.95rem;
}

.subtitle {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 500;
}

.user-name {
    font-size: 0.9rem;
    color: var(--gray);
}

/* ========================================
   CARDS & FORMS
======================================== */

.card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--dark);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========================================
   BUTTONS
======================================== */

.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-large {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.1rem;
}

.btn-icon {
    background: white;
    border: 2px solid var(--border);
    color: var(--dark);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-finish {
    border-color: var(--success);
    color: var(--success);
}

/* ========================================
   ALLÉE LIST
======================================== */

.allee-list {
    display: grid;
    gap: var(--spacing-md);
}

.allee-item {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.allee-item:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.allee-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.allee-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.allee-info p {
    font-size: 0.85rem;
    color: var(--gray);
}

/* ========================================
   CAMERA
======================================== */

.camera-container {
    position: relative;
    height: 100vh;
    background: black;
    display: flex;
    flex-direction: column;
}

.camera-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    padding: var(--spacing-md);
    padding-top: calc(var(--spacing-md) + env(safe-area-inset-top));
    z-index: 10;
    color: white;
}

.session-info {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.camera-header-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.allee-badge {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.photo-count {
    font-size: 1rem;
    font-weight: 600;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
}

.connection-status.online .status-dot {
    background: var(--success);
}

/* Camera viewport */

.camera-viewport {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.target-frame {
    width: 80%;
    max-width: 400px;
    aspect-ratio: 4/3;
    border: 3px solid rgba(255,255,255,0.7);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.4);
}

.hint-text {
    position: absolute;
    bottom: 40px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Camera controls */

.camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: var(--spacing-lg);
    padding-bottom: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-capture {
    width: 80px;
    height: 80px;
    background: white;
    border: 5px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.btn-capture:active {
    transform: scale(0.95);
    background: var(--primary);
}

.capture-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
}

/* Flash feedback */

.flash-feedback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 100;
}

.flash-feedback.active {
    opacity: 0.8;
}

/* ========================================
   GALLERY
======================================== */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.photo-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--border);
    cursor: pointer;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-number {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.gallery-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ========================================
   SUMMARY & STATS
======================================== */

.summary-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--light);
    border-radius: var(--radius-sm);
}

.stat-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--gray);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-md);
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.stat-item .stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-item .stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 4px;
}

.sync-status {
    text-align: center;
    padding: var(--spacing-lg);
}

.status-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.sync-status p {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.sync-status small {
    color: var(--gray);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ========================================
   SESSIONS LIST
======================================== */

.session-item {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.session-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.session-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.session-badge.pending {
    background: var(--warning);
    color: white;
}

.session-badge.syncing {
    background: var(--primary);
    color: white;
}

.session-badge.completed {
    background: var(--success);
    color: white;
}

.session-details {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: var(--spacing-sm);
}

.session-progress {
    height: 6px;
    background: var(--light);
    border-radius: 3px;
    overflow: hidden;
    margin-top: var(--spacing-xs);
}

.session-progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

/* ========================================
   LOADER
======================================== */

.loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: white;
    margin-top: var(--spacing-md);
    font-weight: 500;
}

/* ========================================
   TOAST
======================================== */

.toast {
    position: fixed;
    bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--dark);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md);
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .header h2 {
        font-size: 1.2rem;
    }
    
    .btn-capture {
        width: 70px;
        height: 70px;
    }
    
    .capture-ring {
        width: 50px;
        height: 50px;
    }
}

/* ========================================
   PWA SAFE AREAS
======================================== */

@supports (padding: env(safe-area-inset-bottom)) {
    .container {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}

/* ══════════════════════════════════════════
   Tour du Manager
══════════════════════════════════════════ */

.choix-item--full {
    grid-column: 1 / -1;
}

.tour-accueil-desc {
    color: var(--gray);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

.btn-full {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1rem;
}

.tour-count-badge {
    background: rgba(0,123,255,0.15);
    color: var(--primary);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 8px;
}

.tour-thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: var(--spacing-md);
    min-height: 80px;
}

.tour-thumb {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    background: #eee;
}

.tour-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tour-thumb-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tour-gps-ok {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size: 13px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.tour-btn-row {
    display: flex;
    gap: 10px;
    margin-top: var(--spacing-md);
}

.tour-btn-row .btn {
    flex: 1;
}

.tour-btn-row--stack {
    flex-direction: column;
}

.tour-field-label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 8px;
    font-weight: 500;
}

.tour-textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.tour-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.tour-select {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: white;
    margin-bottom: var(--spacing-md);
    box-sizing: border-box;
}

.tour-succes-msg {
    text-align: center;
    padding: var(--spacing-xl) 0;
    color: var(--dark);
    font-size: 1rem;
    line-height: 1.6;
}

.tour-succes-resp {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--success);
    margin-top: 8px;
}
/* ══════════════════════════════════════════════════
   Tour Manager — nouvelles features
══════════════════════════════════════════════════ */

/* ── Écran contexte ─────────────────────────────── */
.tour-ctx-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0 var(--spacing-sm);
}

.tour-ctx-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-sm);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.tour-ctx-btn:active { transform: scale(0.97); }

.tour-ctx-btn.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
    background: #f0f7ff;
}

.tour-ctx-icon { font-size: 2rem; }

.tour-ctx-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    text-align: center;
    line-height: 1.3;
}

.tour-ctx-ou {
    text-align: center;
    color: var(--gray);
    font-size: 0.85rem;
    margin: var(--spacing-md) 0 var(--spacing-sm);
}

.tour-ctx-textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-family);
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
    color: var(--dark);
    background: white;
}

.tour-ctx-textarea:focus { border-color: var(--primary); }

/* Liste des tâches */
.tour-taches-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tour-list-loading {
    text-align: center;
    color: #aaa;
    font-size: 0.85rem;
    padding: 8px 0;
}
.tour-tache-card {
    background: #fff;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    display: flex;
    align-items: center;
    gap: 10px;
}
.tour-tache-info { flex: 1; min-width: 0; }
.tour-tache-action {
    font-size: 0.88rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 5px;
    line-height: 1.3;
}
.tour-tache-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #888;
}
.tour-statut-ok   { color: #10b981; font-weight: 600; }
.tour-statut-wait { color: #f59e0b; font-weight: 600; }
.tour-tache-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.tour-vue-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 10px;
    color: #fff;
}
.tour-vue-badge.vue-1 { background: #94a3b8; }
.tour-vue-badge.vue-2 { background: #f59e0b; }
.tour-vue-badge.vue-3 { background: #ef4444; }
.tour-vue-btn {
    background: none;
    border: 1.5px solid #ddd;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    cursor: pointer;
    color: #555;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tour-vue-btn:active { background: #f3f4f6; }

/* Suggestions IA */
.tour-suggest-loader {
    text-align: center;
    padding: 8px 0;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
}
.tour-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}
.tour-suggest-btn {
    background: #f0f7ff;
    border: 1.5px solid #93c5fd;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.88rem;
    color: #1e40af;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}
.tour-suggest-btn:active,
.tour-suggest-btn.active {
    background: #dbeafe;
    border-color: #3b82f6;
}

/* Dropdown searchable responsables */
.tour-search-wrap {
    position: relative;
    margin-bottom: 8px;
}
.tour-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.tour-input:focus { border-color: #3b82f6; }
.tour-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.tour-dropdown.open { display: block; }
.tour-dropdown-item {
    padding: 12px 14px;
    cursor: pointer;
    font-size: 0.92rem;
    border-bottom: 1px solid #f0f0f0;
    color: #222;
}
.tour-dropdown-item:last-child { border-bottom: none; }
.tour-dropdown-item:hover { background: #f0f7ff; color: #1e40af; }
.tour-resp-selected {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

/* ── Modale photos Tour Manager ──────────────────── */
.tour-photos-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: tour-overlay-in 0.18s ease;
}
@keyframes tour-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.tour-photos-box {
    background: #fff;
    width: 100%;
    max-width: 480px;
    max-height: 82vh;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: tour-box-in 0.22s cubic-bezier(.32,1.25,.55,1);
}
@keyframes tour-box-in {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.tour-photos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.tour-photos-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}
.tour-photos-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.tour-photos-close:active { background: #e2e8f0; }
.tour-photos-body {
    overflow-y: auto;
    flex: 1;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
}
.tour-photos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.tour-photos-img-wrap {
    border-radius: 12px;
    overflow: hidden;
    background: #f0f0f0;
    aspect-ratio: 4/3;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.tour-photos-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tour-photos-img-wrap:active { opacity: 0.85; }
.tour-photos-gps {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 20px;
}
.tour-photos-num {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tour-photos-loading,
.tour-photos-empty {
    text-align: center;
    color: #94a3b8;
    padding: 32px 0;
    font-size: 0.9rem;
}
/* Lightbox plein écran */
.tour-lightbox {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: tour-overlay-in 0.15s ease;
}
.tour-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}
.tour-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Rend les cards Tour Manager cliquables */
.tour-tache-card {
    cursor: pointer;
}
.tour-tache-card:active {
    background: #f8fafc;
}

/* ── Bouton installation PWA ─────────────────────── */
#pwa-install-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s, box-shadow 0.15s;
}
#pwa-install-btn span {
    font-size: 17px;
    line-height: 1;
}
#pwa-install-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
