/* ══════════════════════════════════════════════════════════════
   STRIPE — payment form, invoices, status badges
   ══════════════════════════════════════════════════════════════ */

/* ── Status badges ─────────────────────────────────────────── */
.lr-portal__sub-badge--pastdue   { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.lr-portal__sub-badge--cancelling{ background: #fff3cd; color: #856404; border: 1px solid #ffc107; }

/* ── Past-due alert banner ─────────────────────────────────── */
.lr-portal__sub-alert {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.92em;
    line-height: 1.5;
}
.lr-portal__sub-alert--warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #664d03;
}

/* ── Cancel button ─────────────────────────────────────────── */
.lr-leads__btn--danger-outline {
    background: transparent;
    border: 1.5px solid #e53e3e;
    color: #e53e3e;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.15s, color 0.15s;
}
.lr-leads__btn--danger-outline:hover {
    background: #e53e3e;
    color: #fff;
}

.lr-portal__sub-actions { margin-top: 20px; }
.lr-portal__sub-cancel-hint {
    font-size: 0.82em;
    color: #666;
    margin: 6px 0 0;
}
.lr-portal__sub-cancel-hint--active {
    background: #fff3cd;
    border-radius: 6px;
    padding: 8px 12px;
    color: #856404;
    font-size: 0.88em;
    margin-top: 16px;
}

/* ── Stripe payment form ─────────────────────────────────────── */
.lr-portal__stripe-form {
    margin-top: 20px;
    max-width: 420px;
}

.lr-portal__card-element {
    background: #f8f9fa;
    border: 1.5px solid #dee2e6;
    border-radius: 8px;
    padding: 14px 16px;
    transition: border-color 0.15s;
}
.lr-portal__card-element:focus-within {
    border-color: var(--lr-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.lr-portal__card-errors {
    color: #e53e3e;
    font-size: 0.875em;
    min-height: 20px;
    margin: 8px 0 4px;
}

.lr-portal__stripe-submit {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ── Spinner ────────────────────────────────────────────────── */
.lr-portal__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lr-spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes lr-spin {
    to { transform: rotate(360deg); }
}

/* ── Invoices card ──────────────────────────────────────────── */
.lr-portal__invoices-card { margin-top: 16px; }

.lr-portal__invoices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
}
.lr-portal__invoices-table th,
.lr-portal__invoices-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
.lr-portal__invoices-table th {
    font-weight: 600;
    color: #555;
    background: #fafafa;
}

.lr-portal__invoice-paid   { color: #22863a; font-weight: 500; }
.lr-portal__invoice-unpaid { color: #e53e3e; font-weight: 500; }

.lr-portal__invoice-link {
    color: var(--lr-primary, #3b82f6);
    text-decoration: none;
    font-size: 0.85em;
}
.lr-portal__invoice-link:hover { text-decoration: underline; }

.lr-portal__invoices-loading,
.lr-portal__invoices-empty {
    color: #888;
    font-size: 0.9em;
    padding: 8px 0;
}

/* ── Traités: editable fields section ───────────────────────── */

.lr-leads__editable-section {
    padding: 12px 0 4px;
}

.lr-leads__editable-row {
    margin-bottom: 6px;
}

.lr-leads__editable-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.lr-leads__editable-label {
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.lr-leads__editable-current {
    display: block;
    font-size: 0.92em;
    color: #1e293b;
    margin-bottom: 2px;
    min-height: 1.2em;
}

.lr-leads__editable-empty {
    color: #94a3b8;
    font-style: normal;
}

/* Ghost button variant for edit toggle */
.lr-leads__btn--ghost {
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 3px 10px;
    font-size: 0.78em;
    gap: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lr-leads__btn--ghost svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}
.lr-leads__btn--ghost:hover,
.lr-leads__edit-toggle--open {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

/* Edit form */
.lr-leads__edit-form {
    display: none;
    margin-top: 8px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.lr-leads__edit-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9em;
    color: #1e293b;
    background: #fff;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}
.lr-leads__edit-input:focus {
    outline: none;
    border-color: var(--lr-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.lr-leads__btn-row--compact {
    gap: 6px;
}

/* ── Traités: modification log accordion ────────────────────── */

.lr-leads__log-accordion {
    margin-top: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.lr-leads__log-summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    font-size: 0.82em;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    user-select: none;
    background: #f8fafc;
    transition: background 0.15s;
}
.lr-leads__log-summary::-webkit-details-marker { display: none; }
.lr-leads__log-summary::before {
    content: '▶';
    font-size: 0.65em;
    color: #94a3b8;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.lr-leads__log-accordion[open] .lr-leads__log-summary {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}
.lr-leads__log-accordion[open] .lr-leads__log-summary::before {
    transform: rotate(90deg);
}
.lr-leads__log-summary:hover { background: #f1f5f9; }

.lr-leads__log-summary svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: #64748b;
}

.lr-leads__log-count {
    margin-left: auto;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.88em;
    font-weight: 600;
    border-radius: 10px;
    padding: 1px 7px;
    min-width: 20px;
    text-align: center;
}

.lr-leads__log-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: lr-log-counter;
}

.lr-leads__log-entry {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.83em;
    counter-increment: lr-log-counter;
    position: relative;
    padding-left: 38px;
}
.lr-leads__log-entry:last-child { border-bottom: none; }
.lr-leads__log-entry::before {
    content: counter(lr-log-counter);
    position: absolute;
    left: 12px;
    top: 11px;
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    font-size: 0.78em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 18px;
    text-align: center;
}

.lr-leads__log-meta {
    color: #475569;
    line-height: 1.4;
}
.lr-leads__log-meta strong {
    color: #1e293b;
}

.lr-leads__log-detail {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    color: #64748b;
}

.lr-leads__log-detail svg {
    width: 14px;
    height: 7px;
    flex-shrink: 0;
    color: #94a3b8;
}

.lr-leads__log-field {
    font-weight: 600;
    color: #374151;
    margin-right: 2px;
}

.lr-leads__log-old {
    background: #fee2e2;
    color: #991b1b;
    padding: 1px 6px;
    border-radius: 4px;
    text-decoration: line-through;
    font-size: 0.93em;
}

.lr-leads__log-new {
    background: #d1fae5;
    color: #065f46;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.93em;
    font-weight: 500;
}

/* ── Notification zone tag input ──────────────────────────────── */
.lr-zone-input-wrap {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 6px 8px;
    cursor: text;
}

.lr-zone-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 36px;
}

.lr-zone-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 3px 10px 3px 12px;
    font-size: 0.88em;
    font-weight: 500;
    white-space: nowrap;
}

.lr-zone-tag__remove {
    background: none;
    border: none;
    color: #93c5fd;
    font-size: 1.1em;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    margin-left: 2px;
}

.lr-zone-tag__remove:hover {
    color: #1d4ed8;
}

.lr-zone-input__field {
    border: none;
    outline: none;
    flex: 1;
    min-width: 140px;
    font-size: 0.95em;
    padding: 4px 4px;
    background: transparent;
    color: #1a1a1a;
}

.lr-zone-save-ok  { color: #065f46; font-size: 0.9em; }
.lr-zone-save-err { color: #991b1b; font-size: 0.9em; }

/* ── Traités: notes section ─────────────────────────────────── */

.lr-leads__notes-section {
    padding: 4px 0 8px;
}

.lr-leads__notes-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.lr-leads__notes-form {
    display: none;
    margin-bottom: 10px;
    padding: 0 5px;
}

.lr-leads__notes-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.lr-leads__notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 5px 5px 0;
}

.lr-leads__note-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
}

.lr-leads__note-meta {
    display: block;
    font-size: 0.78em;
    color: #64748b;
    margin-bottom: 4px;
}

.lr-leads__note-text {
    margin: 0;
    font-size: 0.92em;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
}

/* admin zone badge */
.lr-admin__badge--zone {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-size: 0.78em;
    padding: 2px 7px;
    border-radius: 20px;
    margin-right: 3px;
    display: inline-block;
}
