/* SafeAI Frontend v6 - Main Styles */

:root {
    --primary-color: #000000;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #f59e0b;
    --secondary-color: #6b7280;
    --background-color: #ffffff;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 6px;
    --border-radius-sm: 3px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Utility Classes - Tailwind-like */
.min-h-screen { min-height: 100vh; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-white { background-color: #ffffff; }
.bg-blue-600 { background-color: #2563eb; }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.from-gray-900 { --tw-gradient-from: #111827; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(17 24 39 / 0)); }
.to-gray-700 { --tw-gradient-to: #374151; }
.fill-current { fill: currentColor; }
.w-full { width: 100%; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-96 { height: 24rem; }
.max-w-screen-2xl { max-width: 1536px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.pb-1 { padding-bottom: 0.25rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.hidden { display: none; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-8 > * + * { margin-left: 2rem; }
.gap-2 { gap: 0.5rem; }
.gap-x-2\.5 { column-gap: 0.625rem; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-600 { background-color: #4b5563; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-b-2 { border-bottom-width: 2px; }
.border-gray-200 { border-color: #e5e7eb; }
.border-blue-600 { border-color: #2563eb; }
.border-transparent { border-color: transparent; }
.text-white { color: #ffffff; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-900 { color: #111827; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.hover\:text-blue-600:hover { color: #2563eb; }
.animate-spin { animation: spin 1s linear infinite; }

/* Navigation Styles */
.nav-item {
    cursor: pointer;
    outline: none;
    background: none;
    border: 1px solid transparent;
}

.nav-item:hover {
    cursor: pointer;
}

/* Universal pointer cursor for all interactive elements */
.btn, button, .workflow-card, .suggestions-table tr, .nav-item, .close-button, .checkbox-item, [onclick] {
    cursor: pointer;
}

.btn:hover, button:hover, .workflow-card:hover, .suggestions-table tr:hover, .nav-item:hover, .close-button:hover, .checkbox-item:hover, [onclick]:hover {
    cursor: pointer;
}

.nav-item:not(.active) {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.nav-item:not(.active):hover {
    background: #f9fafb;
    color: var(--text-primary);
    border-color: #e5e7eb;
}

.nav-item.active {
    background: white;
    color: var(--text-primary);
    border-color: #e5e7eb;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
}

/* Section Display */
.suggestions-section, .prompts-section {
    display: block;
}

.suggestions-section.hidden, .prompts-section.hidden {
    display: none !important;
}

/* Prompts Panel Styling */
.prompts-panel {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 24px;
    min-height: calc(100vh - 200px);
}

.prompts-panel #prompts-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

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

.border-top-blue-600 {
    border-top-color: #2563eb;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Error Screen */
.error-screen {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-screen h2 {
    color: var(--danger-color);
    margin-bottom: 10px;
}

/* Tabs Container */
.tabs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.suggestion-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
    flex: 1;
}

/* Generation Controls */
.generation-controls {
    flex-shrink: 0;
}

.btn-generate {
    background: var(--primary-color);
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
}

.btn-generate:hover:not(:disabled) {
    background: #1a1a1a;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

.btn-generate svg {
    flex-shrink: 0;
}

.btn-generate:disabled,
.btn-generate.generating {
    background: #6b7280;
    color: white;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-generate.generating {
    position: relative;
}

.btn-generate .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 100px;
    flex: 1;
}

.tab-content {
    text-align: center;
}

.tab-header-with-number {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}

.tab-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #6b7280;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    flex-shrink: 0;
}

.tab-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2px;
}

.tab-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.8;
    line-height: 1;
}

.tab:hover {
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.05);
}

.tab.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.1);
}

/* Main Content Layout */
.suggestion-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 24px;
    height: calc(100vh - 250px);
    min-height: 600px;
    padding: 24px;
}

/* Panels */
.overview-panel,
.examples-panel,
.prompts-panel,
.prompt-adjustments-panel {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.overview-panel h3,
.examples-panel h3,
.prompts-panel h3,
.prompt-adjustments-panel h3 {
    padding: 20px;
    margin: 0;
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.overview-panel > div,
.examples-panel > div,
.prompts-panel > div {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

/* Overview Panel */
.metadata-grid {
    display: grid;
    gap: 16px;
}

.metadata-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px;
    align-items: start;
}

.metadata-item label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.metadata-item span {
    color: var(--text-primary);
}

.product-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.product-badge.private_health { 
    background: #dbeafe; 
    color: #1d4ed8; 
}

.product-badge.term_life { 
    background: #dcfce7; 
    color: #166534; 
}

.product-badge.income_protection { 
    background: #fef3c7; 
    color: #92400e; 
}

.product-badge.child_savings_plan {
    background: #fce7f3;
    color: #be185d;
}

.variables-list {
    font-family: 'Courier New', monospace;
    background: var(--background-color);
    padding: 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
}

/* New tag-based variables display */
.variables-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    align-items: center;
}

.variable-tag {
    display: inline-flex;
    align-items: center;
    background: #f3f4f6;
    color: #374151;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: capitalize;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    min-height: 18px;
}

.no-variables {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

.original-content-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.original-content-section h4 {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
}

.original-content {
    background: var(--background-color);
    padding: 16px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    font-size: 0.95rem;
}

/* New scrollable content display */
.original-content-scrollable {
    background: var(--background-color);
    padding: 16px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    font-size: 0.95rem;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 3px 0 rgb(0 0 0 / 0.1);
    line-height: 1.5;
}

.actions-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Examples Panel - Unfolding List */
.examples-list-unfolding {
    overflow-y: auto;
    max-height: 100%;
}

.example-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    background: var(--card-background);
    transition: all 0.2s ease;
}

.example-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.example-item.active {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
}

.example-item .example-header {
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.example-item .example-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.example-item .example-toggle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    min-width: 12px;
}

.example-item .example-toggle.expanded {
    transform: rotate(0deg);
}

.example-item .example-subject {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 500;
    flex: 1;
}

.example-preview {
    transition: all 0.3s ease;
    overflow: hidden;
}

.example-preview.collapsed {
    max-height: 0;
    opacity: 0;
}

.example-preview.expanded {
    max-height: 500px;
    opacity: 1;
}

.email-preview-inline {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(248, 250, 252, 0.5);
}

.email-body-inline {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.email-body-inline p {
    margin-bottom: 8px;
}

.email-body-inline p:last-child {
    margin-bottom: 0;
}

.email-cta-inline {
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius-sm);
    display: inline-block;
    font-size: 0.85rem;
}

.email-meta-inline {
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    cursor: pointer;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

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

.btn-success:hover:not(:disabled) {
    background: #15803d;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

/* Specific styling for dismiss buttons to ensure they're always red */
.btn-outline.btn-danger {
    background: var(--danger-color);
    color: white;
    border: 1px solid var(--danger-color);
}

.btn-outline.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

/* Modern Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    min-height: 44px;
    justify-content: center;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-action:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn-action:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-action svg {
    flex-shrink: 0;
}

.btn-action-approve {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-action-approve:not(:disabled):hover {
    background: linear-gradient(135deg, #15803d, #166534);
}

.btn-action-dismiss {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-action-dismiss:not(:disabled):hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
}

.btn-action-generate {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-action-generate:not(:disabled):hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.btn-action-production {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-action-production:not(:disabled):hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.actions-section {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .actions-section {
        flex-direction: column;
    }
    
    .btn-action {
        width: 100%;
    }
}

/* Prompt Editor Styles */
.prompt-textarea {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: 'Courier New', Monaco, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--card-background);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.prompt-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.prompt-section {
    margin-bottom: 24px;
}

.prompt-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.prompt-meta {
    margin-top: 6px;
    color: var(--text-muted);
}

.prompt-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Prompt Adjustments Panel */
.prompt-adjustments-content {
    padding: 20px 20px 0 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.adjustment-section {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.adjustment-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.adjustment-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 200px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: 'Courier New', Monaco, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--card-background);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.adjustment-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.adjustment-actions {
    display: flex !important;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 20px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    background-color: var(--background-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.adjustment-actions .btn {
    flex-shrink: 0;
    min-height: 40px;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Specific fix for recreate button */
#recreate-button, #reset-adjustments {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
    z-index: 1000 !important;
    min-width: 200px !important;
    height: 40px !important;
}

/* Make prompts panel wider in the grid */
@media (min-width: 1200px) {
    .suggestion-content {
        grid-template-columns: 1fr 1.5fr 1.2fr;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .suggestion-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
    }
    
    .overview-panel,
    .examples-panel,
    .prompts-panel {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .suggestion-tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        min-width: auto;
        flex: 1;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Generation Modal Tabs */
.generation-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

.generation-tab {
    flex: 1;
    padding: 14px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.generation-tab:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.generation-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.form-section {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.product-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--primary-color);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.radio-item:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--primary-color);
}

.radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.radio-item input[type="radio"]:checked + .radio-label {
    font-weight: 600;
    color: var(--primary-color);
}

.radio-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
}

.checkbox-label {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-primary);
    user-select: none;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.form-help {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.generation-info {
    background: rgba(0, 0, 0, 0.05);
    padding: 16px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.generation-info p {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.generation-info p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer .btn {
    padding: 12px 24px;
    font-weight: 600;
}

/* Responsive modal */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Additional product badge for private pension */
.product-badge.private_pension {
    background: #e0e7ff;
    color: #4338ca;
}

/* Life Stage Tags */
.life-stage-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    background: white;
    border: 1px solid;
    margin-right: 8px;
    vertical-align: middle;
}

.life-stage-tag.life-stage-blue {
    border-color: #2563eb;
    color: #2563eb;
}

.life-stage-tag.life-stage-green {
    border-color: #16a34a;
    color: #16a34a;
}

.life-stage-tag.life-stage-purple {
    border-color: #9333ea;
    color: #9333ea;
}

.life-stage-tag.life-stage-orange {
    border-color: #ea580c;
    color: #ea580c;
}

.life-stage-tag.life-stage-default {
    border-color: #6b7280;
    color: #6b7280;
}

.life-stage-tag.life-stage-grey {
    border-color: #6b7280;
    color: #6b7280;
}

/* Personalization Variables Styles */
.personalization-variables-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--background-color);
    flex-shrink: 0;
}

.personalization-variable-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.personalization-variable-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.personalization-variable-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.personalization-variable-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    user-select: none;
    text-transform: capitalize;
}

.personalization-variable-label:hover {
    color: var(--primary-color);
}

.adjustment-number-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    margin-top: 8px;
    margin-bottom: 4px;
    background: var(--background-color);
    color: var(--text-color);
}

.adjustment-number-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.adjustment-help-text {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Empty state for personalization variables */
.personalization-variables-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

/* =============================
   v6 SPECIFIC STYLES
   ============================= */

/* Navigation count badges */
.count-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    margin-left: 4px;
}

/* Home Section - Workflow Cards */
.workflow-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    flex: 1;
    min-height: 160px;
    min-width: 220px;
}

.workflow-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.card-icon.suggestions {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.card-icon.modification-suite {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.card-icon.approved {
    background: linear-gradient(135deg, #10b981, #059669);
}

.card-icon.campaigns {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.card-icon.production {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.card-title {
    flex: 1;
    margin-left: 16px;
}

.card-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-top: 4px;
}

.card-description {
    margin-bottom: 20px;
}

.card-description p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 12px;
}

/* Quick Stats */
.stat-item {
    text-align: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Table Layout for Suggestions */
.suggestions-table-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.suggestions-list-panel {
    border-right: 1px solid var(--border-color);
    background: white;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.table-container {
    flex: 1;
    overflow-y: auto;
}

.suggestions-table {
    width: 100%;
    border-collapse: collapse;
}

.suggestions-table th,
.suggestions-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

/* Optimized column widths for v6 tables */
.suggestions-table th:nth-child(1),
.suggestions-table td:nth-child(1) {
    width: 100px; /* Product column - narrower */
}

.suggestions-table th:nth-child(2),
.suggestions-table td:nth-child(2) {
    width: 80px; /* Content ID column - narrower */
}

.suggestions-table th:nth-child(3),
.suggestions-table td:nth-child(3) {
    width: 90px; /* Life Stages column - new */
}

.suggestions-table th:nth-child(4),
.suggestions-table td:nth-child(4) {
    width: auto; /* Timestamp column - takes remaining space */
}

.suggestions-table th:nth-child(5),
.suggestions-table td:nth-child(5) {
    width: 40px; /* Drag handle column */
}

/* Drag handle styling */
.drag-handle-cell {
    text-align: center;
    cursor: grab;
    padding: 8px 4px;
}

.drag-handle-cell:hover svg {
    color: var(--primary-color) !important;
}

.drag-handle-cell:active {
    cursor: grabbing;
}

.suggestions-table th {
    background: rgba(0, 0, 0, 0.02);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.suggestions-table tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.suggestions-table tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.suggestions-table tr.selected {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--primary-color);
}

.product-cell {
    font-size: 0.7rem;
    font-weight: 500;
}

.content-id-cell {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.examples-count-cell {
    font-weight: 600;
    color: var(--primary-color);
}

.timestamp-cell {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.life-stages-cell {
    font-size: 0.75rem;
}

.life-stages-none,
.life-stages-all,
.life-stages-mixed {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.7rem;
}

/* Suggestion Details Panel */
.suggestion-details-panel {
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.empty-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-details p {
    font-size: 1.125rem;
    margin: 0;
}

/* Details Content */
.details-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.details-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

.details-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.details-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.details-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.details-actions {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Additional Button Styles */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

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

.btn-outline:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

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

.btn-success:hover {
    background: #059669;
}

.btn-success:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* Modification Suite Layout */
.modification-suite-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.modification-list-panel {
    border-right: 1px solid var(--border-color);
    background: white;
    display: flex;
    flex-direction: column;
}

.panel-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
    font-weight: 400;
}

.modification-details-panel {
    background: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
}

/* Modification Details Content */
.modification-content {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
}

.modification-overview {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

.modification-overview h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modification-overview p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.modification-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    overflow: visible;
    min-height: auto;
}

.modification-examples {
    padding: 20px;
    overflow-y: visible;
    border-right: 1px solid var(--border-color);
    min-height: auto;
}

.modification-adjustments {
    padding: 20px;
    overflow-y: visible;
    background: rgba(0, 0, 0, 0.01);
    min-height: auto;
}

.modification-examples h4,
.modification-adjustments h4 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Adjustment Panel Styles */
.adjustment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.adjustment-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.adjustment-field label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.adjustment-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.adjustment-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.adjustment-textarea::placeholder {
    color: var(--text-muted);
}

.personalization-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
}

.personalization-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.personalization-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.personalization-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.personalization-item label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    text-transform: capitalize;
    font-weight: 400;
}

.examples-number-input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.examples-number-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.modification-actions {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Prompt History Display */
.prompt-history {
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--border-radius);
}

.prompt-history h5 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
}

.prompt-history p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Current Adjustment Display */
.current-adjustment {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 16px;
}

.current-adjustment h5 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #d97706;
}

.current-adjustment p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Approved and Production Layouts */
.approved-layout,
.production-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.campaigns-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.5fr;
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.approved-list-panel,
.production-list-panel,
.campaigns-list-panel {
    border-right: 1px solid var(--border-color);
    background: white;
    display: flex;
    flex-direction: column;
}

.approved-details-panel,
.production-details-panel,
.campaign-details-panel,
.campaign-suggestion-details-panel {
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.campaign-details-panel,
.campaign-suggestion-details-panel {
    border-right: 1px solid var(--border-color);
}

/* Approved/Production Content */
.status-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.status-overview {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

.status-overview h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-overview p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.status-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.status-actions {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.approved {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.production {
    background: rgba(139, 92, 246, 0.1);
    color: #5b21b6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.status-badge svg {
    width: 12px;
    height: 12px;
}

/* Timestamp styling */
.timestamp-display {
    background: rgba(0, 0, 0, 0.02);
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.timestamp-display h5 {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Action buttons specific to approved/production */
.btn-deploy {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
}

.btn-deploy:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.btn-revert {
    background: transparent;
    border: 1px solid #f59e0b;
    color: #d97706;
}

.btn-revert:hover {
    background: rgba(245, 158, 11, 0.1);
}

/* Single Life Stage: Side-by-side count inputs */
.single-counts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .single-counts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Responsive Design for v6 */
@media (max-width: 1024px) {
    .suggestions-table-layout,
    .modification-suite-layout,
    .approved-layout,
    .production-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 300px 1fr;
    }
    
    .suggestions-list-panel,
    .modification-list-panel,
    .approved-list-panel,
    .production-list-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .modification-body {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
    
    .modification-examples {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 768px) {
    .workflow-card {
        padding: 16px;
    }
    
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-title {
        margin-left: 0;
    }
}

/* =============================
   CAMPAIGN CONSTRUCTOR STYLES
   ============================= */

/* Campaign Constructor Layout */
.approved-layout-with-constructor {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.approved-layout-with-constructor .approved-list-panel.narrow {
    border-right: 1px solid var(--border-color);
    background: white;
    display: flex;
    flex-direction: column;
}

.approved-layout-with-constructor .approved-details-panel.narrow {
    border-right: 1px solid var(--border-color);
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Campaign Constructor Panel */
.campaign-constructor-panel {
    background: white;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
    max-width: 400px;
}

.constructor-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.constructor-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.constructor-subtitle {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Life Stages Container */
.life-stages-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

/* Life Stage Drop Zone */
.life-stage-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.01);
    min-height: 80px;
}

.life-stage-drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.02);
}

.life-stage-drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
    border-style: solid;
    transform: scale(1.02);
}

.life-stage-drop-zone.has-suggestion {
    border-color: var(--success-color);
    border-style: solid;
    background: rgba(16, 185, 129, 0.02);
}

/* Life Stage Header */
.life-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.life-stage-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.life-stage-header h4 .life-stage-tag {
    font-size: 0.9rem;
    padding: 4px 12px;
}

.remove-suggestion-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.remove-suggestion-btn:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

/* Drop Zone Content */
.drop-zone-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drop-zone-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
    text-align: center;
    min-height: 60px;
}

.drop-zone-placeholder svg {
    margin-bottom: 8px;
    opacity: 0.5;
}

.drop-zone-placeholder span {
    font-size: 0.875rem;
    font-style: italic;
}

/* Suggestion Slot */
.suggestion-slot {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow-sm);
}

.suggestion-slot .suggestion-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.suggestion-mini .product-badge {
    align-self: flex-start;
}

.suggestion-mini .subject-line {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 4px 0;
}

.suggestion-mini .timestamp {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Life Stage Form */
.life-stage-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.broadcast-id-input,
.url-select,
.other-url-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
    background: white;
}

.broadcast-id-input:focus,
.url-select:focus,
.other-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.other-url-group {
    margin-top: 8px;
}

/* Campaign Actions */
.campaign-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.create-campaign-btn {
    flex: 1;
    min-width: 200px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.create-campaign-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.create-campaign-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.clear-campaign-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clear-campaign-btn:hover {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Drag and Drop States */
.suggestion-row.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.suggestion-row.draggable {
    cursor: grab;
}

.suggestion-row.draggable:hover {
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--primary-color);
}

.suggestion-row.draggable:active {
    cursor: grabbing;
}

/* Campaign Constructor Validation States */
.life-stage-drop-zone.invalid {
    border-color: var(--danger-color);
    background: rgba(220, 38, 38, 0.02);
}

.form-group.invalid input,
.form-group.invalid select {
    border-color: var(--danger-color);
}

.form-group.invalid label {
    color: var(--danger-color);
}

.validation-error {
    font-size: 0.75rem;
    color: var(--danger-color);
    margin-top: 4px;
}

/* Campaign Constructor Responsive Design */
@media (max-width: 1200px) {
    .approved-layout-with-constructor {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        height: auto;
    }

    .approved-layout-with-constructor .approved-list-panel.narrow,
    .approved-layout-with-constructor .approved-details-panel.narrow {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: 300px;
    }

    .campaign-constructor-panel {
        height: auto;
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .life-stages-container {
        gap: 12px;
    }

    .life-stage-drop-zone {
        padding: 12px;
        min-height: 100px;
    }

    .campaign-actions {
        flex-direction: column;
    }

    .create-campaign-btn,
    .clear-campaign-btn {
        width: 100%;
        min-width: unset;
    }
}

/* ================================ */
/* Prompts Section Styles */
/* ================================ */

.prompts-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.prompts-menu-panel {
    background: white;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.prompts-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.prompt-menu-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-menu-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.prompt-menu-item.selected {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary-color);
    padding-left: 13px;
}

.prompt-menu-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.prompt-display-panel {
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.prompt-display-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.prompt-display-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.prompt-display-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.prompt-display-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Code block styling for prompts */
.prompt-code-block {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* YAML syntax highlighting */
.yaml-key {
    color: #0000ff; /* Blue for keys */
    font-weight: 600;
}

.yaml-string {
    color: #008000; /* Green for strings */
}

.yaml-number {
    color: #098658; /* Teal for numbers */
}

.yaml-boolean {
    color: #d73a49; /* Red for booleans */
}

.yaml-comment {
    color: #6a737d; /* Gray for comments */
    font-style: italic;
}

.yaml-null {
    color: #6f42c1; /* Purple for null */
}

.yaml-anchor {
    color: #e36209; /* Orange for anchors */
}

/* Template variable highlighting */
.template-variable {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 500;
}
