:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --accent: #d4af37;
    --accent-hover: #e5c158;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Dark theme colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #151515;
    --bg-card: #1a1a1a;
    --bg-card-hover: #202020;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    
    --border: #2a2a2a;
    --border-light: rgba(255, 255, 255, 0.05);
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.6);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.7);
    
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Réserve l'espace scrollbar → même largeur sur toutes les pages */
html {
    scrollbar-gutter: stable;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    padding-top: 0;
    padding-bottom: 80px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(21, 21, 21, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    margin: 0 -1rem 1rem -1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.header-content {
    text-align: center;
    margin-bottom: 1rem;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 400;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.nav-link {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--accent);
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.nav-link.active {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
    border-color: var(--accent);
}

.nav-link i {
    margin-right: 0.5rem;
}

/* Dropdown menu */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    margin-top: 0.25rem;
    padding: 0.5rem;
    z-index: 1001;
}

/* Zone invisible pour maintenir le hover */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.25rem;
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-dropdown-item {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8125rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    white-space: nowrap;
    display: block;
}

.nav-dropdown-item:hover {
    color: var(--accent);
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.nav-dropdown-item.active {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
    border-color: var(--accent);
}

/* Dashboard */
.dashboard {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.stat-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    letter-spacing: -0.02em;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 1.5rem;
}

.quick-actions h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.action-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
}

.action-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.12);
}

.action-card:hover .action-icon {
    background: rgba(212, 175, 55, 0.12);
    color: var(--accent);
    border-color: var(--accent);
    transform: scale(1.05);
}

.action-card:hover h3 {
    color: var(--accent);
}

.action-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-card h3 {
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.action-card p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.4;
}

/* Recent Activity */
.recent-activity {
    margin-bottom: 1rem;
}

.recent-activity h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.activity-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
}

.activity-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-item:last-child {
    margin-bottom: 0;
}

.activity-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateX(4px);
}

.activity-icon {
    width: 36px;
    height: 36px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content h4 {
    margin-bottom: 0.125rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.activity-content p {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.3;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: var(--success);
    color: var(--text-primary);
}

.btn-success:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-primary);
}

.btn-danger:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--border-light);
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.625rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-secondary);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23a0a0a0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

select.form-control option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Mode selection options */
.mode-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    cursor: pointer;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    flex: 1;
    min-width: 220px;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s;
}

.mode-option-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.mode-option-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.2s;
}

.mode-option-text {
    flex: 1;
    min-width: 0;
}

.mode-option-text strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.mode-option-text small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.mode-option:hover {
    border-color: var(--accent);
    background: rgba(212, 175, 55, 0.08);
}

.mode-option:hover .mode-option-icon {
    background: rgba(212, 175, 55, 0.12);
    color: var(--accent);
    border-color: var(--accent);
}

.mode-option-active {
    border-color: var(--accent);
    background: rgba(212, 175, 55, 0.12);
}

.mode-option-active .mode-option-icon {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
    border-color: var(--accent);
}

.mode-option-active strong {
    color: var(--accent);
}

/* Mode création — compact, icône à gauche / texte à droite */
.creation-mode-first {
    margin-bottom: 1.25rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}

.creation-mode-options {
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.creation-mode-options .mode-option {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.5rem 0.65rem;
    gap: 0.55rem;
    flex-direction: row;
    align-items: center;
    border-width: 1px;
    border-radius: var(--radius-sm);
}

.creation-mode-options .mode-option-icon {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.creation-mode-options .mode-option-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.05rem;
    min-width: 0;
}

.creation-mode-options .mode-option-text strong {
    font-size: 0.8rem;
    margin-bottom: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.creation-mode-options .mode-option-text small {
    font-size: 0.68rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .creation-mode-options {
        flex-wrap: wrap;
    }

    .creation-mode-options .mode-option {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: calc(50% - 0.5rem);
    }
}

@media (max-width: 560px) {
    .creation-mode-options .mode-option {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

/* Workspace création (IA / HTML / Template Builder) */
.creation-workspace-layout,
.template-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 320px);
    gap: 0.75rem;
    align-items: start;
}

.creation-workspace-form,
.template-builder-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.builder-step-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.35rem 0 0.75rem 0;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
    background: rgba(255, 255, 255, 0.02);
}

.builder-step-toggle {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 2rem;
}

.builder-step-toggle::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.72rem;
    color: var(--text-secondary);
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease, color 0.2s ease;
}

