/* EAN Finder - Nowoczesny interfejs dla Apteka Puls */
/* Autor: ledniowski.com | Licencja: Apteka Puls */

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --secondary-color: #6b7280;
    --success-color: #059669;
    --success-light: #d1fae5;
    --error-color: #dc2626;
    --error-light: #fee2e2;
    --warning-color: #d97706;
    --warning-light: #fef3c7;
    --background: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Modern Login Form */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: var(--space-md);
}

.login-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

/* Enhanced Form Elements */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--surface);
    font-weight: 500;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.form-input:hover {
    border-color: var(--primary-light);
}

/* Enhanced Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 0.5rem;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1d4ed8);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #4b5563);
    color: white;
    box-shadow: 0 4px 16px rgba(107, 114, 128, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.3);
}

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

/* Error action buttons - same style as btn-primary */
.btn-error-retry {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-error-retry:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.btn-error-show {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-error-show:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1d4ed8);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.btn-select-url {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-select-url:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Dashboard */
.dashboard {
    padding: 2rem 0;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Enhanced EAN Input Card */
.input-card {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    margin-bottom: var(--space-2xl);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.input-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.input-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.input-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.input-icon {
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.input-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ean-form {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.ean-input-group {
    flex: 1;
}

.ean-input {
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* Pipeline Visualization */
.pipeline-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.pipeline-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.pipeline-icon {
    width: 2rem;
    height: 2rem;
    background: var(--success-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.pipeline-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pipeline-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.step {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    transition: all 0.3s;
    position: relative;
}

.step.active {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.step.completed {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.step.error {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    justify-content: space-between;
}

.step-number-digit {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    background: var(--border);
    color: var(--text-muted);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    animation: pulse-glow 2s infinite;
}

.step.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.2);
}

.step.success .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.2);
}

.step.error .step-number {
    background: var(--error-color);
    border-color: var(--error-color);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2);
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1);
    }
}

.step-title {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.step-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.step-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--secondary-color);
}

.status-pending .status-dot {
    background: var(--secondary-color);
}

.status-processing .status-dot {
    background: var(--warning-color);
    animation: pulse 2s infinite;
}

.status-success .status-dot {
    background: var(--success-color);
}

.status-error .status-dot {
    background: var(--error-color);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Error Diagnostics */
.error-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-left: 4px solid var(--error-color);
}

.error-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.error-icon {
    width: 2rem;
    height: 2rem;
    background: var(--error-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.error-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.error-content {
    display: grid;
    gap: 1.5rem;
}

.error-agent,
.error-type,
.error-description,
.error-suggestions,
.error-raw {
    padding: 1rem;
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.error-agent-title,
.error-type-title,
.error-description-title,
.error-suggestions-title,
.error-raw-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.error-agent-value,
.error-type-value {
    color: var(--text-secondary);
    font-weight: 500;
}

.error-type-value {
    color: var(--error-color);
    font-weight: 600;
}

.error-description-value {
    color: var(--text-primary);
    line-height: 1.6;
}

.error-suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-suggestions-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.error-suggestions-list li:last-child {
    border-bottom: none;
}

.error-suggestions-list li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.error-raw-value {
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.75rem;
    border-radius: var(--radius);
}

/* Results */
.results-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.results-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.results-icon {
    width: 2rem;
    height: 2rem;
    background: var(--success-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.result-section-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-content {
    color: var(--text-secondary);
    font-family: 'Calibri', 'Arial', sans-serif;
    font-size: 12pt;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Loading States */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #92400e;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .dashboard {
        padding: 1rem 0;
    }
    
    .input-card,
    .pipeline-card,
    .results-card {
        padding: 1.5rem;
    }
    
    .pipeline-steps {
        grid-template-columns: 1fr;
    }
    
    .ean-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Category Badges */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-lek {
    background-color: var(--error-light);
    color: var(--error-color);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.badge-kosmetyk {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-suplement {
    background-color: var(--success-light);
    color: var(--success-color);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-sprzet {
    background-color: #f3e8ff;
    color: #6b21a8;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-unknown {
    background-color: var(--surface-soft);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}

/* Quality Badges for Promptimize */
.quality-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    transition: all 0.2s ease;
}

.quality-excellent {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #10b981;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

.quality-good {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
}

.quality-average {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #9a3412;
    border: 1px solid #ea580c;
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.1);
}

.quality-poor {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #ef4444;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.1);
}

.quality-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Quality Display Section */
.quality-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.quality-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.quality-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quality-details p {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

.quality-details p:last-child {
    border-bottom: none;
}

.quality-details strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Text Formatting */
.result-content br {
    margin-bottom: 0.5rem;
}

.result-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Step Details */
.step-details {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--success-color);
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

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

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 100px;
    flex-shrink: 0;
}

.detail-value {
    color: var(--text-secondary);
    font-size: 0.875rem;
    word-break: break-word;
}

.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.detail-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.link-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

.detail-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--surface-soft);
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.detail-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.detail-text h1, .detail-text h2, .detail-text h3, .detail-text h4, .detail-text h5, .detail-text h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.detail-text h1 { font-size: 1.125rem; }
.detail-text h2 { font-size: 1rem; }
.detail-text h3 { font-size: 0.875rem; }

.detail-text p {
    margin: 0.5rem 0;
}

.detail-text ul, .detail-text ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.detail-text li {
    margin: 0.25rem 0;
}

/* Pipeline Layout - Vertical Stack */
.pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

/* Strzałki przepływu między agentami */
.step::after {
    content: '';
    position: absolute;
    bottom: -1.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid var(--border);
    transition: all 0.3s ease;
    opacity: 0;
}

.step:not(:last-child)::after {
    opacity: 1;
}

.step.active::after {
    border-top-color: var(--primary-color);
    animation: arrow-pulse 2s infinite;
}

.step.completed::after {
    border-top-color: var(--success-color);
}

.step.error::after {
    border-top-color: var(--error-color);
}

@keyframes arrow-pulse {
    0%, 100% { 
        border-top-color: var(--primary-color);
        transform: translateX(-50%) scale(1);
    }
    50% { 
        border-top-color: var(--primary-dark);
        transform: translateX(-50%) scale(1.1);
    }
}

.step {
    background: var(--surface-soft);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

.step::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.step.active::before {
    left: 100%;
}

.step.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-light), rgba(59, 130, 246, 0.05));
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 8px 25px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
    animation: active-glow 2s infinite;
}

.step.completed {
    border-color: var(--success-color);
    background: linear-gradient(135deg, var(--success-light), rgba(5, 150, 105, 0.05));
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1), 0 8px 25px rgba(5, 150, 105, 0.15);
    transform: translateY(-1px);
}

.step.error {
    border-color: var(--error-color);
    background: linear-gradient(135deg, var(--error-light), rgba(220, 38, 38, 0.05));
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1), 0 8px 25px rgba(220, 38, 38, 0.15);
    transform: translateY(-1px);
    animation: error-shake 0.5s ease-in-out;
}

@keyframes active-glow {
    0%, 100% { 
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 8px 25px rgba(59, 130, 246, 0.15);
    }
    50% { 
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.2), 0 12px 30px rgba(59, 130, 246, 0.25);
    }
}

@keyframes error-shake {
    0%, 100% { transform: translateY(-1px) translateX(0); }
    25% { transform: translateY(-1px) translateX(-5px); }
    75% { transform: translateY(-1px) translateX(5px); }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes success-pulse {
    0% { transform: translateY(-1px) scale(1); }
    50% { transform: translateY(-1px) scale(1.05); }
    100% { transform: translateY(-1px) scale(1); }
}

/* Efekt neonu dla sukcesu */
.neon-success {
    position: relative;
    animation: neon-glow 3s ease-out;
}

.neon-success::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, #10b981, #34d399, #6ee7b7, #34d399, #10b981);
    border-radius: var(--radius-lg);
    z-index: -1;
    animation: neon-rotate 3s linear;
}

.neon-number {
    background: #10b981 !important;
    color: white !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), 0 0 40px rgba(16, 185, 129, 0.4) !important;
    animation: neon-number-pulse 3s ease-out;
}

@keyframes neon-glow {
    0% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), 0 0 40px rgba(16, 185, 129, 0.4);
    }
    100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.5);
    }
}

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

