/**
 * CSS-ShareHub Console — Frontend styles
 * Design aligned with risquespsychosociaux.ca brand
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

.cssh-app {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1A1A1A;
    background: #FFFBF5;
    min-height: 100vh;
    padding: 0;
    margin: 0 auto;
    max-width: 1400px;
    line-height: 1.5;
}

/* ═══ HEADER ═══════════════════════════════════════════════════ */
.cssh-header {
    background: linear-gradient(135deg, #1B4332 0%, #40916C 100%);
    color: white;
    padding: 24px 32px;
    border-radius: 0 0 24px 24px;
    margin-bottom: 24px;
}
.cssh-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1340px;
    margin: 0 auto;
}
.cssh-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}
.cssh-logo svg {
    background: white;
    border-radius: 50%;
    padding: 4px;
}
.cssh-brand {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.3px;
}
.cssh-tagline {
    font-size: 12px;
    opacity: .8;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cssh-user {
    font-size: 14px;
    opacity: .9;
}

/* ═══ MANDAT BAR ══════════════════════════════════════════════ */
.cssh-mandat-bar {
    background: white;
    margin: 0 24px 24px;
    padding: 20px 28px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,.05);
    border-left: 5px solid #40916C;
}
.cssh-mandat-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.cssh-mandat-content > label {
    font-size: 12px;
    font-weight: 700;
    color: #1B4332;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.cssh-select-large {
    flex: 1;
    min-width: 280px;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    background: white;
    cursor: pointer;
}
.cssh-select-large:focus {
    border-color: #40916C;
    outline: none;
}
.cssh-mandat-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cssh-pill {
    display: inline-block;
    padding: 4px 10px;
    background: #ECFDF5;
    color: #065F46;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cssh-mandat-date {
    font-size: 13px;
    color: #6B7280;
}

/* ═══ MAIN GRID ═══════════════════════════════════════════════ */
.cssh-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    padding: 0 24px 40px;
}
@media (max-width: 1024px) {
    .cssh-grid { grid-template-columns: 1fr; }
}

/* ═══ CARDS ═══════════════════════════════════════════════════ */
.cssh-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
    margin-bottom: 20px;
    border: 1px solid rgba(229,231,235,.6);
}
.cssh-card-compact { padding: 20px; }
.cssh-card-action {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border: none;
}
.cssh-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.cssh-card-header h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: #1B4332;
}
.cssh-card-header h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: #1B4332;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cssh-card-action h2 { font-size: 22px; }
.cssh-card-action p { color: #065F46; margin: 4px 0 18px; }

/* ═══ BUTTONS ═════════════════════════════════════════════════ */
.cssh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}
.cssh-btn-primary {
    background: #1B4332;
    color: white;
}
.cssh-btn-primary:hover {
    background: #2D6A4F;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(27,67,50,.3);
}
.cssh-btn-secondary {
    background: white;
    color: #1B4332;
    border: 2px solid #1B4332;
}
.cssh-btn-secondary:hover {
    background: #ECFDF5;
}
.cssh-btn-ghost {
    background: transparent;
    color: #6B7280;
    padding: 6px 12px;
}
.cssh-btn-ghost:hover {
    background: #F3F4F6;
    color: #1B4332;
}
.cssh-btn-hero {
    padding: 18px 36px;
    font-size: 16px;
    border-radius: 12px;
}
.cssh-btn-block { width: 100%; margin-top: 12px; }
.cssh-btn-sm { font-size: 12px; padding: 6px 12px; }