.builder-step-toggle.is-open::after {
    transform: translateY(-50%) rotate(180deg);
    color: var(--accent);
}

.builder-step-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.builder-step-title strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.92rem;
    line-height: 1.25;
}

.builder-step-title small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.builder-step-badge {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--bg-primary);
    background: var(--accent);
    flex-shrink: 0;
}

.builder-step-1 { border-left-color: #d4af37; }
.builder-step-2 { border-left-color: #3b82f6; }
.builder-step-3 { border-left-color: #10b981; }
.builder-step-4 { border-left-color: #a855f7; }
.builder-step-5 { border-left-color: #f97316; }

.builder-step-content {
    display: none;
}

.builder-step-content.is-open {
    display: block;
}

.creation-preview-box,
.template-builder-preview-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem;
    position: sticky;
    top: 100px;
}

.creation-preview-title,
.template-builder-preview-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 0.45rem 0;
    text-align: center;
}

.creation-preview-slot,
.template-builder-preview-slot {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.creation-generate-action {
    display: flex;
    justify-content: center;
    padding: 0.25rem 0 0.5rem;
}

.creation-generate-action .btn {
    width: 100%;
    font-size: 0.95rem !important;
    padding: 0.75rem 1rem !important;
}

/* Placeholder aperçu mode IA */
.ai-preview-placeholder {
    width: 100%;
    max-width: 292px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.ai-preview-placeholder__sheet {
    width: 100%;
    aspect-ratio: 210 / 297;
    max-height: 420px;
    background: linear-gradient(160deg, #1e1b4b 0%, #312e81 45%, #4c1d95 100%);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(76, 29, 149, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem 1rem;
    position: relative;
    overflow: hidden;
}

.ai-preview-placeholder__glow {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.35) 0%, transparent 70%);
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.ai-preview-placeholder__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fbbf24;
    margin-bottom: 0.85rem;
    position: relative;
    z-index: 1;
}

.ai-preview-placeholder__title {
    margin: 0 0 0.45rem 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    position: relative;
    z-index: 1;
}

.ai-preview-placeholder__text {
    margin: 0 0 0.35rem 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
    position: relative;
    z-index: 1;
}

.ai-preview-placeholder__hint {
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 1;
}

.template-builder-preview-slot #previewSection {
    display: block !important;
}

.email-preview-viewport {
    overflow: hidden;
    width: 100%;
}

.email-preview-scaler {
    transform-origin: top left;
}

.email-preview-a4-frame {
    width: 100%;
}

.email-preview-scaler-wrap {
    width: 100%;
}

/* Preview A4 dans la colonne Template Builder */
.preview-section--sidebar {
    width: 100%;
    max-width: 292px;
    margin: 0 auto;
}

.preview-section--sidebar .preview-section-label > span:first-child {
    display: none;
}

.preview-section--sidebar .preview-section-label {
    justify-content: flex-end !important;
    margin-bottom: 0.35rem;
    width: 100%;
}

.preview-section--sidebar .preview-section-label .btn-sm {
    padding: 0.2rem 0.5rem !important;
    font-size: 0.72rem !important;
}

.preview-section--sidebar .preview-section-visual {
    margin-bottom: 0.35rem;
    width: 100%;
}

.preview-section--sidebar .email-preview-subject {
    padding: 0.4rem 0.55rem;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    width: 100%;
}

.preview-section--sidebar .email-preview-viewport {
    width: 100%;
    margin: 0 auto;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #64748b;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.2);
}

.preview-section--sidebar .email-preview-a4-frame {
    width: 100%;
    background: #ffffff;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 0 3px 14px rgba(15, 23, 42, 0.18);
    border-radius: 2px;
    scrollbar-width: thin;
}

.preview-section--sidebar .email-preview-scaler-wrap {
    overflow: hidden;
}

.preview-section--sidebar .email-preview-scaler {
    width: 680px;
    transform-origin: top left;
}

.preview-section--sidebar .email-preview-viewport .email-preview-content {
    width: 680px;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
}

.preview-section--sidebar .email-preview-viewport .email-preview-content.email-preview-code {
    width: 100%;
    font-size: 0.68rem;
    line-height: 1.45;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 0.5rem;
    box-sizing: border-box;
}

.preview-section--sidebar .preview-section-edit,
.preview-section--sidebar .schedule-section {
    display: none !important;
}

.preview-section--sidebar .preview-section-actions {
    margin-top: 0.5rem !important;
    flex-direction: column;
    gap: 0.45rem !important;
    width: 100%;
}

.preview-section--sidebar .preview-section-actions #regenerateBtn {
    display: none !important;
}

.preview-section--sidebar .preview-section-actions .btn {
    width: 100%;
    font-size: 0.82rem !important;
    padding: 0.55rem 0.75rem !important;
}

.preview-section--sidebar .preview-section-actions #sendBtn {
    font-size: 0.9rem !important;
}

.builder-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.builder-color-input {
    width: 100%;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
}

.builder-help {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}

.email-setup-common {
    margin-bottom: 1.25rem;
}

.email-setup-common-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    gap: 1rem;
    align-items: start;
}