@keyframes neon-number-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.8), 0 0 40px rgba(16, 185, 129, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(16, 185, 129, 1), 0 0 60px rgba(16, 185, 129, 0.6);
    }
}

/* Dodatkowe efekty dla lepszej wizualizacji */
.step.processing {
    position: relative;
    overflow: hidden;
}

.step.processing::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    animation: shimmer 2s infinite;
}

/* Efekt ładowania dla statusu processing */
.status-processing .status-dot {
    animation: pulse 1s infinite, processing-glow 2s infinite;
}

@keyframes processing-glow {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.1);
    }
}

/* Lista kategorii w agencie 2.5 - kółka */
.categories-list {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-top: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    border: 2px solid var(--border);
    background: var(--surface-soft);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.category-item.selected {
    border-color: var(--success-color);
    background: var(--success-light);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    transform: translateY(-4px) scale(1.05);
}

.category-item.selected .category-name {
    color: var(--success-color);
    font-weight: 700;
}

.category-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-align: center;
    line-height: 1.2;
}

.category-description {
    display: none; /* Ukryj opis w widoku kółek */
}

.category-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-indicator::after {
    content: '✓';
    color: white;
    font-size: 10px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-item.selected .category-indicator {
    background: var(--success-color);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    animation: category-pulse 2s infinite;
}

.category-item.selected .category-indicator::after {
    opacity: 1;
}

@keyframes category-pulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 16px rgba(16, 185, 129, 0.6);
        transform: scale(1.1);
    }
}

