/* Tahiti Pass v5 — Mobile-first */
*, *::before, *::after { box-sizing: border-box; }

.tp-block { font-family: inherit; width: 100%; }

/* Notices */
.tp-notice { padding: 12px 16px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.tp-ok  { background: #e6f4ef; color: #1f5c4a; border: 1px solid #b9e3d4; }
.tp-err { background: #fdecea; color: #8a2d20; border: 1px solid #f3c5be; }

/* En-tête */
.tp-event-header { margin-bottom: 16px; }
.tp-event-title  { margin: 0 0 6px; color: #8a8300; font-size: clamp(17px,4vw,24px); }
.tp-event-meta   { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: #555; }

/* Onglets */
.tp-tabs {
    display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-bottom: 2px solid #e2e2e2; margin-bottom: 18px; gap: 2px;
    scrollbar-width: none;
}
.tp-tabs::-webkit-scrollbar { display: none; }
.tp-tab-btn {
    flex-shrink: 0; background: none; border: none;
    border-bottom: 3px solid transparent; margin-bottom: -2px;
    padding: 10px 12px; font-size: 13px; cursor: pointer; color: #555;
    white-space: nowrap; transition: color .2s, border-color .2s;
}
.tp-tab-btn.active   { color: #8a8300; border-bottom-color: #e0623e; font-weight: 600; }
.tp-tab-btn:hover    { color: #8a8300; }
.tp-tab-danger       { color: #c0392b !important; }
.tp-tab-danger.active{ border-bottom-color: #c0392b !important; }
@media (max-width: 480px) {
    .tp-tab-lbl  { display: none; }
    .tp-tab-btn  { font-size: 20px; padding: 10px 10px; }
}

/* Contenu onglets */
.tp-tab-content         { display: none; }
.tp-tab-content.active  { display: block; }

/* Barre d'actions */
.tp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

/* Boutons */
.tp-btn {
    display: inline-block; border: none; border-radius: 6px;
    padding: 10px 16px; font-size: 14px; font-weight: 500; cursor: pointer;
    background: #8a8300; color: #fff; line-height: 1.4;
    transition: background .2s, transform .1s; -webkit-appearance: none;
}
.tp-btn:active:not(:disabled) { transform: scale(.96); }
.tp-btn:disabled { background: #aaa; cursor: not-allowed; }
.tp-btn:hover:not(:disabled) { background: #6b6600; }
.tp-btn-sm      { padding: 5px 11px; font-size: 12px; }
.tp-btn-primary { background: #e0623e; }
.tp-btn-primary:hover:not(:disabled) { background: #c44f2f; }
.tp-btn-blue    { background: #2c6fa8; }
.tp-btn-blue:hover:not(:disabled)    { background: #1e4f7a; }
.tp-btn-danger  { background: #e74c3c; }
.tp-btn-danger:hover:not(:disabled)  { background: #c0392b; }

/* Tableau */
.tp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tp-table { width: 100%; border-collapse: collapse; min-width: 380px; }
.tp-table th, .tp-table td { padding: 9px 11px; text-align: left; border-bottom: 1px solid #eee; font-size: 13px; }
.tp-table th { background: #f7f7f7; font-weight: 600; white-space: nowrap; }
/* Vue carte sur petits écrans */
@media (max-width: 560px) {
    .tp-table { min-width: unset; }
    .tp-table thead { display: none; }
    .tp-table tr { display: block; border: 1px solid #e2e2e2; border-radius: 8px; margin-bottom: 10px; padding: 6px; }
    .tp-table td { display: flex; justify-content: space-between; align-items: center; border: none; padding: 5px 8px; font-size: 13px; }
    .tp-table td::before { content: attr(data-label); font-weight: 600; color: #666; margin-right: 8px; flex-shrink: 0; }

    /* Exception : [tahiti_pass_verification] garde l'affichage en tableau classique
       même sur mobile, avec défilement horizontal si la largeur ne suffit pas —
       contrairement au mode "carte empilée" appliqué par défaut ci-dessus. */
    .tp-commandes-block .tp-table { min-width: 380px; }
    .tp-commandes-block .tp-table thead { display: table-header-group; }
    .tp-commandes-block .tp-table tr { display: table-row; border: none; margin-bottom: 0; padding: 0; }
    .tp-commandes-block .tp-table td { display: table-cell; border-bottom: 1px solid #eee; padding: 9px 11px; }
    .tp-commandes-block .tp-table td::before { content: none; }
}

/* Pilules statut */
.tp-pill { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tp-pill-paid    { background: #e6f4ef; color: #1f5c4a; }
.tp-pill-pending { background: #fff3cd; color: #8a6d1d; }

/* Scanner */
.tp-scanner-box { max-width: 440px; margin: 0 auto; }
.tp-hint        { font-size: 13px; color: #666; margin-bottom: 10px; }
.tp-qr-reader   { border-radius: 10px; overflow: hidden; margin: 10px 0; background: #000; min-height: 10px; }
.tp-scanner-btns{ display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

/* Résultat scan */
.tp-scan-result { margin: 12px auto; max-width: 420px; padding: 18px; border-radius: 10px; text-align: center; }
.tp-scan-icon   { font-size: 50px; margin-bottom: 8px; }
.tp-scan-name   { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.tp-scan-msg    { font-size: 13px; }
.tp-scan-valid  { background: #e6f4ef; color: #1f5c4a; border: 2px solid #1f5c4a; }
.tp-scan-used   { background: #fff3cd; color: #8a6d1d; border: 2px solid #8a6d1d; }
.tp-scan-invalid{ background: #fdecea; color: #8a2d20; border: 2px solid #8a2d20; }

/* Co-organisateurs */
.tp-add-org     { margin-top: 20px; }
.tp-label       { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.tp-add-org-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-select {
    flex: 1; min-width: 180px; padding: 10px 12px;
    border: 1px solid #ccc; border-radius: 6px; font-size: 14px; background: #fff;
}
.tp-org-feedback { margin-top: 10px; }
.tp-creator-badge {
    display: inline-block; background: #8a8300; color: #fff;
    font-size: 10px; padding: 2px 7px; border-radius: 20px; margin-left: 5px;
}
.tp-email { font-size: 12px; color: #666; word-break: break-all; }

/* Zone danger */
.tp-danger-zone { border: 2px solid #e74c3c; border-radius: 10px; padding: 20px; max-width: 540px; }
.tp-danger-zone h3 { color: #c0392b; margin-top: 0; }
.tp-danger-zone ul { padding-left: 18px; margin-bottom: 14px; }
.tp-danger-zone li { margin-bottom: 5px; font-size: 14px; }
.tp-input {
    width: 100%; padding: 10px 12px; border: 2px solid #ccc;
    border-radius: 6px; font-size: 14px; margin-top: 8px;
}
.tp-input:focus { border-color: #e74c3c; outline: none; }
.tp-delete-actions { margin-top: 14px; }
.tp-delete-fb { margin-top: 10px; }

/* Commande */
.tp-commande-card { border: 1px solid #e2e2e2; border-radius: 10px; padding: 20px; max-width: 500px; margin-bottom: 24px; }
.tp-commande:last-child .tp-commande-card { margin-bottom: 0; }
.tp-commande-card h2 { margin-top: 0; color: #8a8300; }
.tp-price       { font-size: 17px; margin: 6px 0; }
.tp-user-line   { font-size: 14px; color: #555; }
.tp-info-text   { font-size: 13px; color: #666; margin-bottom: 18px; }
.tp-order-fb    { margin-top: 12px; }

/* Mes billets */
.tp-tickets-list { margin-top: 10px; }
.tp-loading { color: #888; font-style: italic; }
.tp-ticket-card {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
    border: 1px solid #e2e2e2; border-radius: 10px; padding: 18px;
    margin-bottom: 14px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.tp-ticket-info { flex: 1; min-width: 180px; }
.tp-ticket-info h3 { margin: 0 0 6px; color: #8a8300; font-size: 17px; }
.tp-ticket-info p  { margin: 3px 0; font-size: 13px; color: #444; }
.tp-ticket-qr   { text-align: center; flex-shrink: 0; }
.tp-qr-hint     { font-size: 11px; color: #888; margin-top: 5px; }
.tp-badge-valid { display:inline-block; margin-top:7px; padding:4px 11px; background:#e6f4ef; color:#1f5c4a; border-radius:20px; font-size:12px; font-weight:600; }
.tp-badge-used  { display:inline-block; margin-top:7px; padding:4px 11px; background:#f0f0f0; color:#777; border-radius:20px; font-size:12px; }
@media (max-width: 460px) {
    .tp-ticket-card   { flex-direction: column; text-align: center; padding: 14px; }
    .tp-ticket-info   { min-width: unset; width: 100%; }
    .tp-commande-card { padding: 14px; }
    .tp-danger-zone   { padding: 14px; }
    .tp-add-org-row   { flex-direction: column; }
    .tp-select        { width: 100%; }
    .tp-scanner-btns  { flex-direction: column; align-items: center; }
    .tp-btn           { width: 100%; text-align: center; }
    .tp-actions .tp-btn { width: auto; }
}

/* ── v8 : blocs organisateur indépendants ── */
.tp-commandes-block, .tp-scanner-block, .tp-coorg-block, .tp-supprimer-block {
    margin-bottom: 24px;
}

/* Bouton imprimer billet individuel (Mes Billets) */
.tp-print-ticket-btn {
    background: #1a0404;
    width: 100%;
}
.tp-print-ticket-btn:hover:not(:disabled) { background: #330808; }
@media (max-width: 460px) {
    .tp-print-ticket-btn { width: auto; }
}

/* ── v9 : bloc auto-généré tous-événements ── */
.tp-event-group { margin-bottom: 12px; }
.tp-event-separator {
    border: none;
    border-top: 2px dashed #ddd;
    margin: 36px 0;
}
.tp-notice-info {
    background: #eef6fb;
    color: #2c6fa8;
    border: 1px solid #c3e0f0;
}

/* ── v10 : sélecteur d'événement multi-blocs (Commandes sans event=) ── */
.tp-events-selector-wrap { width: 100%; }
.tp-event-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.tp-event-pick-btn {
    background: #f0f0f0;
    color: #444;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: all .15s ease;
}
.tp-event-pick-btn:hover { background: #e6e6e6; }
.tp-event-pick-btn.active {
    background: #8a8300;
    color: #fff;
    border-color: #6b6600;
}
.tp-event-pick-date {
    display: block;
    font-size: 11px;
    opacity: .8;
    margin-top: 2px;
}
.tp-commandes-wrapper { width: 100%; }

/* Placeholder des blocs dynamiques (Scanner/Co-org/Supprimer sans event=) */
.tp-dynamic-block { padding: 4px 0; }
.tp-dynamic-block .tp-hint { font-style: italic; color: #888; }

@media (max-width: 480px) {
    .tp-event-picker { flex-direction: column; }
    .tp-event-pick-btn { width: 100%; }
}

/* ── v12 : créer un événement (front) + compteur participants ── */
.tp-creer-evenement-block {
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 24px;
    width: 100%;
    max-width: 480px;
}
.tp-creer-evenement-block h2 { margin-top: 0; color: #8a8300; }
.tp-form-row { margin-bottom: 14px; width: 100%; }
.tp-form-row .tp-input { margin-top: 6px; }

.tp-participants-count {
    margin-left: auto;
    font-size: 13px;
    color: #555;
    font-weight: 600;
    padding: 8px 0;
}
.tp-actions { align-items: center; }

.tp-event-pick-count {
    font-size: 11px;
    opacity: .85;
    margin-left: 2px;
}

@media (max-width: 480px) {
    .tp-creer-evenement-block { padding: 14px; }
    .tp-participants-count { margin-left: 0; width: 100%; }
}

/* En-dessous de 360px (très petits téléphones), encore un peu plus compact */
@media (max-width: 360px) {
    .tp-creer-evenement-block { padding: 12px; }
    .tp-input { padding: 9px 10px; font-size: 13px; }
}

/* ── v13 : paiement Wero/PayPal + événement gratuit + approbation ── */
.tp-checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.tp-checkbox-row input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

.tp-optional { font-size: 12px; color: #999; font-weight: normal; }
.tp-ce-paid-fields { border-top: 1px solid #eee; padding-top: 14px; margin-top: 4px; }

.tp-price-free { color: #8a8300; font-weight: 600; }

.tp-payment-options {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #ddd;
}
.tp-payment-title { font-size: 14px; font-weight: 600; color: #444; margin-bottom: 10px; }
.tp-payment-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.tp-pay-paypal {
    background: #003087;
    text-decoration: none;
    display: inline-block;
}
.tp-pay-paypal:hover { background: #001f5c; color: #fff; }
.tp-pay-wero {
    background: #6b2fb3;
}
.tp-pay-wero:hover { background: #51237f; }

@media (max-width: 480px) {
    .tp-payment-buttons { flex-direction: column; }
    .tp-payment-buttons .tp-btn { width: 100%; text-align: center; }
}

/* ── v15 : heure, image, description, lieu/Google Maps, créateur ── */

/* Formulaire création : date + heure côte à côte */
.tp-form-row-half {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    width: 100%;
}
.tp-form-row-half > div {
    flex: 1;
    min-width: 0; /* autorise le rétrécissement sous la largeur native des champs date/heure */
}
.tp-form-row-half .tp-label { display: block; margin-bottom: 6px; }
.tp-form-row-half input[type="date"],
.tp-form-row-half input[type="time"] {
    width: 100%;
    max-width: 100%;
}

/* Compteur de caractères description */
.tp-char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin: 4px 0 0;
}
textarea.tp-input { resize: vertical; font-family: inherit; }

/* Bannière image dans la carte de réservation */
.tp-commande-banner {
    margin: -20px -20px 16px;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}
.tp-commande-banner img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Métadonnées événement (date, heure, créateur) */
.tp-commande-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 8px 0 14px;
    font-size: 13px;
    color: #555;
}
.tp-meta-item { white-space: nowrap; }

/* Description */
.tp-commande-description {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #faf9f5;
    border-radius: 8px;
    border-left: 3px solid #8a8300;
}

/* Bouton Google Maps */
.tp-btn-maps {
    display: inline-block;
    background: #fff;
    color: #444;
    border: 1px solid #ddd;
    text-decoration: none;
    margin-bottom: 16px;
    font-size: 13px;
}
.tp-btn-maps:hover {
    background: #f5f5f5;
    color: #444;
    border-color: #ccc;
}

@media (max-width: 480px) {
    .tp-form-row-half { flex-direction: column; gap: 14px; margin-bottom: 0; }
    .tp-commande-banner { margin: -14px -14px 14px; }
    .tp-commande-banner img { height: 160px; }
    .tp-commande-meta { gap: 8px; }
}