.email-setup-common-type label,
.email-setup-common-layout label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
}

.email-setup-type-desc {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
    line-height: 1.45;
}

.email-setup-common-layout .builder-template-grid {
    margin-top: 0;
}

.campaign-page-intro {
    margin: 0 0 1.25rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}

.campaign-page-intro a {
    color: var(--accent);
    text-decoration: none;
    margin-left: 0.35rem;
}

.campaign-page-intro a:hover {
    text-decoration: underline;
}

.campaigns-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.campaign-template-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.campaign-template-banner i {
    color: #10b981;
    margin-right: 0.35rem;
}

.campaign-content-summary {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.campaign-content-summary__hint {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.campaign-content-section.is-template-loaded .campaign-content-fields {
    display: none;
}

.campaign-content-hidden {
    display: none !important;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    left: -9999px;
}

.campaign-step1-layout {
    display: block;
}

.campaign-step1-layout.has-template-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 1.25rem;
    align-items: start;
}

.campaign-template-preview {
    position: sticky;
    top: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.campaign-preview-subject {
    margin-bottom: 0.65rem;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.campaign-preview-viewport {
    margin-top: 0.35rem;
}

.campaign-send-type-status {
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.08);
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.45;
}

.campaign-send-type-status i {
    color: #10b981;
    margin-right: 0.35rem;
}

.campaign-step2-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.campaign-step2-actions .btn-primary {
    flex: 1;
    min-width: 220px;
}

@media (max-width: 1100px) {
    .campaign-step1-layout.has-template-preview {
        grid-template-columns: 1fr;
    }

    .campaign-template-preview {
        position: static;
    }
}

@media (max-width: 900px) {
    .email-setup-common-grid {
        grid-template-columns: 1fr;
    }
}

.builder-template-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
}

.builder-template-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
}

.builder-template-card:hover {
    border-color: rgba(212, 175, 55, 0.55);
}

.builder-template-card.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35);
    background: rgba(212, 175, 55, 0.06);
}