/* Modern Logo and Branding Styles */
.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.main-logo {
    max-width: 240px;
    height: auto;
    object-fit: contain;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.footer-logo {
    max-width: 180px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
}

.footer-logo:hover {
    transform: translateY(-1px);
    opacity: 1;
}

/* =================================================================== */
/* 7. MORPHING AGENT ICONS */
/* =================================================================== */

.step-number {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--surface-soft);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.step-icon {
    font-size: 1.4rem;
    transition: all 0.3s ease;
    transform-origin: center;
    opacity: 0.9;
}

.step.active .step-icon {
    animation: icon-pulse 1.5s infinite;
    opacity: 1;
    transform: scale(1.1);
}

.step.completed .step-icon {
    opacity: 1;
    transform: scale(1.05);
}

.step.error .step-icon {
    animation: icon-shake 0.5s ease-in-out;
    opacity: 1;
}

@keyframes icon-pulse {
    0%, 100% { 
        transform: scale(1.1); 
        opacity: 1;
    }
    50% { 
        transform: scale(1.25); 
        opacity: 0.8;
    }
}

@keyframes icon-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* =================================================================== */
/* 10. MICRO-INTERACTIONS PACKAGE */
/* =================================================================== */

/* Button Press Feedback */
.btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: scale(0.98) translateY(0);
    transition: transform 0.1s ease;
}

/* Button Ripple Effect */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Input Focus Glow */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: scale(1.01);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.form-input:hover {
    transform: scale(1.005);
}

/* Loading States */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Card Hover Effects */
.step {
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Tooltip System */
[data-tooltip] {
    position: relative;
    cursor: help;
}

/* Buttons with tooltips should have pointer cursor */
button[data-tooltip],
.btn[data-tooltip] {
    cursor: pointer;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
}

/* Pulse Animation for Important Elements */
.pulse {
    animation: gentle-pulse 2s infinite;
}

@keyframes gentle-pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.02);
    }
}

.app-branding {
    text-align: center;
}