/* ═══ SUMMARY (sidebar) ═══════════════════════════════════════ */
.cssh-summary {
    font-size: 14px;
    color: #4B5563;
}
.cssh-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
}
.cssh-summary-item:last-child { border-bottom: none; }
.cssh-summary-name { font-weight: 600; color: #1F2937; }
.cssh-summary-meta { font-size: 12px; color: #9CA3AF; }
.cssh-loading-sm,
.cssh-loading {
    text-align: center;
    padding: 20px;
    color: #9CA3AF;
    font-size: 13px;
}
.cssh-empty {
    text-align: center;
    padding: 24px 12px;
    color: #9CA3AF;
}

/* ═══ SENDS LIST ══════════════════════════════════════════════ */
.cssh-sends-list { display: flex; flex-direction: column; gap: 12px; }
.cssh-send-item {
    background: #FAFBFC;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}
.cssh-send-name { font-weight: 700; font-size: 15px; color: #1F2937; }
.cssh-send-meta { font-size: 12px; color: #6B7280; margin-top: 2px; }
.cssh-send-progress {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 12px;
}
.cssh-send-stat strong {
    display: block;
    font-size: 18px;
    color: #1B4332;
}
.cssh-send-actions { display: flex; flex-direction: column; gap: 6px; }
.cssh-send-actions .cssh-btn { font-size: 12px; padding: 6px 12px; }

/* ═══ MODALS ══════════════════════════════════════════════════ */
.cssh-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cssh-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.6);
    backdrop-filter: blur(4px);
}
.cssh-modal-dialog {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.cssh-modal-large { max-width: 900px; }
.cssh-modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.cssh-modal-header h2 { font-size: 20px; font-weight: 800; margin: 0; color: #1B4332; }
.cssh-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #9CA3AF;
    line-height: 1;
}
.cssh-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}
.cssh-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
}

/* ═══ STEPPER ═════════════════════════════════════════════════ */
.cssh-stepper {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cssh-step {
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
    padding: 4px 10px;
    background: #F3F4F6;
    border-radius: 12px;
}
.cssh-step.active {
    background: #1B4332;
    color: white;
}
.cssh-step.done {
    background: #10B981;
    color: white;
}

/* ═══ TABS ════════════════════════════════════════════════════ */
.cssh-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #E5E7EB;
    margin-bottom: 20px;
}
.cssh-tab {
    background: none;
    border: none;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.cssh-tab.active {
    color: #1B4332;
    border-bottom-color: #1B4332;
}
.cssh-tab-content { display: none; }
.cssh-tab-content.active { display: block; }

/* ═══ BUNDLES GRID ════════════════════════════════════════════ */
.cssh-bundles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.cssh-bundle-card {
    background: #FAFBFC;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: all .2s;
}
.cssh-bundle-card:hover {
    border-color: #40916C;
    transform: translateY(-2px);
}
.cssh-bundle-card.selected {
    border-color: #1B4332;
    background: #ECFDF5;
}
.cssh-bundle-card h4 { font-size: 16px; margin: 0 0 8px; color: #1B4332; }
.cssh-bundle-card .desc { font-size: 13px; color: #6B7280; margin-bottom: 12px; }
.cssh-bundle-card .meta { font-size: 12px; color: #9CA3AF; }

/* ═══ PAGES LIST ══════════════════════════════════════════════ */
.cssh-pages-list { max-height: 50vh; overflow-y: auto; }
.cssh-pages-cat { margin-bottom: 20px; }
.cssh-pages-cat-label {
    font-size: 12px;
    font-weight: 800;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}
.cssh-page-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    gap: 12px;
}
.cssh-page-row:hover { background: #F9FAFB; }
.cssh-page-row input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.cssh-page-row label { flex: 1; cursor: pointer; font-size: 14px; }
.cssh-page-row code { font-size: 11px; color: #9CA3AF; }

/* ═══ LISTS SELECTOR ══════════════════════════════════════════ */
.cssh-lists-selector { display: flex; flex-direction: column; gap: 8px; }
.cssh-list-row {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    cursor: pointer;
    gap: 14px;
}
.cssh-list-row:hover { border-color: #40916C; background: #F9FAFB; }
.cssh-list-row.selected { border-color: #1B4332; background: #ECFDF5; }
.cssh-list-row input { width: 18px; height: 18px; }
.cssh-list-row .info { flex: 1; }
.cssh-list-row .info-name { font-weight: 700; font-size: 15px; }
.cssh-list-row .info-meta { font-size: 12px; color: #6B7280; margin-top: 2px; }
.cssh-list-row .count {
    background: #1B4332;
    color: white;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}

.cssh-divider {
    text-align: center;
    margin: 20px 0;
    color: #9CA3AF;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
}

/* ═══ FORM ═══════════════════════════════════════════════════ */
.cssh-form-row { margin-bottom: 18px; }
.cssh-form-row label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: #1F2937;
    margin-bottom: 6px;
}
.cssh-form-row input[type="text"],
.cssh-form-row input[type="number"],
.cssh-form-row input[type="email"],
.cssh-form-row input[type="file"],
.cssh-form-row select,
.cssh-form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}
.cssh-form-row textarea { font-family: 'Courier New', monospace; }
.cssh-form-row input:focus, .cssh-form-row textarea:focus, .cssh-form-row select:focus {
    border-color: #40916C;
    outline: none;
}
.cssh-help {
    font-size: 12px;
    color: #6B7280;
    margin-top: 4px;
}
.cssh-help code {
    background: #F3F4F6;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: #E85D04;
}

.cssh-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #1B4332;
    margin-bottom: 14px;
}

/* ═══ PREVIEW ═════════════════════════════════════════════════ */
.cssh-preview-area {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}
.cssh-preview-area h4 { font-size: 13px; margin: 0 0 10px; color: #6B7280; }
.cssh-email-preview {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: #1F2937;
}

/* ═══ RECAP ═══════════════════════════════════════════════════ */
.cssh-recap {
    background: #ECFDF5;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.cssh-recap-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(16,185,129,.2);
}
.cssh-recap-row:last-child { border-bottom: none; }
.cssh-recap-row span { color: #065F46; font-weight: 600; }
.cssh-recap-row strong { color: #1B4332; }
.cssh-send-action { text-align: center; }

/* ═══ IMPORT RESULT ═══════════════════════════════════════════ */
.cssh-import-result {
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
}
.cssh-import-result.success {
    background: #ECFDF5;
    border: 1px solid #10B981;
    color: #065F46;
}
.cssh-import-result.error {
    background: #FEF2F2;
    border: 1px solid #EF4444;
    color: #991B1B;
}

/* ═══════════════════════════════════════════════════════════════ */
/* v3.3.0 — WORKFLOW INLINE (sans modal d'envoi)                  */
/* ═══════════════════════════════════════════════════════════════ */

.cssh-workflow {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
    border: 1px solid rgba(229,231,235,.6);
}

.cssh-workflow-title {
    font-size: 24px;
    font-weight: 800;
    color: #1B4332;
    margin: 0 0 4px;
}

.cssh-workflow-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 28px;
}

.cssh-section-block {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 20px;
    padding: 24px 0;
    border-top: 1px solid #F3F4F6;
    position: relative;
}
.cssh-section-block:first-of-type {
    border-top: none;
    padding-top: 0;
}

.cssh-section-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ECFDF5;
    color: #1B4332;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}
.cssh-section-block.cssh-completed .cssh-section-num {
    background: #1B4332;
    color: white;
}
.cssh-section-recap .cssh-section-num {
    background: linear-gradient(135deg, #1B4332, #40916C);
    color: white;
    font-size: 22px;
}

.cssh-section-content h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1B4332;
    margin: 0 0 16px;
}

.cssh-section-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin: 0 0 12px;
}

.cssh-section-status {
    margin-top: 14px;
    padding: 10px 14px;
    background: #F9FAFB;
    border-radius: 8px;
    font-size: 13px;
}
.cssh-status-empty {
    color: #9CA3AF;
}
.cssh-status-ok {
    color: #065F46;
    font-weight: 600;
}
.cssh-status-ok::before {
    content: '✅ ';
}

/* Tabs (réutilisé) */
.cssh-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #F3F4F6;
    margin-bottom: 16px;
}
.cssh-tab {
    background: none;
    border: none;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}
.cssh-tab:hover { color: #1B4332; }
.cssh-tab.active {
    color: #1B4332;
    border-bottom-color: #1B4332;
}
.cssh-tab-pane:not(.cssh-tab-pane-active) { display: none; }

/* Bundles grid */
.cssh-bundles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.cssh-bundle-card {
    background: #FAFBFC;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all .2s;
}
.cssh-bundle-card:hover {
    border-color: #40916C;
    transform: translateY(-1px);
}
.cssh-bundle-card.selected {
    border-color: #1B4332;
    background: #ECFDF5;
}
.cssh-bundle-card h4 {
    font-size: 14px;
    margin: 0 0 6px;
    color: #1B4332;
}
.cssh-bundle-card .desc {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 8px;
    line-height: 1.4;
    min-height: 32px;
}
.cssh-bundle-card .meta {
    font-size: 11px;
    color: #9CA3AF;
}

/* Pages list */
.cssh-pages-list {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px;
}
.cssh-pages-cat {
    margin-bottom: 16px;
}
.cssh-pages-cat:last-child { margin-bottom: 0; }
.cssh-pages-cat-label {
    font-size: 11px;
    font-weight: 800;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}
.cssh-page-row {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    gap: 10px;
}
.cssh-page-row:hover {
    background: #F9FAFB;
}
.cssh-page-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
.cssh-page-row label {
    flex: 1;
    cursor: pointer;
    font-size: 13px;
    color: #1F2937;
}
.cssh-page-row code {
    font-size: 10px;
    color: #9CA3AF;
}

/* Save-as-bundle CTA */
.cssh-save-bundle-cta {
    margin-top: 16px;
    padding: 12px;
    background: #FEF3C7;
    border-radius: 8px;
    border: 1px dashed #F59E0B;
    text-align: center;
}

/* Lists selector */
.cssh-lists-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
}
.cssh-list-row {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    gap: 12px;
    transition: all .15s;
}
.cssh-list-row:hover {
    border-color: #40916C;
    background: #F9FAFB;
}
.cssh-list-row.selected {
    border-color: #1B4332;
    background: #ECFDF5;
}
.cssh-list-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}
.cssh-list-row .info {
    flex: 1;
    min-width: 0;
}
.cssh-list-row .info-name {
    font-weight: 600;
    font-size: 14px;
    color: #1F2937;
}
.cssh-list-row .info-meta {
    font-size: 11px;
    color: #6B7280;
    margin-top: 2px;
}
.cssh-list-row .count {
    background: #1B4332;
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.cssh-divider-or {
    text-align: center;
    margin: 16px 0;
    color: #9CA3AF;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

/* Message section grid */
.cssh-message-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}
@media (max-width: 800px) {
    .cssh-message-grid {
        grid-template-columns: 1fr;
    }
}

.cssh-preview-pane {
    background: #F9FAFB;
    border-radius: 10px;
    padding: 16px;
    border: 1px solid #E5E7EB;
    align-self: stretch;
}
.cssh-preview-pane h4 {
    font-size: 12px;
    font-weight: 700;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px;
}
.cssh-email-preview {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    color: #1F2937;
    line-height: 1.6;
    min-height: 200px;
    max-height: 380px;
    overflow-y: auto;
}

/* Recap */
.cssh-section-recap {
    background: linear-gradient(135deg, #ECFDF5 0%, #F0FDF4 100%);
    margin: 24px -32px -32px;
    padding: 32px;
    border-radius: 0 0 16px 16px;
    border-top: 1px solid rgba(16,185,129,.2);
}
.cssh-recap-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.cssh-recap-card {
    background: white;
    border-radius: 14px;
    padding: 16px 24px;
    text-align: center;
    border: 2px solid #D1FAE5;
    min-width: 110px;
    transition: all .25s;
}
.cssh-recap-card.cssh-recap-total {
    background: #1B4332;
    color: white;
    border-color: #1B4332;
    transform: scale(1.05);
}
.cssh-recap-icon {
    font-size: 22px;
    margin-bottom: 4px;
}
.cssh-recap-num {
    font-size: 32px;
    font-weight: 900;
    color: #1B4332;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.cssh-recap-card.cssh-recap-total .cssh-recap-num {
    color: white;
}
.cssh-recap-label {
    font-size: 11px;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    margin-top: 4px;
}
.cssh-recap-card.cssh-recap-total .cssh-recap-label {
    color: rgba(255,255,255,0.8);
}
.cssh-recap-mult {
    font-size: 22px;
    font-weight: 800;
    color: #6B7280;
}

.cssh-recap-details {
    background: white;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 12px 0;
    font-size: 13px;
    color: #4B5563;
    line-height: 1.7;
    display: none;
}
.cssh-recap-details:not(:empty) {
    display: block;
}

.cssh-btn-mega {
    display: block;
    width: 100%;
    max-width: 480px;
    margin: 20px auto 8px;
    padding: 18px 28px !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    background: #1B4332 !important;
    color: white !important;
    border: none !important;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(27,67,50,.3);
}
.cssh-btn-mega:not(:disabled):hover {
    background: #2D6A4F !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(27,67,50,.4);
}
.cssh-btn-mega:disabled {
    background: #D1D5DB !important;
    color: #6B7280 !important;
    cursor: not-allowed;
    box-shadow: none;
}
.cssh-send-note {
    text-align: center;
    font-size: 12px;
    color: #6B7280;
    margin: 8px 0 0;
}
.cssh-send-note.cssh-send-note-ready {
    color: #065F46;
    font-weight: 600;
}

/* Recent sends section */
.cssh-recent-section {
    background: white;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
    border: 1px solid rgba(229,231,235,.6);
}
.cssh-recent-section .cssh-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.cssh-recent-section h2 {
    font-size: 18px;
    font-weight: 800;
    color: #1B4332;
    margin: 0;
}


/* ═══════════════════════════════════════════════════════════════ */
/* v3.4.0 — Bundle card actions (edit/delete)                      */
/* ═══════════════════════════════════════════════════════════════ */

.cssh-bundle-card {
    position: relative;
}

.cssh-bundle-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.cssh-bundle-card:hover .cssh-bundle-card-actions {
    opacity: 1;
}

.cssh-bundle-card-actions button {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-family: inherit;
}

.cssh-bundle-card-actions button:hover {
    background: white;
    border-color: #1B4332;
    transform: scale(1.05);
}

.cssh-bundle-card-actions .cssh-bundle-delete:hover {
    border-color: #EF4444;
    background: #FEF2F2;
}


/* ═══════════════════════════════════════════════════════════════ */
/* v3.4.0 — Editor toggle (text/visual)                            */
/* ═══════════════════════════════════════════════════════════════ */

.cssh-editor-toggle {
    display: inline-flex;
    background: #F3F4F6;
    border-radius: 6px;
    padding: 2px;
}

.cssh-editor-tab {
    background: transparent;
    border: none;
    padding: 4px 10px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.cssh-editor-tab:hover {
    color: #1B4332;
}

.cssh-editor-tab.cssh-editor-tab-active {
    background: white;
    color: #1B4332;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#cssh-email-body-visual {
    margin-top: 8px;
}

#cssh-email-body-visual .wp-editor-container {
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
}

#cssh-email-body-visual .mce-toolbar-grp {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}


/* ═══════════════════════════════════════════════════════════════ */
/* v3.4.7 — Archive banner + bundles expirés                       */
/* ═══════════════════════════════════════════════════════════════ */

.cssh-archive-banner {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #92400E;
}
.cssh-archive-banner a {
    color: #1B4332;
    font-weight: 600;
    margin-left: 8px;
    text-decoration: underline;
}
.cssh-archive-banner a:hover {
    color: #2D6A4F;
}

.cssh-send-item.cssh-send-archived {
    opacity: 0.55;
    background: repeating-linear-gradient(
        45deg,
        #F9FAFB,
        #F9FAFB 10px,
        #F3F4F6 10px,
        #F3F4F6 20px
    );
}

.cssh-pill-archived {
    display: inline-block;
    background: #6B7280;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    vertical-align: middle;
}


/* ═══════════════════════════════════════════════════════════════ */
/* v3.4.9 — Archives section + delete buttons partout              */
/* ═══════════════════════════════════════════════════════════════ */

/* Bouton hide sur liste */
.cssh-list-hide {
    background: transparent;
    border: 1px solid transparent;
    color: #9CA3AF;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    margin-left: 6px;
    opacity: 0;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cssh-list-row:hover .cssh-list-hide {
    opacity: 1;
}
.cssh-list-hide:hover {
    background: #FEF2F2;
    border-color: #EF4444;
    color: #EF4444;
}

/* Bouton archive sur envoi récent */
.cssh-btn-archive-send {
    padding: 6px 10px !important;
    font-size: 13px !important;
    color: #9CA3AF !important;
    border-color: transparent !important;
    background: transparent !important;
    transition: all 0.15s !important;
}
.cssh-btn-archive-send:hover {
    background: #FEF2F2 !important;
    border-color: #EF4444 !important;
    color: #EF4444 !important;
}

/* Section Archives (collapsible) */
.cssh-archives-section {
    background: white;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
    border: 1px solid rgba(229,231,235,.6);
    overflow: hidden;
}

.cssh-archives-header {
    padding: 18px 28px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cssh-archives-header:hover {
    background: #F9FAFB;
}
.cssh-archives-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #1B4332;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cssh-archives-count {
    background: #6B7280;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 10px;
    line-height: 1;
}

.cssh-archives-arrow {
    font-size: 16px;
    color: #9CA3AF;
    transition: transform 0.2s;
}

.cssh-archives-content {
    padding: 0 28px 24px;
    border-top: 1px solid #F3F4F6;
}

.cssh-archives-help {
    font-size: 13px;
    color: #6B7280;
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    padding: 10px 14px;
    border-radius: 8px;
    margin: 16px 0;
}

.cssh-archives-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cssh-archive-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #FAFBFC;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    transition: all 0.15s;
}
.cssh-archive-item:hover {
    background: #F9FAFB;
    border-color: #1B4332;
}

.cssh-archive-name {
    font-weight: 700;
    color: #1B4332;
    font-size: 14px;
    margin-bottom: 4px;
}

.cssh-archive-meta {
    font-size: 12px;
    color: #6B7280;
}

.cssh-archive-actions {
    flex-shrink: 0;
}

.cssh-btn-restore {
    background: #10B981 !important;
    color: white !important;
    border-color: #10B981 !important;
    font-size: 13px !important;
    padding: 8px 14px !important;
}
.cssh-btn-restore:hover {
    background: #059669 !important;
    transform: translateY(-1px);
}


/* ═══════════════════════════════════════════════════════════════ */
/* v3.4.10 — Test mode toggle + visual                             */
/* ═══════════════════════════════════════════════════════════════ */

.cssh-test-mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #FEF3C7;
    border: 2px dashed #F59E0B;
    border-radius: 10px;
    margin: 14px 0;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    font-size: 13px;
}
.cssh-test-mode-toggle:hover {
    background: #FDE68A;
    border-color: #D97706;
}
.cssh-test-mode-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}
.cssh-test-mode-label {
    color: #92400E;
    font-weight: 600;
}

.cssh-btn-test-mode {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    border-color: #D97706 !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}
.cssh-btn-test-mode:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4) !important;
}


/* ═══════════════════════════════════════════════════════════════ */
/* v3.4.11 — Template save/update buttons + modal                  */
/* ═══════════════════════════════════════════════════════════════ */

.cssh-template-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #E5E7EB;
}

.cssh-template-dirty {
    margin-top: 12px;
    padding: 10px 14px;
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: 8px;
    color: #92400E;
    font-size: 13px;
}
.cssh-template-dirty strong {
    color: #78350F;
}

.cssh-btn-danger {
    color: #B91C1C !important;
}
.cssh-btn-danger:hover {
    background: #FEE2E2 !important;
    border-color: #DC2626 !important;
    color: #991B1B !important;
}

/* Modal de sauvegarde */
.cssh-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: cssh-fade-in 0.15s;
}
@keyframes cssh-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cssh-modal-content {
    background: white;
    border-radius: 14px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: cssh-modal-pop 0.2s ease-out;
}
@keyframes cssh-modal-pop {
    from { transform: translateY(20px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.cssh-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #F3F4F6;
}
.cssh-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #1B4332;
}

.cssh-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #9CA3AF;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: all 0.15s;
}
.cssh-modal-close:hover {
    background: #F3F4F6;
    color: #374151;
}

.cssh-modal-body {
    padding: 20px 24px;
}
.cssh-modal-body input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s;
}
.cssh-modal-body input[type="text"]:focus {
    border-color: #1B4332;
    outline: none;
}

.cssh-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    background: #FAFBFC;
    border-top: 1px solid #F3F4F6;
}


/* ═══════════════════════════════════════════════════════════════ */
/* v3.4.15 — Logout button + auth                                  */
/* ═══════════════════════════════════════════════════════════════ */

.cssh-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cssh-logout-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.cssh-logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