.builder-template-card__text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.builder-template-card strong {
    font-size: 0.72rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.builder-template-card small {
    color: var(--text-secondary);
    font-size: 0.62rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.builder-template-card__preview {
    width: 36px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.builder-template-card__preview--newsletter {
    background: linear-gradient(180deg, #e2e8f0 0 38%, #fff 38% 100%);
    position: relative;
}

.builder-template-card__preview--newsletter::after {
    content: '';
    position: absolute;
    left: 14%;
    top: 54%;
    width: 50%;
    height: 2px;
    background: #d4af37;
    border-radius: 999px;
}

.builder-template-card__preview--promo {
    background: linear-gradient(135deg, #dc2626 0 48%, #fff 48% 100%);
}

.builder-template-card__preview--announcement {
    background: linear-gradient(180deg, #fff 0 58%, #f0fdfa 58% 100%);
    position: relative;
}

.builder-template-card__preview--announcement::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 30%;
    width: 40%;
    height: 2px;
    transform: translateX(-50%);
    background: #14b8a6;
    border-radius: 999px;
}

.builder-template-card__preview--professional {
    background: linear-gradient(90deg, #2563eb 0 3px, #fff 3px 100%);
}

.builder-template-card__preview--invitation {
    background: linear-gradient(180deg, #6d28d9 0 32%, #fff 32% 100%);
    position: relative;
}

.builder-template-card__preview--invitation::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 48%;
    width: 30%;
    height: 2px;
    transform: translateX(-50%);
    background: #d4af37;
    border-radius: 999px;
}

.builder-template-card__preview--catalog {
    background: linear-gradient(90deg, #ccfbf1 0 42%, #fff 42% 100%);
    position: relative;
}

.builder-template-card__preview--catalog::before {
    content: '';
    position: absolute;
    left: 10%;
    top: 22%;
    width: 28%;
    height: 56%;
    background: #14b8a6;
    border-radius: 2px;
    opacity: 0.35;
}

@media (max-width: 720px) {
    .builder-template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.builder-suggested-images {
    margin-top: 0.25rem;
}

.builder-image-picks {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    margin-top: 0.45rem;
}

.builder-image-pick {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.builder-image-pick:hover {
    border-color: rgba(59, 130, 246, 0.55);
}

.builder-image-pick.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35);
}

.builder-image-pick img {
    width: 100%;
    height: 44px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

.builder-image-pick__label {
    font-size: 0.62rem;
    color: var(--text-primary);
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.builder-image-pick__tag {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(15, 23, 42, 0.78);
    padding: 0.1rem 0.28rem;
    border-radius: 3px;
}

@media (max-width: 900px) {
    .builder-image-picks {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .builder-image-picks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .builder-image-pick img {
        height: 40px;
    }
}

/* Lien CTA (create.html) */
.cta-link-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cta-link-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.cta-link-radio {
    margin-top: 0.25rem;
    accent-color: var(--accent);
}

.cta-link-option-text strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.cta-link-option-text small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
}

.cta-link-option:hover {
    border-color: var(--accent);
    background: rgba(212, 175, 55, 0.08);
}

.cta-link-option-active {
    border-color: var(--accent);
    background: rgba(212, 175, 55, 0.12);
}

.cta-link-option-active strong {
    color: var(--accent);
}

.cta-link-fields {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.15);
}

/* Schedule section */
.schedule-section {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 2rem;
    border: 1px solid var(--border);
}

.schedule-section-title {
    font-weight: 600;
    margin-bottom: 1rem;
    display: block;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.schedule-section-title i {
    color: var(--accent);
    margin-right: 0.35rem;
}

.schedule-options {
    margin-bottom: 1rem;
}

.schedule-panel {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-top: 0.75rem;
}

.schedule-shortcuts-label {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.schedule-shortcuts-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.quick-schedule-btn {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.quick-schedule-btn:hover,
.quick-schedule-btn.active {
    border-color: var(--accent);
    background: rgba(212, 175, 55, 0.12);
    color: var(--accent);
}

.schedule-datetime-row {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.schedule-datetime-field {
    flex: 0 0 auto;
}

.schedule-field-label {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.schedule-summary {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: rgba(212, 175, 55, 0.12);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
}

.schedule-info {
    color: var(--text-muted);
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
}

/* History list */
.history-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateX(4px);
}

.history-item:hover .history-item-icon {
    background: rgba(212, 175, 55, 0.12);
    color: var(--accent);
    border-color: var(--accent);
}

.history-item-icon {
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.2s;
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-content h4 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.history-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--accent);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
}

.history-meta-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-date {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    text-align: right;
}

.history-item-date i {
    color: var(--accent);
    font-size: 0.85rem;
}

/* Liste historique compacte */
.history-list--compact .history-item {
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.35rem;
    gap: 0.5rem;
}

.history-list--compact .history-item-icon {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

.history-list--compact .history-item-content h4 {
    margin: 0 0 0.15rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.history-list--compact .history-item-meta {
    gap: 0.35rem 0.6rem;
}

.history-list--compact .history-meta-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
}

.history-list--compact .history-meta-preview {
    font-size: 0.68rem;
    max-width: 280px;
}

.history-list--compact .history-item-date {
    font-size: 0.65rem;
    gap: 0.1rem;
}

.history-list--compact .history-item-date i {
    font-size: 0.7rem;
}

.history-item .btn-delete.history-item-delete {
    padding: 0.25rem 0.45rem;
    font-size: 0.7rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.history-item:hover .btn-delete.history-item-delete {
    opacity: 1;
}

/* Confirm dialog */
.confirm-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.confirm-modal.active {
    display: flex;
    animation: confirmFadeIn 0.2s ease;
}

@keyframes confirmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.confirm-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 420px;
    width: 100%;
    padding: 1.75rem 1.5rem 1.25rem;
    text-align: center;
    animation: confirmSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes confirmSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.confirm-modal-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--accent);
    font-size: 1.25rem;
}

.confirm-modal-icon--danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    color: #ef4444;
}

.confirm-modal-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.confirm-modal-message {
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.confirm-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirm-modal-actions .btn {
    min-width: 110px;
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
}

.confirm-modal-icon--accent {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.35);
    color: var(--accent);
}

.prompt-modal-input {
    width: 100%;
    margin-bottom: 1.25rem;
    text-align: left;
    font-size: 0.9rem;
}

.prompt-modal .confirm-modal-content {
    text-align: left;
}

.prompt-modal .confirm-modal-icon {
    margin-left: auto;
    margin-right: auto;
}

.prompt-modal .confirm-modal-title,
.prompt-modal .confirm-modal-message {
    text-align: center;
}

/* History modal */
.history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.history-modal.active {
    display: flex;
}

.history-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

.history-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.history-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.history-modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
    padding: 0.25rem;
}

.history-modal-close:hover {
    color: var(--text-primary);
}

.history-modal-meta {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.history-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.history-meta-item i {
    color: var(--accent);
    margin-top: 0.15rem;
    width: 16px;
}

.history-modal-tabs {
    display: flex;
    gap: 0;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
}

.history-tab {
    padding: 0.75rem 1.25rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.history-tab:hover {
    color: var(--accent);
}

.history-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.history-modal-preview {
    flex: 1;
    min-height: 400px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.history-modal-preview iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
}

.history-modal-html {
    padding: 1rem 1.5rem;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-modal-html-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.history-code-block {
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: auto;
    max-height: 350px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    flex: 1;
}

.history-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card-body {
    padding: 0.5rem 0;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    text-align: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

/* Responsive */
/* Menu Burger */
.burger-menu {
    display: none;
    background: var(--primary);
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.625rem;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.burger-menu:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header {
        position: relative;
        padding: 2rem 1.5rem;
    }

    .header h1 {
        font-size: 2rem;
        padding-right: 3rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .stats-grid,
    .actions-grid,
    .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .burger-menu {
        display: block;
    }

    .nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        padding: 1rem;
        z-index: 999;
        border: 1px solid var(--border);
        margin-top: 0.5rem;
    }

    .nav.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        margin: 0.25rem 0;
        padding: 1rem 1.5rem;
    }

    .dashboard {
        padding: 1.5rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .action-card {
        padding: 1.75rem;
    }

    .creation-workspace-layout,
    .template-builder-layout,
    .builder-grid-2 {
        grid-template-columns: 1fr;
    }

    .creation-preview-box,
    .template-builder-preview-box {
        position: static;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* History List Scrollable */
#historyList {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#historyList::-webkit-scrollbar {
    width: 8px;
}

#historyList::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
}

#historyList::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

#historyList::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Contacts — formulaire et filtres */
.contact-add-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
}

.contacts-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.contacts-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0;
}

.contacts-filters-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.contacts-filters .form-control {
    width: auto;
    max-width: 100%;
}

.contacts-filters #categoryFilter {
    min-width: 0;
    flex: 1 1 180px;
}

.contacts-filters #searchInput {
    min-width: 0;
    flex: 1 1 180px;
}

@media (max-width: 1100px) {
    .contact-add-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .contact-add-grid {
        grid-template-columns: 1fr;
    }
}

/* Contacts List Styles */
#contactsList {
    max-height: 700px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Campaigns List Scrollable */
#campaignsList {
    max-height: 700px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Invalid Contacts List Scrollable (Bounces) */
#invalidList {
    max-height: 700px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Engaged Contacts List Scrollable (Responses) */
#engagedContacts {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#contactsList::-webkit-scrollbar,
#campaignsList::-webkit-scrollbar,
#invalidList::-webkit-scrollbar,
#engagedContacts::-webkit-scrollbar {
    width: 8px;
}

#contactsList::-webkit-scrollbar-track,
#campaignsList::-webkit-scrollbar-track,
#invalidList::-webkit-scrollbar-track,
#engagedContacts::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
}

#contactsList::-webkit-scrollbar-thumb,
#campaignsList::-webkit-scrollbar-thumb,
#invalidList::-webkit-scrollbar-thumb,
#engagedContacts::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

#contactsList::-webkit-scrollbar-thumb:hover,
#campaignsList::-webkit-scrollbar-thumb:hover,
#invalidList::-webkit-scrollbar-thumb:hover,
#engagedContacts::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.category-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.category-badge:hover {
    background: var(--bg-card);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.contact-group {
    margin-bottom: 1.5rem;
}

.contact-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
}

.contact-group-icon {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border-radius: 6px;
}

.contact-group-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.contact-group-count {
    background: var(--accent);
    color: var(--bg-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    margin-left: 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-card);
    border-radius: 8px;
    border-left: 2px solid var(--border);
    transition: all 0.2s;
}

.contact-item:hover {
    background: var(--bg-secondary);
    border-left-color: var(--accent);
    transform: translateX(4px);
}

.contact-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.contact-item:hover .contact-avatar {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
    font-weight: 500;
}

.contact-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-delete {
    padding: 0.4rem 0.8rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* Campaign Cards */
.campaign-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--accent);
    transition: all 0.2s;
}

.campaign-card:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.campaign-card.sent {
    border-left-color: #10b981;
    opacity: 0.8;
}

.campaign-card.failed {
    border-left-color: #ef4444;
}

.campaign-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.campaign-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.campaign-meta {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.campaign-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.status-sent {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.campaign-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-preview {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-preview:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.btn-cancel {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-cancel:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.btn-send-now {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-send-now:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}

.category-icon {
    font-size: 1.2rem;
}

/* Campaign Stats */
.stats-grid .stat-card {
    cursor: pointer;
    user-select: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem 0.5rem;
    min-width: 0;
    gap: 0.25rem;
}

.stats-grid .stat-card .stat-label {
    font-size: 0.72rem;
}

.stats-grid .stat-card.active {
    border: 2px solid var(--accent);
    background: var(--bg-secondary);
}

.stats-grid .stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Preview Modal */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.preview-modal.active {
    display: flex;
}

.preview-content {
    background: var(--bg-card);
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.preview-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.preview-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.preview-close:hover {
    color: var(--text-primary);
}

.preview-body {
    flex: 1;
    overflow: auto;
    padding: 0;
}

.preview-body iframe {
    width: 100%;
    height: 500px;
    border: none;
}

.preview-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

textarea.form-control.recipients-field {
    min-height: 72px;
    height: 72px;
    resize: vertical;
}

/* Bouton sélection contacts */
.recipients-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.select-contacts-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--accent);
    color: var(--accent);
    background: rgba(212, 175, 55, 0.1);
    border-radius: var(--radius-sm);
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.select-contacts-btn i {
    font-size: 1.1rem;
}

.select-contacts-btn:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--accent-hover);
    color: var(--accent-hover);
    transform: translateY(-1px);
}

.select-contacts-btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8125rem;
}

/* Modal sélection contacts */
.contacts-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.contacts-modal.active {
    display: flex;
}

.contacts-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
}

.contacts-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contacts-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 700;
}

.contacts-modal-header h2 i {
    color: var(--accent);
    margin-right: 0.5rem;
}

.contacts-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
    line-height: 1;
    padding: 0.25rem;
}

.contacts-modal-close:hover {
    color: var(--text-primary);
}

.contacts-modal-body {
    padding: 1.25rem 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.contacts-modal-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.contacts-modal-search {
    position: relative;
    flex: 2;
    min-width: 200px;
}

.contacts-modal-search i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.contacts-modal-search .form-control {
    padding-left: 2.5rem;
}

.contacts-modal-group-filter {
    flex: 1;
    min-width: 160px;
}

.contacts-modal-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.contacts-modal-toolbar .btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.contacts-modal-count {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.contacts-modal-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    min-height: 200px;
    max-height: 380px;
}

.contacts-modal-list::-webkit-scrollbar {
    width: 6px;
}

.contacts-modal-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.contacts-modal-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.contacts-modal-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.contacts-modal-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.contacts-modal-empty i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.modal-contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.modal-contact-item:last-child {
    border-bottom: none;
}

.modal-contact-item:hover {
    background: var(--bg-card-hover);
}

.modal-contact-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.modal-contact-label {
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.modal-contact-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.modal-contact-email {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-contact-badge {
    background: color-mix(in srgb, var(--badge-color, var(--text-muted)) 20%, transparent);
    color: var(--badge-color, var(--text-secondary));
    border: 1px solid color-mix(in srgb, var(--badge-color, var(--border)) 40%, transparent);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.contacts-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .contacts-modal {
        padding: 1rem;
        align-items: flex-end;
    }

    .contacts-modal-content {
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .contacts-modal-filters {
        flex-direction: column;
    }

    .contacts-modal-group-filter {
        width: 100%;
    }

    .contacts-modal-count {
        width: 100%;
        margin-left: 0;
        text-align: center;
        margin-top: 0.25rem;
    }
}

.recipients-list {
    max-height: 150px;
    overflow-y: auto;
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.recipients-list span {
    display: inline-block;
    background: var(--bg-card);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin: 0.15rem;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

/* Bounces Page Styles */
.stat-box {
    background: var(--bg-card);
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    text-align: center;
    border: 2px solid var(--border);
    transition: all 0.2s;
    min-width: 0;
}

.stat-box:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.stat-box.danger {
    border-color: rgba(239, 68, 68, 0.4);
}

.stat-box.warning {
    border-color: rgba(234, 179, 8, 0.4);
}

.stat-box.success {
    border-color: rgba(16, 185, 129, 0.4);
}

.stat-box .stat-number {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-box.danger .stat-number {
    color: #ef4444;
}

.stat-box.warning .stat-number {
    color: #eab308;
}

.stat-box.success .stat-number {
    color: #10b981;
}

.stat-box .stat-label {
    color: var(--text-secondary);
    margin-top: 0.35rem;
    font-size: 0.72rem;
    line-height: 1.3;
}

.contacts-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
}

.contacts-table thead {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.contacts-table th {
    padding: 0.85rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.contacts-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.contacts-table tbody tr:hover {
    background: var(--bg-secondary);
}

.contacts-table tbody tr:last-child td {
    border-bottom: none;
}

.bounce-type-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.bounce-type-badge.hard {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.bounce-type-badge.soft {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.error-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ef4444;
    font-size: 0.85rem;
}

.error-cell:hover {
    white-space: normal;
    word-break: break-word;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell button {
    padding: 0.4rem 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.checkbox-cell {
    width: 40px;
    text-align: center;
}

.checkbox-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.bulk-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.bulk-actions button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.bulk-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-bulk-revalidate {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-bulk-revalidate:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.btn-bulk-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-bulk-delete:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.selection-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.btn-revalidate {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-revalidate:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.refresh-btn {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: all 0.2s;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.last-check {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 1rem;
}

/* Analytics/Responses Page Styles */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.analytics-grid .stat-card {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 2px solid var(--border);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    min-width: 0;
}

.analytics-grid .stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.analytics-grid .stat-card.success:hover {
    border-color: #10b981;
}

.analytics-grid .stat-card.warning:hover {
    border-color: var(--accent);
}

.analytics-grid .stat-card.danger:hover {
    border-color: #ef4444;
}

.analytics-grid .stat-card.success {
    border-color: rgba(16, 185, 129, 0.4);
}

.analytics-grid .stat-card.warning {
    border-color: rgba(212, 175, 55, 0.4);
}

.analytics-grid .stat-card.danger {
    border-color: rgba(239, 68, 68, 0.4);
}

.analytics-grid .stat-label i {
    color: var(--text-muted);
    margin-right: 0.35rem;
    font-size: 0.75rem;
}

.analytics-grid .stat-card.success .stat-label i {
    color: rgba(16, 185, 129, 0.7);
}

.analytics-grid .stat-card.warning .stat-label i {
    color: rgba(212, 175, 55, 0.7);
}

.analytics-grid .stat-card.danger .stat-label i {
    color: rgba(239, 68, 68, 0.7);
}

.dashboard-stats {
    margin-bottom: 1.5rem;
}

.stat-value-compact {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.analytics-grid .stat-card.warning .stat-value {
    color: var(--accent);
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0.35rem 0;
    color: var(--accent);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.analytics-grid .stat-card.success .stat-value {
    color: #10b981;
}

.analytics-grid .stat-card.danger .stat-value {
    color: #ef4444;
}

.analytics-grid .stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.chart-container {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.chart-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.chart-container canvas {
    max-height: 250px;
}

.campaigns-table {
    width: 100%;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.campaigns-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.85rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
}

.campaigns-table td {
    padding: 0.85rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.campaigns-table tbody tr:hover {
    background: var(--bg-secondary);
}

.response-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.response-badge.positive {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.response-badge.negative {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.response-badge.neutral {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.response-badge.unsubscribe {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #10b981;
    transition: width 0.3s ease;
}

.contact-card {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #10b981;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.contact-card:hover {
    background: var(--bg-secondary);
    transform: translateX(4px);
}

.contact-email {
    font-weight: 600;
    color: var(--text-primary);
}

.contact-preview {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Variables dynamiques (create.html) */
.variables-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    background: var(--bg-card);
}

.variables-panel summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.variables-panel summary::-webkit-details-marker {
    display: none;
}

.variables-panel summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
    transition: transform 0.2s;
}

.variables-panel[open] summary::after {
    transform: rotate(180deg);
}

.variables-panel summary i {
    color: var(--accent);
}

.variables-panel-body {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.variables-panel-intro {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.variables-panel-intro code {
    background: var(--bg-secondary);
    color: var(--accent);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.variables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.variables-field label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.variables-tip {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(212, 175, 55, 0.08);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
}

.variables-tip p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.variables-tip strong {
    color: var(--accent);
}

.variables-tip code {
    background: var(--bg-secondary);
    color: var(--accent);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.85em;
}

@media (max-width: 768px) {
    .variables-grid {
        grid-template-columns: 1fr;
    }
}

/* Aperçu email (create.html) — lisible malgré le thème sombre */
.email-preview-subject {
    background: #f5f7fa;
    color: #1a1a1a;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
}

.email-preview-subject strong,
.email-preview-subject span,
.email-preview-subject #subjectPreview {
    color: #1a1a1a;
}

.email-preview-content {
    padding: 1.5rem;
    border-radius: 10px;
    min-height: 200px;
    border: 1px solid #e0e0e0;
    overflow-x: auto;
}

.email-preview-content.email-preview-render {
    background: #ffffff;
    color: #333333;
    white-space: normal;
}

.email-preview-content.email-preview-code {
    background: #0f172a;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border-color: rgba(59, 130, 246, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}