.app-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.app-version {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.header-logo-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-logo {
    max-width: 180px;
    height: auto;
    object-fit: contain;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

.header-logo-section .app-branding {
    text-align: left;
}

.header-logo-section .app-title {
    font-size: 1.5rem;
    margin: 0;
}

.header-logo-section .app-version {
    font-size: 0.625rem;
    margin-top: 0.25rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
}


.login-footer {
    margin-top: 2.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.author-info {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.license-info {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Enhanced spacing system based on 8px grid */
:root {
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    --space-2xl: 3rem;     /* 48px */
    --space-3xl: 4rem;     /* 64px */
}

/* Responsive logo adjustments */
@media (max-width: 768px) {
    .header-logo-section {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
    
    .header-logo {
        max-width: 150px;
    }
    
    .main-logo {
        max-width: 200px;
    }
    
    .footer-logo {
        max-width: 120px;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
    
    .header-logo-section .app-title {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .main-logo {
        max-width: 180px;
    }
    
    .app-title {
        font-size: 1.375rem;
    }
    
    .header-logo-section .app-title {
        font-size: 1rem;
    }
}

/* Dark mode disabled - keeping light theme */

/* Retry Button Styles */
.retry-btn {
    background: var(--warning-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
}

.retry-btn:hover {
    background: #b45309;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.retry-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
}

.retry-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.retry-btn.loading {
    background: var(--primary-color);
    cursor: not-allowed;
}

.retry-btn.loading::after {
    content: '';
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

/* Export buttons styles */
.export-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 140px;
    justify-content: center;
}

.btn-word {
    background: #2563eb;
    color: white;
    border: 1px solid #2563eb;
}

.btn-word:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-pdf {
    background: #dc2626;
    color: white;
    border: 1px solid #dc2626;
}

.btn-pdf:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-export:disabled {
    background: var(--text-muted);
    border-color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-export.loading {
    cursor: not-allowed;
    position: relative;
}

.btn-export.loading::after {
    content: '';
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

.btn-export.loading .btn-text {
    opacity: 0.7;
}

/* Responsive design for export buttons */
@media (max-width: 640px) {
    .export-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-export {
        min-width: auto;
        width: 100%;
    }
}

/* Export success/error states */
.export-success {
    background: var(--success-light);
    border-color: var(--success-color);
    color: var(--success-color);
}

.export-error {
    background: var(--error-light);
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Agent 4 Verification UI Components */

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 3rem;
    height: 1.5rem;
    background: var(--border);
    border-radius: 0.75rem;
    transition: background-color 0.2s ease;
    border: 2px solid var(--border);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0.25rem;
    width: 1rem;
    height: 1rem;
    background: white;
    border-radius: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translate(1.5rem, -50%);
}

.toggle-label {
    flex: 1;
    font-weight: 500;
}

/* Verification Button */
.verification-btn {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.verification-btn .btn {
    min-width: 140px;
}

/* Quality Assessment */
.quality-assessment {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--surface-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.assessment-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.assessment-btn {
    min-width: 120px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
}

.assessment-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

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

/* Comment Section */
.comment-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.comment-section .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.comment-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.char-count {
    color: var(--text-secondary);
    font-weight: 500;
}

.char-count.valid {
    color: var(--success-color);
}

.char-count.invalid {
    color: var(--error-color);
}

.comment-error {
    color: var(--error-color);
    font-weight: 500;
}

/* Comment validation states */
.form-textarea.valid {
    border-color: var(--success-color);
}

.form-textarea.invalid {
    border-color: var(--error-color);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .assessment-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .assessment-btn {
        width: 100%;
    }

    .toggle-switch {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .toggle-slider {
        width: 3.5rem;
        height: 1.75rem;
    }

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translate(1.75rem, -50%);
    }
}

/* Horizontal Pipeline Visualization */
@media (min-width: 1024px) {
    .pipeline-steps {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        align-items: flex-start; /* Wyrównanie do góry, bo karty mogą mieć różną wysokość po rozwinięciu */
        overflow-x: auto; /* Przewijanie jeśli się nie zmieści */
        padding-bottom: 2rem; /* Miejsce na cień/strzałki */
        padding-top: 1rem;
    }

    .step {
        flex: 1;
        min-width: 200px; /* Minimalna szerokość karty */
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }
    
    /* Ukrycie szczegółów w widoku poziomym, aby nie rozwalały layoutu? 
       Nie, chcemy je widzieć, ale może w zgrabniejszej formie. 
       Na razie zostawiamy standardowe rozwijanie. */

    /* Strzałki poziome */
    .step::after {
        content: '';
        position: absolute;
        top: 50%; /* Środek wysokości */
        right: -1rem; /* Przesunięcie w prawo */
        bottom: auto;
        left: auto;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-left: 15px solid var(--border); /* Strzałka w prawo */
        border-right: none;
        transition: all 0.3s ease;
        opacity: 0;
        z-index: 10;
    }

    .step:not(:last-child)::after {
        opacity: 1;
    }

    .step.active::after {
        border-left-color: var(--primary-color);
        animation: arrow-pulse-horizontal 2s infinite;
    }
    
    .step.completed::after {
        border-left-color: var(--success-color);
    }
    
    .step.error::after {
        border-left-color: var(--error-color);
    }

    @keyframes arrow-pulse-horizontal {
        0%, 100% { 
            border-left-color: var(--primary-color);
            transform: translateY(-50%) scale(1);
        }
        50% { 
            border-left-color: var(--primary-dark);
            transform: translateY(-50%) scale(1.2);
        }
    }
    
    /* Ukrycie starej strzałki pionowej (jeśli była na pseudo-elemencie) */
    /* W CSS style.css była definicja: .step::after { bottom: -1.75rem; left: 50%; ... } */
    /* Nadpisujemy ją powyżej, zmieniając bottom/left/top/right */
}

/* Safety Scorecard Styles */
.safety-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    margin-bottom: 2rem;
}

.safety-header {
    background: #f8fafc;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.safety-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.safety-icon {
    font-size: 2rem;
    background: #e0f2fe;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #0284c7;
}

.safety-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.safety-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.safety-score-container {
    text-align: center;
}

.safety-score-circle {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: white;
    border: 4px solid #10b981; /* Default green */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.safety-score-circle.score-high { border-color: #10b981; color: #10b981; }
.safety-score-circle.score-medium { border-color: #f59e0b; color: #f59e0b; }
.safety-score-circle.score-low { border-color: #ef4444; color: #ef4444; }

#safetyScoreValue {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.safety-score-max {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.safety-score-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #64748b;
    margin-top: 0.25rem;
}

.safety-body {
    padding: 2rem;
}

/* Metrics Grid */
.safety-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

.metric-bar-bg {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 1s ease-out;
}

/* General Report */
.safety-report-block {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 2rem;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.6;
}

.safety-report-block strong {
    color: #0c4a6e;
}

/* Issues List */
.safety-issues-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.safety-issue-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: transform 0.2s;
}

.safety-issue-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.safety-issue-item.severity-high {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.safety-issue-item.severity-medium {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.safety-issue-item.severity-low {
    border-left: 4px solid #3b82f6;
    background: #eff6ff;
}

.issue-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.issue-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.issue-description {
    margin: 0;
    color: #475569;
    font-size: 0.875rem;
}

.issue-suggestion {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.875rem;
    color: #059669; /* Green for suggestion */
}

.issue-suggestion strong {
    font-weight: 600;
}

/* TIMELINE VIEW STYLES */

/* 1. Timeline Container & Bar */
.timeline-container {
    position: relative;
    margin-bottom: 2rem;
    padding: 1rem 0;
    width: 100%;
    overflow-x: auto;
}

.timeline-track {
    position: absolute;
    top: 2.5rem; /* Center vertically relative to icons */
    left: 40px;
    right: 40px;
    height: 4px;
    background: #e5e7eb;
    z-index: 0;
    border-radius: 2px;
}

.timeline-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    min-width: 600px; /* Ensure it doesn't collapse too much on mobile */
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.timeline-step:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.timeline-step.active {
    opacity: 1;
    transform: scale(1.05);
}

.timeline-step.active .timeline-icon {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #eff6ff;
}

.timeline-step.completed {
    opacity: 1;
}

.timeline-step.completed .timeline-icon {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.timeline-step.error .timeline-icon {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.timeline-step.processing .timeline-icon {
    border-color: #f59e0b;
    color: #f59e0b;
    background: #fffbeb;
    animation: pulse 2s infinite;
}

.timeline-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: white;
    border: 3px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #6b7280;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.timeline-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
    text-align: center;
}

.timeline-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
}

/* 2. Focus Detail Panel */
.focus-panel {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.focus-header {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.focus-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.focus-icon {
    font-size: 1.5rem;
    background: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.focus-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

.focus-status {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: #e5e7eb;
    color: #4b5563;
}

.focus-status.status-processing { background: #fffbeb; color: #d97706; border: 1px solid #fcd34d; }
.focus-status.status-success { background: #ecfdf5; color: #059669; border: 1px solid #6ee7b7; }
.focus-status.status-error { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; }

.focus-content {
    padding: 2rem;
    min-height: 300px;
}

/* Pipeline Placeholder */
.pipeline-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: #6b7280;
    text-align: center;
    font-size: 1.1rem;
}

/* Content Rows */
.detail-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-label {
    min-width: 150px;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.95rem;
}

.detail-value-large {
    font-size: 1.1rem;
    color: #1f2937;
    font-weight: 500;
    word-break: break-word; /* Ensures text wraps instead of overflowing or vertical stacking */
    line-height: 1.6;
    flex: 1;
}

.link-text {
    color: #3b82f6;
    text-decoration: none;
}
.link-text:hover { text-decoration: underline; }

.detail-block {
    margin-top: 1.5rem;
}

.detail-label-block {
    display: block;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.detail-text-block {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-family: 'Calibri', sans-serif;
    font-size: 12pt;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap; /* Preserves formatting but wraps text */
    max-height: 500px;
    overflow-y: auto;
}

/* Action Buttons Row */
.action-buttons-row {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.btn-edit {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}
.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .detail-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .detail-label {
        min-width: auto;
        font-size: 0.85rem;
    }
}

/* Stepper & Focus View Styles */

/* Container */
.pipeline-container {
    background: transparent;
    margin-bottom: 2rem;
}

/* 1. Stepper Navigation */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

/* Line connecting steps */
.stepper-line {
    position: absolute;
    top: 24px; /* Half of circle height (48px/2) */
    left: 0;
    right: 0;
    height: 4px;
    background: #e2e8f0;
    z-index: 0;
    transform: translateY(-50%);
    margin: 0 2rem; /* Don't touch edges */
}

.stepper-item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7; /* Inactive state */
}

.stepper-item:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.stepper-item.active {
    opacity: 1;
}

.stepper-item.active .step-circle {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    transform: scale(1.1);
}

.stepper-item.completed .step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.stepper-item.processing .step-circle {
    border-color: var(--warning-color);
    animation: pulse-border 2s infinite;
}

.stepper-item.error .step-circle {
    border-color: var(--error-color);
    background: #fee2e2;
    color: var(--error-color);
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 3px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.stepper-item.active .step-label {
    color: var(--primary-color);
}

.stepper-item.completed .step-label {
    color: var(--success-color);
}

/* 2. Focus Panel */
.focus-panel-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    min-height: 300px;
    position: relative;
}

.focus-pane {
    display: none; /* Hidden by default */
    padding: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.focus-pane.active {
    display: block;
}

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

/* Pane Header */
.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.pane-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
}

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
}

.status-badge.processing { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.status-badge.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.status-badge.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* Pane Content */
.pane-description {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.detail-row {
    display: flex;
    margin-bottom: 1rem;
    align-items: baseline;
    border-bottom: 1px solid #f8fafc;
    padding-bottom: 0.5rem;
}

.detail-row .label {
    min-width: 150px;
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.875rem;
}

.detail-row .value {
    font-family: 'Monaco', monospace;
    color: #334155;
    font-size: 0.95rem;
    word-break: break-all;
}

.detail-row .link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.detail-row .link:hover {
    text-decoration: underline;
}

/* Code Blocks / Text Areas */
.detail-box {
    margin-top: 1.5rem;
}

.detail-box h4, .detail-box .label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
}

.code-block, .content-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', monospace;
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.6;
    white-space: pre-wrap;
}

.scrollable {
    max-height: 400px;
    overflow-y: auto;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #94a3b8;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Large Category Badge */
.category-display-large {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.category-badge-large {
    font-size: 2rem;
    padding: 1rem 3rem;
    border-radius: 16px;
    font-weight: 800;
    letter-spacing: 0.1em;
    background: #f1f5f9;
    color: #94a3b8;
}

/* Buttons */
.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 8px;
}

.btn-white {
    background: white;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.btn-white:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Responsywność */
@media (max-width: 768px) {
    .stepper-label { display: none; } /* Ukryj etykiety na mobilkach */
    .step-circle { width: 40px; height: 40px; font-size: 1.2rem; }
    .stepper-wrapper { padding: 0; }
}

/* Grid Dashboard Styles */

.pipeline-grid-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Summary Row */
.pipeline-summary-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.summary-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

/* Grid Layout */
.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive columns */
    gap: 1.5rem;
}

.full-width {
    grid-column: 1 / -1; /* Span full width */
}

/* Info Card */
.info-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.info-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.info-card.active-card {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.card-header {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.card-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
}

/* Status Indicators */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.pending { background-color: #cbd5e1; }
.status-dot.processing { background-color: #f59e0b; animation: pulse 1s infinite; }
.status-dot.success { background-color: #10b981; }
.status-dot.error { background-color: #ef4444; }
.status-dot.queued { background-color: #8b5cf6; }
.status-dot.stuck { background-color: #f97316; animation: pulse 1s infinite; }

.status-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}
.status-badge.pending { background: #f1f5f9; color: #64748b; }
.status-badge.processing { background: #fff7ed; color: #c2410c; }
.status-badge.success { background: #f0fdf4; color: #15803d; }
.status-badge.queued { background: #f3e8ff; color: #7c3aed; }
.status-badge.stuck { background: #fff7ed; color: #ea580c; }

/* Card Body */
.card-body {
    padding: 1rem;
    flex: 1;
    font-size: 0.9rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    align-items: center;
}

.data-label {
    color: #64748b;
    font-weight: 500;
}

.data-value {
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

.data-link {
    color: var(--primary-color);
    text-decoration: none;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.data-link:hover { text-decoration: underline; }

.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges */
.category-badge-medium {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid #bae6fd;
}

.centered-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 60px;
}

/* Text Previews */
.text-preview-small {
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #475569;
    max-height: 80px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.text-preview-large {
    background: #fff;
    padding: 1rem;
    border-radius: 6px;
    font-size: 12pt;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Calibri', sans-serif;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Toolbar */
.action-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.btn-mini {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary-outline {
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
}
.btn-primary-outline:hover { background: var(--primary-light); }

.btn-outline {
    border: 1px solid #cbd5e1;
    background: white;
    color: #475569;
}
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }

/* Utilities */
.hidden { display: none !important; }

.issues-preview {
    font-size: 0.85rem;
}

.assessment-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.form-input-mini {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 100%;
}

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

/* Grid Dashboard Styles */

.pipeline-grid-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Summary Row */
.pipeline-summary-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.summary-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

/* Grid Layout */
.pipeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive columns */
    gap: 1.5rem;
}

.full-width {
    grid-column: 1 / -1; /* Span full width */
}

/* Info Card */
.info-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.info-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.info-card.active-card {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.card-header {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.card-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
}

/* Status Indicators */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.pending { background-color: #cbd5e1; }
.status-dot.processing { background-color: #f59e0b; animation: pulse 1s infinite; }
.status-dot.success { background-color: #10b981; }
.status-dot.error { background-color: #ef4444; }
.status-dot.queued { background-color: #8b5cf6; }
.status-dot.stuck { background-color: #f97316; animation: pulse 1s infinite; }

.status-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}
.status-badge.pending { background: #f1f5f9; color: #64748b; }
.status-badge.processing { background: #fff7ed; color: #c2410c; }
.status-badge.success { background: #f0fdf4; color: #15803d; }
.status-badge.queued { background: #f3e8ff; color: #7c3aed; }
.status-badge.stuck { background: #fff7ed; color: #ea580c; }

/* Card Body */
.card-body {
    padding: 1rem;
    flex: 1;
    font-size: 0.9rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    align-items: center;
}

.data-label {
    color: #64748b;
    font-weight: 500;
}

.data-value {
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

.data-link {
    color: var(--primary-color);
    text-decoration: none;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.data-link:hover { text-decoration: underline; }

.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges */
.category-badge-medium {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid #bae6fd;
}

.centered-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 60px;
}

/* Text Previews */
.text-preview-small {
    background: #f8fafc;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #475569;
    max-height: 80px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.text-preview-large {
    background: #fff;
    padding: 1rem;
    border-radius: 6px;
    font-size: 12pt;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Calibri', sans-serif;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Toolbar */
.action-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.btn-mini {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary-outline {
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
}
.btn-primary-outline:hover { background: var(--primary-light); }

.btn-outline {
    border: 1px solid #cbd5e1;
    background: white;
    color: #475569;
}
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }

/* Utilities */
.hidden { display: none !important; }

.issues-preview {
    font-size: 0.85rem;
}

.assessment-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.form-input-mini {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 100%;
}

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

/* ============================= */
/* MULTI EAN STYLES              */
/* ============================= */

/* Toggle Switch Inline */
.multi-ean-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.toggle-switch-inline {
    position: relative;
    width: 48px;
    height: 24px;
    display: inline-block;
}

.toggle-switch-inline input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider-inline {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #e5e7eb;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider-inline:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider-inline {
    background: var(--primary-color);
}

input:checked + .toggle-slider-inline:before {
    transform: translateX(24px);
}

.toggle-label-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Multi EAN Input */
.multi-ean-input {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Multi EAN Container */
.multi-ean-container {
    background: var(--surface);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.multi-ean-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.multi-ean-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.multi-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.multi-stats .stat-success {
    color: var(--success-color);
    font-weight: 600;
}

.multi-stats .stat-error {
    color: var(--error-color);
    font-weight: 600;
}

/* Sorting Controls */
.sorting-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
}

.sorting-label {
    font-size: 13px;
    color: var(--text-muted);
}

.sort-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
}

.sort-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* EAN Item Row */
.multi-ean-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ean-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface-soft);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.ean-item:hover {
    border-color: var(--primary-light);
    background: white;
    transform: translateX(4px);
}

.ean-item.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.ean-item.success {
    border-left: 4px solid var(--success-color);
    background: var(--success-light);
}

.ean-item.error {
    border-left: 4px solid var(--error-color);
    background: var(--error-light);
}

.ean-item.processing {
    border-left: 4px solid var(--warning-color);
    background: var(--warning-light);
}

.ean-item.queued {
    border-left: 4px solid #8b5cf6;  /* Purple for queued */
    background: #f3e8ff;
}

.ean-item.stuck {
    border-left: 4px solid #f97316;  /* Orange for stuck */
    background: #fff7ed;
}

.ean-item-index {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    margin-right: 12px;
    flex-shrink: 0;
}

.ean-item.success .ean-item-index {
    background: var(--success-color);
}

.ean-item.error .ean-item-index {
    background: var(--error-color);
}

.ean-item.queued .ean-item-index {
    background: #8b5cf6;
}

.ean-item.stuck .ean-item-index {
    background: #f97316;
}

.ean-item-code {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    width: 170px;
    flex-shrink: 0;
}

.ean-item-progress {
    flex: 1;
    margin: 0 16px;
    min-width: 100px;
}

.progress-bar-mini {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    transition: width 0.3s ease;
    border-radius: 4px;
}

.ean-item.success .progress-bar-mini-fill {
    background: linear-gradient(90deg, var(--success-color), #047857);
}

.ean-item.error .progress-bar-mini-fill {
    background: linear-gradient(90deg, var(--error-color), #991b1b);
}

.ean-item-status {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: flex-end;
}

.ean-item-agent {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.ean-item.processing .ean-item-agent {
    color: var(--warning-color);
}

.ean-item.success .ean-item-agent {
    color: var(--success-color);
}

.ean-item.error .ean-item-agent {
    color: var(--error-color);
}

.ean-item.queued .ean-item-agent {
    color: #8b5cf6;
}

.ean-item.queued .progress-bar-mini-fill {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.ean-item.stuck .ean-item-agent {
    color: #f97316;
}

.ean-item.stuck .progress-bar-mini-fill {
    background: linear-gradient(90deg, #f97316, #ea580c);
}

/* Body state when modal is open */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Fullscreen Modal */
.modal-fullscreen {
    z-index: 10000;
}

.modal-fullscreen-content {
    width: 95vw;
    max-width: 1200px;
    height: 90vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.modal-fullscreen-content .modal-header {
    flex-shrink: 0;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.modal-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    overscroll-behavior: contain; /* Prevent scroll from propagating to body */
}

/* Modal Results Section */
.modal-results-section {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.modal-results-section .result-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.modal-results-section .result-section-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.modal-results-section .seo-content-preview {
    line-height: 1.6;
}

.modal-results-section .seo-content-preview strong {
    font-weight: 600;
}

.modal-results-section .seo-content-preview p {
    margin-bottom: 12px;
}

/* Modal Agent Grid */
.modal-agent-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .modal-agent-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .modal-agent-grid {
        grid-template-columns: 1fr;
    }
}

.modal-agent-card {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s;
}

.modal-agent-card.active,
.modal-agent-card.processing {
    border-color: var(--warning-color);
    background: var(--warning-light);
}

.modal-agent-card.success {
    border-color: var(--success-color);
    background: var(--success-light);
}

.modal-agent-card.error {
    border-color: var(--error-color);
    background: var(--error-light);
}

.modal-agent-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.modal-agent-icon {
    font-size: 18px;
}

.modal-agent-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.modal-agent-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-agent-status {
    font-size: 12px;
    color: var(--text-muted);
}

.modal-agent-result {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal Error Actions */
.modal-error-actions {
    background: var(--error-light);
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    display: none; /* Hidden by default, shown via JS */
}

.modal-error-actions .error-message {
    font-size: 15px;
    color: #991b1b;
    margin-bottom: 16px;
    line-height: 1.5;
    font-weight: 500;
}

.error-action-buttons {
    display: flex;
    gap: 12px;
}

/* Modal SEO Result */
.modal-seo-result {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.modal-seo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
}

.modal-seo-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.modal-seo-content {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Calibri', sans-serif;
    font-size: 12pt;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Button Small */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.pending {
    background: #e5e7eb;
    color: var(--text-muted);
}

.status-badge.processing {
    background: var(--warning-light);
    color: var(--warning-color);
}

.status-badge.success {
    background: var(--success-light);
    color: var(--success-color);
}

.status-badge.error {
    background: var(--error-light);
    color: var(--error-color);
}

/* Responsive Multi EAN */
@media (max-width: 768px) {
    .multi-ean-toggle {
        margin-left: 0;
        margin-top: 10px;
    }

    .input-header {
        flex-wrap: wrap;
    }

    .ean-item {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ean-item-code {
        width: auto;
    }

    .ean-item-progress {
        width: 100%;
        margin: 0;
        order: 3;
    }

    .ean-item-status {
        min-width: auto;
    }
}

/* =============================================================================
   EAN MODE BUTTONS (Single/Multi EAN)
   ============================================================================= */

.ean-mode-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.ean-mode-buttons .btn {
    min-width: 120px;
}

/* Centered EAN Mode Buttons Container */
.ean-mode-buttons-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 20px 0 24px 0;
}

.btn-mode {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    min-width: 180px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

/* Multi EAN Validation Styles */
.multi-ean-validation {
    margin-bottom: 8px;
    min-height: 0;
}

.multi-ean-validation-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 14px;
    margin-bottom: 8px;
}

.validation-count {
    color: #64748b;
    font-weight: 500;
}

.validation-valid {
    color: #22c55e;
    font-weight: 600;
}

.validation-invalid {
    color: #ef4444;
    font-weight: 600;
}

.multi-ean-validation-errors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.validation-error-item {
    background: #fef2f2;
    color: #dc2626;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid #fecaca;
}

/* EAN Input Row - Horizontal Layout */
.ean-input-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.ean-input-wrapper {
    flex: 1;
}

.btn-submit-ean {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    height: fit-content;
    margin-bottom: 0;
}
