/* Identité visuelle RESALOISIR : sidebar sombre, accent violet, cartes colorées.
   --rust reste le nom de variable utilisé dans tout le reste du fichier (accents,
   bordures actives, badges...) mais sa VALEUR passe du doré au violet — c'est ce qui
   permet à l'accent de se propager partout sans avoir à retoucher chaque règle. */
:root {
    --rust: #6C5CE7;
    --accent-text-on-gold: #fff;
    --sidebar-bg: #171b2b;
    --sidebar-bg-hover: #232842;
    --sidebar-text: #a9adc4;
    --sidebar-text-active: #fff;
    --admin-bg: #f5f6fb;
    --stat-green: #22c55e;
    --stat-blue: #3b82f6;
    --stat-orange: #f97316;
    --stat-red: #ef4444;
    --card-shadow: 0 1px 3px rgba(23,27,43,0.06), 0 1px 2px rgba(23,27,43,0.04);
    --chart-line: #22c55e;
}

/* Thème clair (sidebar blanche) — activé via body[data-theme="light"], choix
   disponible dans Réglages > Apparence. Le thème sombre ci-dessus reste la valeur
   par défaut tant que l'entreprise n'a rien choisi. */
body[data-theme="light"] {
    --sidebar-bg: #ffffff;
    --sidebar-bg-hover: #f1effe;
    --sidebar-text: #5b5f76;
    --sidebar-text-active: #171b2b;
    --chart-line: #6C5CE7;
}
body[data-theme="light"] .admin-nav { border-right: 1px solid rgba(23,27,43,0.08); }
body[data-theme="light"] .admin-nav .brand { color: var(--sidebar-text-active); }
body[data-theme="light"] .nav-item.active { background: #efeafe; color: var(--rust); }
body[data-theme="light"] .nav-item.active .nav-icon { color: var(--rust); }
body[data-theme="light"] .nav-item:hover { background: var(--sidebar-bg-hover); color: var(--sidebar-text-active); }
body[data-theme="light"] .nav-help-box { background: #f5f6fb; }
body[data-theme="light"] .nav-help-box strong { color: var(--sidebar-text-active); }
body[data-theme="light"] .nav-logout { color: #8b8fa3; }
body[data-theme="light"] .nav-section-label { color: #9296ab; }

.btn-primary { color: #fff !important; }

.admin-body { background: var(--admin-bg); }

/* Login */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-bg);
}
.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: var(--card-shadow);
}
.login-card .brand { color: var(--ink); margin-bottom: 4px; }
.login-card .brand .brand-name { color: var(--ink); }
.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

/* Layout */
.admin-app {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
/* Masqué par défaut (et donc hors de la grille de .admin-app) à toutes les
   tailles d'écran — sans ce display:none de base, cette div devient un item de
   grille à part entière sur desktop (aucune règle mobile ne s'applique) et
   décale la nav dans la 2e colonne. Ne redevient visible qu'en mobile (media
   query plus bas), quand elle passe aussi en position:fixed (hors du flux). */
.admin-nav-backdrop { display: none; }
.admin-nav {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.admin-nav .brand { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 22px; padding: 4px 8px; color: #fff; font-weight: 800; letter-spacing: 0.01em; }
.admin-nav .brand .brand-logo { width: 26px; height: 26px; flex-shrink: 0; }
.admin-nav .brand .brand-name { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.admin-nav .nav-section-label { font-size: 11px; text-transform: uppercase; color: #666c8a; font-weight: 700; letter-spacing: 0.06em; padding: 16px 12px 6px; }
.nav-item {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: var(--sidebar-bg-hover); color: #fff; }
.nav-item.active { background: var(--rust); color: #fff; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item .badge-orange { margin-left: auto; }
.nav-logout { margin-top: 10px; color: #666c8a; }
.nav-item-row { display: flex; align-items: center; border-radius: 10px; }
.nav-item-row:hover { background: var(--sidebar-bg-hover); }
.nav-item-row:hover .nav-item:hover { background: none; }
.nav-group-toggle { background: none; border: none; color: var(--sidebar-text); opacity: 0.6; padding: 2px; margin-right: 8px; cursor: pointer; display: flex; }
.nav-group-toggle svg { width: 14px; height: 14px; transition: transform 0.15s; }
.nav-group.open .nav-group-toggle svg { transform: rotate(90deg); }
.nav-subgroup { display: none; flex-direction: column; gap: 2px; padding-left: 8px; margin-top: 2px; }
.nav-group.open .nav-subgroup { display: flex; }
.nav-subitem { font-size: 13px; padding: 8px 12px 8px 30px; font-weight: 500; }
.nav-subitem .nav-icon { width: 15px; height: 15px; opacity: 0.7; }
.dragging { opacity: 0.4; }
.nav-help-box { margin-top: auto; background: var(--sidebar-bg-hover); border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 10px; }
.nav-help-box .nav-icon { width: 20px; height: 20px; color: var(--rust); flex-shrink: 0; }
.nav-help-box a, .nav-help-box div { font-size: 12px; color: var(--sidebar-text); }
.nav-help-box strong { display: block; color: #fff; font-size: 13px; margin-bottom: 2px; }

/* Barre du haut */
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid rgba(23,27,43,0.06);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.admin-topbar-hamburger { background: none; border: none; cursor: pointer; color: var(--ink); display: none; }

/* Bannière d'alerte SOS globale — visible depuis n'importe quel écran de l'admin,
   pas seulement la fiche du parcours concerné (voir startGlobalSosPolling). */
.global-sos-banner { position: sticky; top: 0; z-index: 9; background: #b3261e; color: #fff; }
.global-sos-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 32px; border-top: 1px solid rgba(255,255,255,0.2); animation: sos-pulse 1.6s ease-in-out infinite; }
.global-sos-item:first-child { border-top: none; }
.global-sos-text { font-weight: 700; font-size: 14px; }
.global-sos-actions { display: flex; gap: 8px; flex-shrink: 0; }
.global-sos-actions button { border: none; border-radius: 20px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.global-sos-actions .sos-view-btn { background: #fff; color: #b3261e; }
.global-sos-actions .sos-ack-btn { background: rgba(255,255,255,0.2); color: #fff; }
@keyframes sos-pulse { 0%, 100% { background-color: rgba(255,255,255,0); } 50% { background-color: rgba(255,255,255,0.12); } }
.admin-topbar-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.admin-topbar-bell { position: relative; background: none; border: none; cursor: pointer; color: var(--ink); }
.admin-topbar-bell .bell-badge { position: absolute; top: -4px; right: -4px; background: var(--stat-red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 5px; }
.admin-topbar-user { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.admin-topbar-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--rust); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }

.admin-main { padding: 28px 32px; overflow-y: auto; }
.admin-view h1 { font-size: 24px; margin: 0 0 24px; font-family: 'Work Sans', sans-serif; font-weight: 800; }

/* Boutons pleins (Accepter, Valider participants, etc.) */
.btn-accent-fill { background: var(--rust); color: #fff; }

/* Cards / tables */
.admin-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    padding: 22px;
    margin-bottom: 20px;
}
.admin-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table-scroll .admin-table { min-width: 640px; }
.admin-table td.veh-col-drag, .admin-table th.veh-col-drag,
.admin-table td.veh-col-name, .admin-table th.veh-col-name { position: sticky; background: #fff; z-index: 1; }
.admin-table td.veh-col-drag, .admin-table th.veh-col-drag { left: 0; }
.admin-table td.veh-col-name, .admin-table th.veh-col-name { left: 38px; box-shadow: 6px 0 6px -6px rgba(20,24,26,0.15); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 1px solid rgba(20,24,26,0.1);
}
.admin-table td { padding: 10px; border-bottom: 1px solid rgba(20,24,26,0.06); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-green { background: #e2f0e2; color: #2f6b3f; }
.badge-orange { background: #fbe6d6; color: #a8501b; }
.badge-red { background: #f6dede; color: #b3261e; }
.badge-grey { background: #ececec; color: #666; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin-bottom: 20px; }
.stat-box { background: #fff; border-radius: 14px; box-shadow: var(--card-shadow); padding: 18px 20px; display: flex; align-items: flex-start; gap: 14px; }
.stat-box .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.stat-box .stat-icon svg { width: 20px; height: 20px; }
.stat-box .stat-value { font-size: 22px; font-weight: 800; font-family: 'Work Sans', sans-serif; line-height: 1.2; }
.stat-box .stat-label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat-box .stat-delta { font-size: 11px; font-weight: 700; margin-top: 4px; }
.stat-box.stat-primary { background: linear-gradient(135deg, #7c6ff0, #6C5CE7); box-shadow: 0 8px 20px rgba(108,92,231,0.35); }
.stat-box.stat-primary .stat-value, .stat-box.stat-primary .stat-label, .stat-box.stat-primary .stat-delta { color: #fff; }
.stat-box.stat-primary .stat-label { opacity: 0.85; }
.stat-box.stat-primary .stat-icon { background: rgba(255,255,255,0.2); }
.stat-icon.icon-green { background: var(--stat-green); }
.stat-icon.icon-blue { background: var(--stat-blue); }
.stat-icon.icon-orange { background: var(--stat-orange); }
.stat-icon.icon-red { background: var(--stat-red); }

.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.form-row .field-input { margin-bottom: 0; }
.form-group { flex: 1; min-width: 140px; }
.form-group label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.btn-small { padding: 8px 14px; font-size: 13px; }
.btn-danger { background: #b3261e; color: #fff; }
.action-links { display: flex; gap: 8px; }
.action-links button { background: none; border: none; color: var(--rust); cursor: pointer; font-size: 13px; font-weight: 700; padding: 0; }

/* Vue maître-détail (Réservations) */
.md-layout { display: flex; gap: 0; border: 1px solid rgba(20,24,26,0.1); border-radius: var(--radius); background: #fff; overflow: hidden; min-height: 500px; }
.md-sidebar { width: 320px; flex-shrink: 0; border-right: 1px solid rgba(20,24,26,0.1); display: flex; flex-direction: column; }
.md-search { padding: 12px; border-bottom: 1px solid rgba(20,24,26,0.08); }
.md-search input { margin: 0; }
.md-list { overflow-y: auto; max-height: 640px; }
.md-list-item { padding: 14px 16px; border-bottom: 1px solid rgba(20,24,26,0.06); cursor: pointer; border-left: 3px solid transparent; }
.md-list-item:hover { background: #faf8f3; }
.md-list-item.selected { background: #fdf3ea; border-left-color: var(--rust); }
.md-list-item .md-row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.md-list-item .md-name { font-weight: 700; font-size: 14px; }
.md-list-item .md-row2 { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.md-detail { flex: 1; padding: 24px; }
.md-section { border: 1px solid rgba(20,24,26,0.1); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.md-section h4 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.md-section-head { display: flex; justify-content: space-between; align-items: flex-start; }
.voucher-summary-card { text-align: center; }
.voucher-summary-code { font-family: 'Work Sans', sans-serif; font-weight: 800; font-size: 20px; letter-spacing: 2px; }
.voucher-summary-amount { font-weight: 800; font-size: 32px; color: var(--rust); margin: 4px 0 16px; }
.voucher-summary-rows { text-align: left; border-top: 1px solid rgba(20,24,26,0.1); padding-top: 12px; }
.voucher-summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.voucher-summary-row span:first-child { color: var(--muted); }
.voucher-summary-row span:last-child { font-weight: 600; text-align: right; }
.voucher-summary-actions { display: flex; gap: 10px; margin-top: 16px; }
.voucher-summary-actions .btn { flex: 1; }
.voucher-summary-actions .btn-ghost { color: var(--ink); border-color: rgba(20,24,26,0.2); }
.cp-method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 14px; }
.cp-method-btn { background: #fff; border: 1px solid rgba(20,24,26,0.15); border-radius: var(--radius); padding: 10px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.cp-method-btn:hover { border-color: var(--rust); }
.cp-method-btn.selected { background: var(--rust); border-color: var(--rust); color: var(--accent-text-on-gold); }
.md-client-name { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.md-contact-line { font-size: 14px; margin: 2px 0; }
.md-contact-line a { color: var(--ink); text-decoration: none; }
.md-warning-banner { background: #fdeaea; color: #a03030; border: 1px solid #f3c8c8; border-radius: var(--radius); padding: 10px 12px; font-size: 13px; margin: 10px 0; }
.md-resource-tag { display: inline-block; background: #f0ece1; border-radius: 20px; padding: 3px 12px; font-size: 12px; font-weight: 600; margin-right: 6px; }
.md-price-line { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.md-price-line.total { font-weight: 700; border-top: 1px solid rgba(20,24,26,0.1); margin-top: 6px; padding-top: 8px; }
.route-overview-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .route-overview-grid { grid-template-columns: 1fr; } }
.route-overview-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid rgba(20,24,26,0.06); cursor: pointer; }
.route-overview-item:last-child { border-bottom: none; }
.route-overview-item:hover { background: var(--admin-bg); }
.route-overview-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.route-overview-main { flex: 1; min-width: 0; }
.route-overview-name { font-weight: 700; font-size: 13.5px; }

.contract-detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; margin: 14px 0; }
@media (max-width: 900px) { .contract-detail-grid { grid-template-columns: 1fr; } }
.contract-preview-card { background: #fff; border: 1px solid rgba(20,24,26,0.1); border-radius: 12px; padding: 24px; box-shadow: var(--card-shadow); }
.contract-preview-header { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; margin-bottom: 18px; }
.contract-preview-title { font-family: 'Work Sans', sans-serif; font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.contract-preview-meta { font-size: 12.5px; color: var(--ink); display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.contract-preview-meta strong { color: var(--muted); font-weight: 600; margin-right: 4px; }
.contract-preview-terms { font-size: 10.5px; color: var(--muted); line-height: 1.5; background: var(--admin-bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 18px; max-height: 110px; overflow: hidden; }
.contract-preview-sign-label { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.contract-preview-sign-box { border: 1px dashed rgba(20,24,26,0.2); border-radius: 8px; height: 70px; display: flex; align-items: center; justify-content: center; }
.contract-preview-sign-box img { max-height: 60px; max-width: 100%; }

.monitor-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid rgba(20,24,26,0.06); }
.monitor-row:last-child { border-bottom: none; }
.monitor-row-main { flex: 1; min-width: 0; }
.monitor-row-name { font-weight: 700; font-size: 14px; }
.monitor-row-today { min-width: 110px; text-align: right; }

.sig-tracker-list { display: flex; flex-direction: column; gap: 6px; }
.sig-tracker-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; font-size: 13px; }
.sig-tracker-item.current { background: rgba(108,92,231,0.08); }
.sig-tracker-name { flex: 1; font-weight: 600; }

.md-checklist { display: flex; flex-direction: column; gap: 4px; }
.md-checklist-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13.5px; font-weight: 600; border-bottom: 1px solid rgba(20,24,26,0.06); }
.md-checklist-item:last-child { border-bottom: none; }
.md-checklist-item span:first-child { color: var(--muted); font-weight: 600; }
.md-checklist-item span:last-child { display: flex; align-items: center; gap: 8px; }
.md-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.md-btn-row .btn { padding: 8px 16px; font-size: 13px; }

@media (max-width: 900px) {
    .md-layout { flex-direction: column; }
    .md-sidebar { width: 100%; border-right: none; border-bottom: 1px solid rgba(20,24,26,0.1); }
    .md-list { max-height: 300px; }
}

/* Planning */
.planning-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.planning-nav { display: flex; align-items: center; gap: 8px; }
.planning-nav .cal-nav-btn { width: 32px; height: 32px; }
.planning-label { font-weight: 700; min-width: 160px; text-align: center; }
.planning-view-switch { display: flex; border: 1px solid rgba(20,24,26,0.15); border-radius: var(--radius); overflow: hidden; }
.planning-view-switch button { background: #fff; border: none; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); }
.planning-view-switch button.active { background: var(--rust); color: var(--accent-text-on-gold); }
.planning-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.planning-filters select { margin: 0; padding: 7px 10px; width: auto; }

.planning-day-row { display: flex; border-bottom: 1px solid rgba(20,24,26,0.08); min-height: 46px; }
.planning-day-row:last-child { border-bottom: none; }
.planning-hour-label { width: 60px; flex-shrink: 0; padding: 10px 8px; font-size: 12px; color: var(--muted); font-weight: 700; }
.planning-day-cell { flex: 1; padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }

.planning-chip {
    display: block;
    background: #fdf3ea;
    border: 1px solid #f0d5b8;
    border-left: 4px solid #f0d5b8;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    max-width: 100%;
}
.planning-chip:hover { box-shadow: 0 2px 8px rgba(20,24,26,0.1); }
.planning-chip[draggable="true"] { cursor: grab; }
.planning-chip.dragging { opacity: 0.4; }
.admin-table tr[data-vehicle-row].dragging { opacity: 0.4; }
.planning-week-grid .pw-cell.drop-target { background: #f0eafd; outline: 2px dashed var(--rust); outline-offset: -2px; }
.planning-chip.status-annulee { background: #f6dede; border-color: #eab8b8; text-decoration: line-through; opacity: 0.7; }
.planning-chip.status-en_attente_validation { background: #fbe6d6; border-color: #eec9a0; }
.planning-chip.status-en_attente_paiement { background: #fbe6d6; border-color: #eec9a0; }
.planning-closure-chip { background: #ececec !important; color: #666 !important; border-color: #d3d1c7 !important; font-style: italic; }

.pw-card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.pw-card-icon { font-size: 13px; line-height: 1; }
.pw-card-name { font-weight: 700; font-size: 12.5px; }
.pw-card-tour { font-size: 11px; color: var(--muted); font-weight: 500; margin: 0 0 5px; }
.pw-card-time { font-size: 11px; color: var(--ink); font-weight: 600; margin-bottom: 1px; }
.pw-card-duration { color: var(--muted); font-weight: 500; }
.pw-card-phone { font-size: 10.5px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.pw-card-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.pw-badge { background: rgba(255,255,255,0.75); border: 1px solid rgba(20,24,26,0.15); border-radius: 20px; padding: 2px 8px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.pw-badge-contract { cursor: pointer; }
.pw-badge-contract:hover { border-color: var(--rust); color: var(--rust); }
.pw-contract-action { display: block; width: 100%; background: var(--rust); color: #fff; border: none; border-radius: 6px; padding: 5px 8px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em; cursor: pointer; margin-bottom: 6px; }
.pw-contract-action:hover { filter: brightness(1.08); }
.pw-card-price { font-weight: 800; font-size: 12px; background: rgba(255,255,255,0.65); border-radius: 6px; padding: 3px 9px; display: inline-block; }

.planning-week-grid { display: grid; grid-template-columns: 60px repeat(7, 1fr); border: 1px solid rgba(20,24,26,0.08); border-radius: var(--radius); overflow: hidden; }
.planning-week-grid .pw-head { background: #f6f3ea; font-size: 12px; font-weight: 700; padding: 8px 6px; text-align: center; border-bottom: 1px solid rgba(20,24,26,0.08); border-left: 1px solid rgba(20,24,26,0.06); }
.planning-week-grid .pw-head[data-plan-date] { cursor: pointer; user-select: none; }
.planning-week-grid .pw-head[data-plan-date]:hover { color: var(--rust); }
.planning-week-grid .pw-hour { font-size: 11px; color: var(--muted); font-weight: 700; padding: 8px 6px; border-top: 1px solid rgba(20,24,26,0.06); }
.planning-week-grid .pw-cell { border-top: 1px solid rgba(20,24,26,0.06); border-left: 1px solid rgba(20,24,26,0.06); padding: 5px; display: flex; flex-direction: column; gap: 5px; min-height: 40px; }

.planning-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.planning-month-grid .pm-weekday { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.planning-month-cell { border: 1px solid rgba(20,24,26,0.08); border-radius: var(--radius); min-height: 90px; padding: 6px; cursor: pointer; background: #fff; }
.planning-month-cell:hover { border-color: var(--rust); }
.planning-month-cell .pm-daynum { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.planning-month-cell .pm-count { display: inline-block; background: var(--rust); color: var(--accent-text-on-gold); font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 7px; margin-left: 4px; }
.planning-month-cell.empty { background: transparent; border: none; cursor: default; }
[data-plan-date].pm-selected { background: rgba(201,98,43,0.12) !important; border-color: var(--rust); box-shadow: inset 0 0 0 1px var(--rust); user-select: none; }
.planning-month-grid { user-select: none; }

.pm-selection-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid rgba(20,24,26,0.1); border-radius: var(--radius); padding: 10px 14px; margin-top: 10px; }
.pm-selection-bar strong { font-size: 13px; }
.pm-selection-bar .hint { margin: 0; flex: 1; min-width: 160px; }

/* Planning mobile (vue jour en frise + timeline verticale, écrans ≤800px) — le
   préfixe "pm-" est déjà pris ci-dessus pour la vue Mois ("Planning Month") ; ces
   classes-ci sont sans rapport (Planning Mobile), pas de collision de nom mais
   ne pas confondre les deux en modifiant l'un ou l'autre bloc. */
.pm-wrap { max-width: 560px; margin: 0 auto; }
.pm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.pm-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pm-head-actions .cal-nav-btn { width: 32px; height: 32px; }
.pm-day-strip { display: flex; gap: 6px; margin: 14px 0; }
.pm-day-cell {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: #fff; border: 1px solid rgba(20,24,26,0.1); border-radius: 12px;
    padding: 8px 2px; cursor: pointer; min-width: 0;
}
.pm-day-name { font-size: 11px; color: var(--muted); text-transform: lowercase; }
.pm-day-num { font-size: 16px; font-weight: 800; color: var(--ink); }
.pm-day-cell.active { background: var(--rust); border-color: var(--rust); }
.pm-day-cell.active .pm-day-name, .pm-day-cell.active .pm-day-num { color: #fff; }
.pm-mode-toggle { display: flex; gap: 6px; margin-bottom: 12px; }
.pm-mode-toggle button { flex: 1; background: #fff; border: 1px solid rgba(20,24,26,0.12); border-radius: 10px; padding: 7px 4px; font-size: 12.5px; font-weight: 700; color: var(--ink); cursor: pointer; }
.pm-mode-toggle button.active { background: var(--rust); border-color: var(--rust); color: #fff; }
.pm-week-agenda { background: #fff; border: 1px solid rgba(20,24,26,0.08); border-radius: var(--radius); overflow: hidden; }
.pm-week-day-section { border-top: 1px solid rgba(20,24,26,0.06); }
.pm-week-day-section:first-child { border-top: none; }
.pm-week-day-heading { display: block; width: 100%; text-align: left; background: var(--admin-bg); border: none; padding: 8px 14px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; cursor: pointer; }
.pm-week-day-heading.pm-week-day-today { color: var(--rust); }
.pm-week-today-tag { text-transform: none; font-weight: 700; background: var(--rust); color: #fff; border-radius: 10px; padding: 1px 8px; margin-left: 6px; font-size: 10.5px; }
.pm-week-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-top: 1px solid rgba(20,24,26,0.05); }
.pm-week-row:first-of-type { border-top: none; }
.pm-week-row-time { font-weight: 700; font-size: 13px; width: 40px; flex-shrink: 0; }
.pm-week-row-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-week-row-meta { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.pm-week-empty { padding: 4px 14px 12px; margin: 0; font-size: 12.5px; }
.pm-timeline-wrap { background: #fff; border: 1px solid rgba(20,24,26,0.08); border-radius: var(--radius); overflow: hidden; }
.pm-timeline { display: flex; position: relative; }
.pm-hours-col { width: 50px; flex-shrink: 0; border-right: 1px solid rgba(20,24,26,0.06); }
.pm-hour-label { font-size: 11.5px; color: var(--muted); text-align: right; padding: 4px 8px 0 0; box-sizing: border-box; border-top: 1px solid rgba(20,24,26,0.06); }
.pm-hours-col .pm-hour-label:first-child { border-top: none; }
.pm-events-col { flex: 1; position: relative; background-image: repeating-linear-gradient(to bottom, rgba(20,24,26,0.06), rgba(20,24,26,0.06) 1px, transparent 1px, transparent 100%); background-repeat: repeat-y; }
.pm-card {
    position: absolute; left: 6px; right: 6px; border-radius: 10px; padding: 8px 10px;
    display: flex; align-items: center; gap: 10px; cursor: pointer; overflow: hidden;
    border-left: 4px solid; box-shadow: 0 1px 3px rgba(20,24,26,0.08);
}
.pm-card-green { background: #eafaf0; border-left-color: #2f9e5c; }
.pm-card-orange { background: #fff4e5; border-left-color: #e2951f; }
.pm-card-red { background: #fdeceb; border-left-color: #d64545; }
.pm-card-blue { background: #eaf1fd; border-left-color: #3b74d6; }
.pm-card-thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.pm-card-thumb-placeholder { display: flex; align-items: center; justify-content: center; background: rgba(20,24,26,0.06); font-size: 18px; }
.pm-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-self: stretch; justify-content: center; }
.pm-card-title { font-weight: 700; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.pm-card-meta { display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.pm-status-pill { font-size: 11px; font-weight: 700; border-radius: 20px; padding: 3px 9px; white-space: nowrap; align-self: flex-start; }
.pm-status-green { background: #d7f3df; color: #1f7a41; }
.pm-status-orange { background: #fde6c3; color: #96600e; }
.pm-status-red { background: #fad1cd; color: #a3312a; }
.pm-status-blue { background: #d4e2fb; color: #2955a3; }
.pm-card-chevron { color: var(--muted); font-size: 16px; flex-shrink: 0; }
.pm-bottom-bar { display: flex; gap: 10px; margin-top: 14px; }
.pm-bottom-bar .btn-primary { flex: 1; }
@media (max-width: 400px) {
    .pm-card { padding: 8px; gap: 8px; }
    .pm-card-thumb, .pm-card-thumb-placeholder { width: 36px; height: 36px; }
    .pm-status-pill { font-size: 10px; padding: 3px 7px; }
}

/* Détail de session (planning mobile) — plein écran plutôt qu'une modale centrée,
   pour se comporter comme un écran d'appli à part entière (bouton retour, pas de
   fond visible autour). */
.pm-session-overlay { position: fixed; inset: 0; background: #fff; z-index: 600; display: flex; flex-direction: column; overflow: hidden; }
.pm-session-header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid rgba(20,24,26,0.08); flex-shrink: 0; }
.pm-session-header-title { flex: 1; min-width: 0; text-align: center; }
.pm-session-header-title h2 { font-size: 16px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-session-header-title p { font-size: 12.5px; color: var(--muted); margin: 1px 0 0; }
.pm-session-back, .pm-session-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink); width: 28px; flex-shrink: 0; }
.pm-session-body { flex: 1; overflow-y: auto; padding: 16px; }
.pm-stat-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 14px; }
.pm-stat-tile { background: #f5f6fb; border-radius: 10px; padding: 12px 6px; text-align: center; min-width: 0; }
.pm-stat-tile.pm-stat-warn { background: #fdeceb; }
.pm-stat-num { font-size: 19px; font-weight: 800; overflow-wrap: break-word; }
#rb-stats .pm-stat-num { font-size: 15px; }
.pm-stat-label { font-size: 11.5px; color: var(--muted); }
.pm-monitor-row { padding: 10px 0; border-top: 1px solid rgba(20,24,26,0.08); font-size: 13.5px; font-weight: 600; }
.pm-checklist { border-top: 1px solid rgba(20,24,26,0.08); padding-top: 4px; margin-bottom: 16px; }
.pm-checklist-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; border-bottom: 1px solid rgba(20,24,26,0.05); }
.pm-section-title { font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.pm-todo-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.pm-todo-item { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; cursor: pointer; border-left: 4px solid; }
.pm-todo-red { background: #fdeceb; border-left-color: #d64545; }
.pm-todo-orange { background: #fff4e5; border-left-color: #e2951f; }
.pm-todo-icon { font-size: 18px; flex-shrink: 0; }
.pm-todo-title { font-weight: 700; font-size: 13.5px; }
.pm-todo-detail { font-size: 12px; color: var(--muted); }
.pm-ready-banner { display: flex; align-items: center; gap: 12px; background: #eafaf0; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.pm-ready-banner-blue { background: #eaf1fd; }
.pm-ready-check { width: 34px; height: 34px; border-radius: 50%; background: #2f9e5c; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.pm-ready-banner-blue .pm-ready-check { background: #3b74d6; }
.pm-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.pm-tab { flex: 1; background: #f5f6fb; border: none; border-radius: 20px; padding: 7px 4px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted); }
.pm-tab.active { background: var(--rust); color: #fff; }
.pm-reservation-list { display: flex; flex-direction: column; gap: 10px; }
.pm-reservation-row { display: flex; align-items: center; gap: 10px; background: #f5f6fb; border-radius: 10px; padding: 12px; }
.pm-reservation-main { flex: 1; min-width: 0; }
.pm-reservation-name { font-weight: 700; font-size: 13.5px; }
.pm-badge-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pm-badge { font-size: 10.5px; font-weight: 700; border-radius: 12px; padding: 3px 8px; white-space: nowrap; }
.pm-badge-green { background: #d7f3df; color: #1f7a41; }
.pm-badge-orange { background: #fde6c3; color: #96600e; }
.pm-badge-red { background: #fad1cd; color: #a3312a; }
.pm-row-action { flex-shrink: 0; white-space: nowrap; }
.pm-progress-track { height: 8px; background: #e3e8f5; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.pm-progress-fill { height: 100%; background: #3b74d6; }
.pm-amount-due { text-align: center; font-size: 30px; font-weight: 800; color: var(--rust); background: #f5f6fb; border-radius: 10px; padding: 16px; }
.pm-method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.pm-method-btn { background: #f5f6fb; border: 1px solid rgba(20,24,26,0.1); border-radius: 8px; padding: 10px 4px; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--ink); }
.pm-method-btn.active { background: var(--rust); border-color: var(--rust); color: #fff; }

/* Réservations mobile (liste par sessions, écrans ≤800px) */
.rb-wrap { max-width: 560px; margin: 0 auto; }
.rb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rb-head h1 { margin: 0 0 2px; }
.rb-search-row { display: flex; gap: 8px; margin: 12px 0; }
.rb-search-row input { flex: 1; min-width: 0; border: 1px solid rgba(20,24,26,0.15); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-family: inherit; }
.rb-filter-btn { width: 40px; flex-shrink: 0; background: #fff; border: 1px solid rgba(20,24,26,0.15); border-radius: 10px; cursor: pointer; }
.rb-section-head { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 10px; }
.rb-section-head strong { font-size: 13.5px; }
.rb-sort-btn { background: none; border: 1px solid rgba(20,24,26,0.15); border-radius: 8px; padding: 5px 10px; font-size: 12px; color: var(--ink); cursor: pointer; }
.rb-card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; border-left: 4px solid #ccc; box-shadow: 0 1px 3px rgba(20,24,26,0.06); cursor: pointer; }
.rb-card-red { border-left-color: #d64545; }
.rb-card-orange { border-left-color: #e2951f; }
.rb-card-green { border-left-color: #2f9e5c; }
.rb-card-blue { border-left-color: #3b74d6; }
.rb-card-purple { border-left-color: var(--rust); }
.rb-card-grey { border-left-color: #999; opacity: 0.75; }
.rb-seminar-tag { display: inline-block; background: #ede9fe; color: var(--rust); font-size: 10.5px; font-weight: 700; border-radius: 12px; padding: 2px 9px; margin-bottom: 6px; }
.rb-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rb-card-title { font-weight: 700; font-size: 14.5px; }
.rb-card-call { display: inline-block; text-decoration: none; margin-left: 4px; }
.rb-card-price { font-weight: 700; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.rb-card-price.due { color: #a3312a; }
.rb-card-chevron { color: var(--muted); font-size: 16px; flex-shrink: 0; }
.rb-card-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.rb-card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(20,24,26,0.06); }
.rb-card-time { font-size: 12px; color: var(--muted); }
.rb-status-btn { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; border-radius: 20px; padding: 6px 14px; white-space: nowrap; border: none; }
.rb-status-red { background: #fad1cd; color: #a3312a; }
.rb-status-orange { background: #fde6c3; color: #96600e; }
.rb-status-green { background: #d7f3df; color: #1f7a41; }
.rb-status-blue { background: #d4e2fb; color: #2955a3; }
.rb-status-purple { background: #ede9fe; color: var(--rust); }
.rb-status-grey { background: #eee; color: #777; }

/* Réservations desktop (liste enrichie, une ligne par réservation) */
.rbd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.rbd-head h1 { margin: 0 0 2px; }
.rbd-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.rbd-date-nav { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid rgba(20,24,26,0.12); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: 13.5px; }
.rbd-date-nav button { background: none; border: none; cursor: pointer; font-size: 15px; color: var(--ink); padding: 0 4px; }
.rbd-filters-btn { background: #fff; border: 1px solid rgba(20,24,26,0.12); border-radius: 10px; padding: 8px 16px; font-weight: 600; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.rbd-external-link { background: none; border: none; color: var(--muted); font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 0; }
.rbd-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.rbd-row { background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(20,24,26,0.06); border-left: 5px solid #ccc; display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; cursor: pointer; }
.rbd-col-time { min-width: 70px; flex-shrink: 0; }
.rbd-col-time .rbd-time { font-size: 17px; font-weight: 800; }
.rbd-col-time .rbd-time-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.rbd-col-contact { min-width: 170px; flex: 1 1 170px; }
.rbd-col-contact .rbd-name { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.rbd-contact-line { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.rbd-contact-line a { color: inherit; text-decoration: none; }
.rbd-col-activity { min-width: 180px; flex: 1.3 1 180px; }
.rbd-tour-pill { display: inline-block; background: #ede9fe; color: var(--rust); font-size: 11.5px; font-weight: 700; border-radius: 14px; padding: 4px 11px; margin-bottom: 6px; }
.rbd-activity-line { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.rbd-col-payment { min-width: 140px; flex-shrink: 0; text-align: right; }
.rbd-price-total { font-weight: 800; font-size: 15px; }
.rbd-price-paid { font-size: 11.5px; color: #1f7a41; font-weight: 700; margin-top: 2px; }
.rbd-price-due { font-size: 11.5px; color: #a3312a; font-weight: 700; margin-top: 2px; }
.rbd-encaisser-btn { margin-top: 8px; background: #e2951f; color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.rbd-col-contracts { min-width: 150px; flex-shrink: 0; text-align: right; }
.rbd-contracts-count { font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.rbd-progress-track { height: 6px; background: #e3e8f5; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.rbd-progress-fill { height: 100%; background: #e2951f; }
.rbd-progress-fill.complete { background: #2f9e5c; }
.rbd-voir-btn { background: #ede9fe; color: var(--rust); border: none; border-radius: 8px; padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.rbd-signed-pill { display: inline-flex; align-items: center; gap: 4px; background: #d7f3df; color: #1f7a41; border-radius: 14px; padding: 5px 12px; font-size: 12px; font-weight: 700; }
.rbd-col-chevron { color: var(--muted); font-size: 18px; flex-shrink: 0; align-self: center; }
.rbd-notes-row { flex-basis: 100%; display: flex; gap: 8px; align-items: center; margin-top: 4px; padding-top: 10px; border-top: 1px solid rgba(20,24,26,0.06); font-size: 12.5px; }
.rbd-notes-row strong { color: var(--muted); font-weight: 700; }
.rbd-quick-actions { flex-basis: 100%; display: flex; gap: 8px; }
.rbd-quick-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(20,24,26,0.12); background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.rbd-quick-btn.rbd-quick-call { color: #2f9e5c; border-color: #bfe6cc; }
.rbd-quick-btn.rbd-quick-msg { color: #3b74d6; border-color: #c3d7f6; }

/* Fiche réservation opérationnelle (mode terrain) — un seul écran, actions inline */
.bo-overlay { position: fixed; inset: 0; background: var(--admin-bg, #f7f6f3); z-index: 600; display: flex; flex-direction: column; }
.bo-header { position: sticky; top: 0; z-index: 5; background: #fff; padding: 14px 16px 12px; border-bottom: 1px solid rgba(20,24,26,0.08); display: flex; align-items: flex-start; gap: 10px; }
.bo-back { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink); line-height: 1; padding: 4px 6px 4px 0; flex-shrink: 0; }
.bo-header-title { flex: 1; min-width: 0; }
.bo-header-title h2 { margin: 0; font-size: 18px; font-weight: 800; overflow-wrap: break-word; }
.bo-header-meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.bo-header-ref { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); }
.bo-advanced-link { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 2px 4px; flex-shrink: 0; }
.bo-body { flex: 1; overflow-y: auto; padding: 14px 16px 24px; }
.bo-card { background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(20,24,26,0.06); }
.bo-card h4 { margin: 0 0 10px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); font-weight: 700; }
.bo-client-name { font-size: 19px; font-weight: 800; margin: 0 0 6px; }
.bo-contact-line { margin: 2px 0; font-size: 14px; color: var(--ink); }
.bo-client-actions { display: flex; gap: 8px; margin-top: 12px; }
.bo-client-actions a { flex: 1; text-align: center; padding: 10px 6px; border-radius: 12px; background: var(--admin-bg); font-weight: 700; font-size: 12.5px; color: var(--ink); text-decoration: none; }
.bo-client-actions a.bo-call { background: #e7f7ec; color: #1f7a41; }
.bo-client-actions a.bo-sms { background: #eef1fb; color: #3b4bd6; }
.bo-client-actions a.bo-email { background: #f1edfd; color: var(--rust); }
.bo-notes { font-size: 13px; color: var(--muted); margin: 0; }
.bo-nav { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-bottom: 16px; }
.bo-nav-btn { background: #fff; border: 1px solid rgba(20,24,26,0.1); border-radius: 12px; padding: 10px 4px; text-align: center; cursor: pointer; font-size: 11px; font-weight: 700; color: var(--ink); min-width: 0; }
.bo-nav-btn .bo-nav-count { display: block; font-size: 15px; font-weight: 800; margin-bottom: 2px; }
.bo-nav-btn.bo-nav-warn .bo-nav-count { color: #b5720a; }
.bo-payment-amount-row { display: flex; justify-content: space-between; margin: 4px 0; font-size: 14px; }
.bo-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin: 10px 0; }
.bo-method-btn { padding: 10px 4px; border-radius: 10px; border: 1px solid rgba(20,24,26,0.14); background: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--ink); }
.bo-method-btn.selected { background: var(--rust); border-color: var(--rust); color: #fff; }
.bo-amount-input { width: 100%; font-size: 20px; font-weight: 800; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(20,24,26,0.15); margin: 8px 0; box-sizing: border-box; }
.bo-encaisser-btn { width: 100%; background: #e2951f; color: #fff; border: none; border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 800; cursor: pointer; margin-top: 6px; }
.bo-paid-banner { display: flex; align-items: center; gap: 8px; background: #e7f7ec; color: #1f7a41; border-radius: 12px; padding: 12px 14px; font-weight: 800; font-size: 14.5px; }
.bo-due-banner { display: flex; align-items: center; gap: 8px; background: #fdece0; color: #b5560a; border-radius: 12px; padding: 12px 14px; font-weight: 800; font-size: 14.5px; margin-bottom: 12px; }
.vat-detail { margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(20,24,26,0.14); }
.vat-detail h4 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); font-weight: 700; }
.vat-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 13.5px; padding: 5px 0; }
.vat-row .lbl { display: flex; flex-direction: column; }
.vat-row .lbl .sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.vat-total-bar { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(20,24,26,0.1); font-weight: 800; font-size: 14px; }
.bo-payment-history-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding: 4px 0; border-top: 1px solid rgba(20,24,26,0.06); }
.bo-participant-row, .bo-contract-row, .bo-vehicle-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(20,24,26,0.06); }
.bo-participant-row:first-of-type, .bo-contract-row:first-of-type, .bo-vehicle-row:first-of-type { border-top: none; padding-top: 0; }
.bo-row-name { font-weight: 700; font-size: 14px; }
.bo-row-badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.bo-mini-badge { font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 700; white-space: nowrap; background: #eee; color: var(--muted); }
.bo-mini-badge.ok { background: #e7f7ec; color: #1f7a41; }
.bo-mini-badge.warn { background: #fdecd2; color: #b5720a; }
.bo-row-action-btn { background: var(--rust); color: #fff; border: none; border-radius: 9px; padding: 8px 14px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.bo-row-action-btn.secondary { background: #fff; color: var(--ink); border: 1px solid rgba(20,24,26,0.15); }
.bo-see-all-btn { background: none; border: none; color: var(--rust); font-weight: 700; font-size: 13px; cursor: pointer; padding: 8px 0 0; }
.bo-ready-banner { background: #e7f7ec; }
.bo-ready-banner h3 { margin: 0 0 10px; color: #1f7a41; font-size: 16px; }
.bo-sticky-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid rgba(20,24,26,0.1); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
.bo-sticky-btn { width: 100%; border: none; border-radius: 14px; padding: 15px; font-size: 15px; font-weight: 800; color: #fff; cursor: pointer; background: var(--rust); }
.bo-sticky-btn.pay { background: #e2951f; }
.bo-sticky-btn.start { background: #2f9e5c; }
.bo-sticky-btn.waiting { background: #8a8f98; }
.bo-pending-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
@media (min-width: 900px) {
    .bo-body { max-width: 640px; margin: 0 auto; width: 100%; }
    .bo-header, .bo-sticky-bar { padding-left: calc((100% - 640px) / 2 + 16px); padding-right: calc((100% - 640px) / 2 + 16px); }
}

/* Modale "Nouvelle réservation" façon Guidap */
/* z-index 1000 : au-dessus des panneaux/contrôles internes de Leaflet (jusqu'à 800),
   sinon une carte encore montée derrière la modale (ex: aperçu d'un parcours) traverse
   visuellement l'overlay au lieu de rester masquée dessous. */
.nr-overlay { position: fixed; inset: 0; background: rgba(20,24,26,0.55); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.nr-modal { background: #f6f5f2; border-radius: 12px; width: 100%; max-width: 1100px; padding: 32px; position: relative; }
.nr-close { position: absolute; top: 24px; right: 28px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.nr-modal h2 { margin: 0 0 20px; font-size: 26px; font-weight: 400; }
.nr-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.nr-date-row { background: #fff; border: 1px solid rgba(20,24,26,0.1); border-radius: 8px; padding: 14px 18px; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; font-weight: 700; }
.nr-date-row button { background: none; border: none; color: var(--rust); font-weight: 600; cursor: pointer; font-size: 13px; }
.nr-search { background: #fff; border: 1px solid rgba(20,24,26,0.1); border-radius: 8px; padding: 12px 16px; margin-bottom: 4px; }
.nr-search input { border: none; width: 100%; outline: none; font-size: 14px; }
.nr-departures-card { background: #fff; border: 1px solid rgba(20,24,26,0.1); border-radius: 8px; overflow: hidden; }
.nr-departures-card > h4 { margin: 0; padding: 14px 18px; font-size: 15px; }
.nr-tour-row { border-top: 1px solid rgba(20,24,26,0.08); }
.nr-tour-header { padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.nr-tour-header:hover { background: #faf8f3; }
.nr-tour-body { padding: 0 18px 16px; display: none; }
.nr-tour-body.open { display: block; }
.nr-duration-block { padding: 10px 0; border-top: 1px solid rgba(20,24,26,0.06); }
.nr-duration-label { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.nr-counter-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 13px; }
.nr-counter-row .stepper button { width: 26px; height: 26px; }
.nr-slots-label { font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.nr-slot-btn { background: #fff; border: 1px solid rgba(20,24,26,0.2); border-radius: 6px; padding: 8px 14px; font-size: 13px; font-weight: 600; margin: 0 6px 6px 0; cursor: pointer; }
.nr-slot-btn:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.nr-slot-btn.selected { background: var(--ink); color: #fff; border-color: var(--ink); }
.nr-selection-card { background: #fff; border: 1px solid rgba(20,24,26,0.1); border-radius: 8px; padding: 20px; }
.nr-selection-card h4 { margin: 0 0 12px; font-size: 15px; }
.nr-selection-status { background: #dcebe6; color: #2f6b3f; border-radius: 6px; padding: 12px 14px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.nr-selection-status.filled { background: #fdf3ea; color: var(--rust); }
.nr-client-label { font-size: 13px; font-weight: 700; margin: 0 0 10px; }
.nr-client-label span { font-weight: 400; color: var(--muted); }

@media (max-width: 800px) {
    .nr-layout { grid-template-columns: 1fr; }
}

.planning-add-btn {
    background: none;
    border: 1px dashed rgba(20,24,26,0.25);
    border-radius: 4px;
    color: var(--muted);
    font-size: 11px;
    padding: 4px 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.1s ease;
}
.planning-day-cell:hover .planning-add-btn,
.pw-cell:hover .planning-add-btn { opacity: 1; }
.planning-add-btn:hover { border-color: var(--rust); color: var(--rust); }
.planning-add-btn.small { width: 22px; height: 22px; padding: 0; border-radius: 50%; font-size: 14px; line-height: 1; }

/* Caisse : cartes cliquables + tiroir */
.pos-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 4px; }
.pos-card {
    background: #fff;
    border: 1px solid rgba(20,24,26,0.12);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: left;
    cursor: pointer;
    font-family: 'Work Sans', sans-serif;
}
.pos-card:hover { border-color: var(--rust); box-shadow: 0 2px 8px rgba(20,24,26,0.08); }
.pos-card-name { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.pos-card-meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.pos-card-price { color: var(--rust); font-weight: 700; font-size: 14px; }

.drawer-overlay-admin {
    position: fixed; inset: 0;
    background: rgba(20,24,26,0.5);
    z-index: 200;
    display: flex;
    justify-content: flex-end;
}
.drawer-overlay-admin .drawer-panel-admin {
    background: #fff;
    width: 100%;
    max-width: 480px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.drawer-overlay-admin .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(20,24,26,0.08);
}
.drawer-overlay-admin .drawer-header h3 { margin: 0; font-family: 'Work Sans', sans-serif; font-weight: 800; }

@media (max-width: 600px) {
    .drawer-overlay-admin .drawer-panel-admin { max-width: 100%; }
}

/* Sous-menu Réglages */
.settings-layout { display: flex; gap: 24px; align-items: flex-start; }
.settings-subnav { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-subnav button {
    text-align: left;
    background: none;
    border: none;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}
.settings-subnav button:hover { background: rgba(20,24,26,0.05); }
.settings-subnav button.active { background: var(--rust); color: var(--accent-text-on-gold); }
.settings-content { flex: 1; min-width: 0; }
.google-status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.google-status-pill.connected { background: #e2f0e2; color: #2f6b3f; }
.google-status-pill.disconnected { background: #ececec; color: #666; }

@media (max-width: 760px) {
    .settings-layout { flex-direction: column; }
    .settings-subnav { width: 100%; flex-direction: row; overflow-x: auto; }
}

/* Liste des bons cadeaux (façon Guidap) */
/* Liste des bons cadeaux : utilise .md-list-item / .md-row1 / .md-row2 (styles maître-détail partagés) */

@media (max-width: 800px) {
    .admin-app { grid-template-columns: 1fr; }
    .admin-nav { position: fixed; top: 0; left: 0; bottom: 0; width: 240px; z-index: 100; transform: translateX(-100%); transition: transform 0.2s ease; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .admin-nav.open { transform: translateX(0); }
    .admin-topbar-hamburger { display: block; }
    /* Fond assombri derrière le menu ouvert : indique que le reste de l'écran
       est momentanément inactif, et permet de refermer le menu en touchant
       n'importe où en dehors (voir le clic sur #admin-nav-backdrop dans admin.js). */
    .admin-nav-backdrop { position: fixed; inset: 0; background: rgba(20,24,26,0.5); z-index: 99; }
    .admin-nav-backdrop.show { display: block; }
}

/* ---------- Activités : liste ---------- */
.tv-table th:not(:first-child), .tv-table td:not(:first-child) { text-align: center; width: 1%; white-space: nowrap; }
.tv-table th:first-child, .tv-table td:first-child { width: auto; }
.tv-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.tv-row-actions button, .tv-category-head button { background: none; border: none; cursor: pointer; font-weight: 700; font-size: 13px; padding: 4px 6px; }
.tv-row-actions .tv-reorder, .tv-category-head .tv-cat-reorder { color: var(--muted); }
.tv-row-actions .tv-reorder:disabled, .tv-category-head .tv-cat-reorder:disabled { opacity: 0.3; cursor: default; }
.tv-row-actions .tv-edit, .tv-category-head .tv-cat-rename { color: var(--ink); }
.tv-row-actions .tv-delete, .tv-category-head .tv-cat-delete { color: #b3261e; }
.tv-category-group { margin-bottom: 16px; }
.tv-category-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

/* ---------- Éditeur de texte riche maison ---------- */
.rte { border: 1px solid rgba(20,24,26,0.15); border-radius: var(--radius); overflow: hidden; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 2px; background: #f6f5f2; padding: 6px; border-bottom: 1px solid rgba(20,24,26,0.1); }
.rte-toolbar button { background: none; border: none; border-radius: 4px; padding: 6px 9px; font-size: 13px; cursor: pointer; color: var(--ink); }
.rte-toolbar button:hover { background: rgba(20,24,26,0.08); }
.rte-sep { width: 1px; background: rgba(20,24,26,0.15); margin: 4px 4px; }
.rte-editable { min-height: 120px; padding: 12px 14px; font-size: 14px; line-height: 1.5; outline: none; }
.rte-editable:focus { background: #fffdf8; }

/* ---------- Activités : fiche d'édition ---------- */
.te-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.te-footer { display: flex; gap: 10px; margin-top: 8px; }
.tour-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; margin-top: 12px; }
.tour-edit-main, .tour-edit-side { min-width: 0; }
.te-photo-main { display: flex; gap: 14px; align-items: flex-start; }
.te-photo-preview { width: 120px; height: 90px; border-radius: var(--radius); background: #f4f2ec; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.te-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.te-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.te-gallery-item { position: relative; width: 90px; height: 68px; border-radius: var(--radius); overflow: hidden; background: #f4f2ec; }
.te-gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.te-gallery-remove { position: absolute; top: 2px; right: 2px; background: rgba(20,24,26,0.7); color: #fff; border: none; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; cursor: pointer; line-height: 1; }
.te-address-row { border: 1px solid rgba(20,24,26,0.08); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.te-address-row .form-row { align-items: flex-end; }
.te-address-remove { background: none; border: none; color: #b3261e; cursor: pointer; font-weight: 700; padding: 8px; }

@media (max-width: 960px) {
    .tour-edit-grid { grid-template-columns: 1fr; }
}

/* ---------- Forfaits ---------- */
.tp-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 12px; }
.tp-sidebar { background: #fff; border: 1px solid rgba(20,24,26,0.1); border-radius: var(--radius); padding: 14px; }
.tp-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid rgba(20,24,26,0.08); border-radius: var(--radius); padding: 4px 4px 4px 10px; margin-bottom: 8px; }
.tp-item.active { border-color: var(--rust); box-shadow: inset 0 0 0 1px var(--rust); }
.tp-item-main { cursor: pointer; flex: 1; min-width: 0; padding: 6px 0; }
.tp-item-name { font-weight: 700; font-size: 14px; }
.tp-item-reorder { display: flex; flex-direction: column; }
.tp-item-reorder button { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 12px; padding: 2px 4px; }
.tp-config h4 { margin: 0 0 4px; font-size: 14px; }
.tp-bulk-slots { background: #f6f5f2; border-radius: var(--radius); padding: 12px 14px; }
.tp-bulk-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.tp-bulk-row .field-input { margin: 0; padding: 8px 10px; }
.tp-slots-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-slot-chip { display: inline-flex; align-items: center; gap: 6px; background: #f4f2ec; border-radius: 20px; padding: 6px 6px 6px 12px; font-size: 13px; font-weight: 600; }
.tp-slot-remove { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 11px; border-radius: 50%; width: 18px; height: 18px; }
.tp-slot-remove:hover { background: rgba(20,24,26,0.1); color: #b3261e; }

@media (max-width: 800px) {
    .tp-layout { grid-template-columns: 1fr; }
}

/* ---------- Tableau de bord : en-tête, graphiques, listes ---------- */
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.dash-header h1 { margin: 0; }
.dash-header .hint { margin: 2px 0 0; }
.dash-period-select { width: auto; margin: 0; padding: 9px 14px; }

.dash-row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 20px; }
.dash-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 900px) {
    .dash-row2, .dash-row3 { grid-template-columns: 1fr; }
}

.dash-card h3 { margin: 0 0 16px; font-size: 15px; }

.donut-legend { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-item strong { display: block; font-size: 13px; }
.donut-legend-item span.hint { font-size: 12px; }

.dash-list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(20,24,26,0.06); }
.dash-list-item:last-child { border-bottom: none; }
.dash-list-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #f0ece1; flex-shrink: 0; }
.dash-list-thumb-placeholder { width: 44px; height: 44px; border-radius: 10px; background: var(--admin-bg); flex-shrink: 0; }
.dash-list-name { font-weight: 700; font-size: 13.5px; }
.dash-list-meta { color: var(--muted); font-size: 12px; margin-top: 1px; }
.dash-list-price { margin-left: auto; font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.dash-empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.dash-empty svg { width: 36px; height: 36px; margin-bottom: 8px; opacity: 0.4; }

/* ---------- Tableau de bord : centre d'action ---------- */
.dash-action-center { margin-bottom: 20px; }
.dash-action-list { display: flex; flex-direction: column; gap: 2px; }
.dash-action-item { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; font-size: 13.5px; font-weight: 600; }
.dash-action-item-clickable { cursor: pointer; }
.dash-action-item-clickable:hover { background: var(--admin-bg); }
.dash-action-text { flex: 1; }

/* ---------- Tableau de bord : en-tête de salutation, actions rapides, alertes ---------- */
.dash-greeting-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.dash-greeting-title { margin: 0; font-size: 24px; text-transform: none; }
.dash-greeting-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dash-date-chip { background: #fff; border-radius: 10px; box-shadow: var(--card-shadow); padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }

.dash-stat-grid-6 { grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); }
.stat-sub { color: var(--muted); font-size: 11px; font-weight: 700; margin-top: 4px; }

.dash-quick-actions { display: flex; flex-direction: column; gap: 6px; }
.dash-quick-action {
    display: flex; align-items: center; gap: 10px;
    background: none; border: none; text-align: left;
    padding: 9px 8px; border-radius: 10px; cursor: pointer;
    font-size: 13.5px; font-weight: 600; color: var(--ink);
    font-family: 'Work Sans', sans-serif;
}
.dash-quick-action:hover { background: var(--admin-bg); }
.dash-quick-action-icon { width: 30px; height: 30px; border-radius: 8px; background: rgba(108,92,231,0.1); color: var(--rust); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-quick-action-icon svg { width: 16px; height: 16px; }

.dash-alerts-list { display: flex; flex-direction: column; gap: 4px; }
.dash-alert-item { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; font-size: 13px; cursor: pointer; }
.dash-alert-item:hover { background: var(--admin-bg); }
.dash-alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-alert-dot-red { background: var(--stat-red); }
.dash-alert-dot-orange { background: var(--stat-orange); }

.dash-ca-value { font-size: 24px; font-weight: 800; font-family: 'Work Sans', sans-serif; display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.dash-ca-value .stat-delta { font-size: 13px; }

/* ---------- Planning personnalisé d'une activité ---------- */
.ts-mode-row { display: flex; flex-direction: column; gap: 10px; }
.ts-mode-option { display: flex; align-items: flex-start; gap: 10px; border: 1px solid rgba(20,24,26,0.12); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.ts-mode-option:has(input:checked) { border-color: var(--rust); box-shadow: inset 0 0 0 1px var(--rust); background: rgba(108,92,231,0.04); }
.ts-mode-option input[type="radio"] { margin-top: 4px; flex-shrink: 0; }
.ts-mode-option strong { font-size: 14px; }
.ts-mode-option .hint { margin: 2px 0 0; }

.ts-slot-row { border: 1px solid rgba(20,24,26,0.1); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.ts-slot-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ts-slot-main strong { font-size: 15px; min-width: 50px; }
.ts-slot-rule { font-size: 12px; color: var(--muted); }
.ts-slot-rule-open { color: #2f6b3f; }
.ts-slot-actions { display: flex; gap: 14px; margin-top: 6px; }
.ts-slot-actions button { background: none; border: none; cursor: pointer; font-size: 12px; font-weight: 700; padding: 0; color: var(--ink); }
.ts-slot-actions .ts-slot-delete-btn { color: #b3261e; }

/* ---------- Assistant IA ---------- */
.ai-fab {
    position: fixed; right: 24px; bottom: 24px; width: 54px; height: 54px; border-radius: 50%;
    background: var(--rust); color: #fff; border: none; font-size: 22px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(108,92,231,0.4); z-index: 350; display: flex; align-items: center; justify-content: center;
}
.ai-fab:hover { filter: brightness(1.08); }
.ai-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 410px; max-width: 100vw; background: #fff;
    box-shadow: -6px 0 28px rgba(20,24,26,0.16); z-index: 400; display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform 0.2s ease; overflow-x: hidden;
}
.ai-panel.open { transform: translateX(0); }
.ai-panel-header { padding: 18px 18px 14px; border-bottom: 1px solid rgba(20,24,26,0.08); flex-shrink: 0; }
.ai-panel-header-top { display: flex; align-items: center; justify-content: space-between; }
.ai-panel-title { font-size: 17px; font-weight: 800; margin: 0; }
.ai-panel-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 4px; }
.ai-panel-sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; }
.ai-online-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: #2f6b3f; background: #e2f0e2; padding: 3px 10px; border-radius: 20px; }
.ai-online-badge.offline { color: #a05a1e; background: #fbe6d6; }
.ai-online-dot { width: 6px; height: 6px; border-radius: 50%; background: #2f6b3f; }
.ai-online-badge.offline .ai-online-dot { background: #a05a1e; }
.ai-panel-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.ai-greeting { font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.ai-greeting-sub { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.ai-alert-card { display: flex; gap: 10px; padding: 12px; border-radius: 10px; background: #f5f6fb; align-items: flex-start; }
.ai-alert-card > div { min-width: 0; }
.ai-alert-icon { font-size: 16px; flex-shrink: 0; }
.ai-alert-title { font-weight: 700; font-size: 13.5px; overflow-wrap: break-word; }
.ai-alert-detail { font-size: 12.5px; color: var(--muted); margin-top: 1px; overflow-wrap: break-word; }
.ai-quick-actions-label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 4px 0 2px; }
.ai-quick-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-quick-action-btn { background: #f0eafd; color: var(--rust); border: 1px solid rgba(108,92,231,0.25); border-radius: 20px; padding: 7px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: normal; max-width: 100%; text-align: left; }
.ai-quick-action-btn:hover { background: #e5ddfd; }
.ai-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; }
.ai-msg-user { align-self: flex-end; background: var(--rust); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg-assistant { align-self: flex-start; background: #f5f6fb; color: var(--ink); border-bottom-left-radius: 4px; }
.ai-msg-loading { align-self: flex-start; color: var(--muted); font-size: 13px; font-style: italic; }
.ai-action-card { align-self: stretch; border: 1px solid rgba(108,92,231,0.3); background: #f8f7ff; border-radius: 12px; padding: 12px; }
.ai-action-card-summary { font-size: 13px; white-space: pre-wrap; margin-bottom: 10px; }
.ai-action-card-buttons { display: flex; gap: 8px; }
.ai-action-card-buttons button { flex: 1; padding: 9px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; border: none; }
.ai-action-confirm { background: var(--rust); color: #fff; }
.ai-action-cancel { background: #eee; color: var(--ink); }
.ai-panel-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 8px; flex-shrink: 0; }
.ai-suggestion-chip { background: #f5f6fb; border: 1px solid rgba(20,24,26,0.08); border-radius: 16px; padding: 5px 11px; font-size: 12px; cursor: pointer; color: var(--ink); white-space: normal; max-width: 100%; text-align: left; }
.ai-panel-input-row { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid rgba(20,24,26,0.08); flex-shrink: 0; }
.ai-panel-input-row input { flex: 1; min-width: 0; border: 1px solid rgba(20,24,26,0.15); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-family: inherit; }
.ai-panel-send-btn { background: var(--rust); color: #fff; border: none; border-radius: 10px; padding: 0 16px; font-weight: 700; cursor: pointer; }
.ai-panel-send-btn:disabled { opacity: 0.5; cursor: default; }
.ai-panel-mic-btn { background: #fff; border: 1px solid rgba(20,24,26,0.15); border-radius: 10px; width: 40px; font-size: 16px; cursor: pointer; flex-shrink: 0; }
.ai-panel-mic-btn.listening { background: #fdecea; border-color: #e74c3c; animation: ai-mic-pulse 1.2s infinite; }
@keyframes ai-mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.4); } 50% { box-shadow: 0 0 0 6px rgba(231,76,60,0); } }
.ai-panel-attach-btn { background: #fff; border: 1px solid rgba(20,24,26,0.15); border-radius: 10px; width: 40px; font-size: 16px; cursor: pointer; flex-shrink: 0; }
.ai-panel-attachment { display: flex; align-items: center; gap: 8px; padding: 8px 18px; border-top: 1px solid rgba(20,24,26,0.08); font-size: 12.5px; color: var(--muted); flex-shrink: 0; }
.ai-panel-attachment img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; }
.ai-panel-attachment button { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) {
    .ai-panel { width: 100vw; }
}
.ts-rule-editor { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(20,24,26,0.15); }
