@import 'base.css';

/* Demo Pages Shared Styles */

body {
    background: var(--gradient);
    min-height: 100vh;
    padding: 20px;
}

.demo-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
.demo-header {
    background: var(--gradient);
    color: white;
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.demo-logo {
    display: flex;
    align-items: center;
}

.logo-text {
    font-family: "Jost", sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
}

.header-divider {
    width: 2px;
    height: 32px;
    background: rgba(255, 255, 255, 0.3);
}

.demo-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

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

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.back-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 1;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

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

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

.btn-secondary {
    background: var(--bg-gray-100);
    color: var(--text-tertiary);
}

.btn-secondary:hover {
    background: var(--border);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease-out;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.info {
    border-left: 4px solid var(--info);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-box {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-box h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Task Queue Styles */
.task-queue-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 700px;
}

.queue-sidebar {
    background: var(--bg-light);
    padding: 24px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

/* Queue Stats */
.queue-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: transform 0.3s;
}

.stat-card.completed-stat {
    border-color: var(--success);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.completed-stat .stat-value {
    color: var(--success);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Queue Sections */
.queue-section {
    margin-bottom: 24px;
}

.queue-section h3 {
    color: var(--text-primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-left: 8px;
    font-weight: 600;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.queue-item {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.queue-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.queue-item.active {
    border-color: var(--primary);
    background: var(--primary-tint);
    box-shadow: 0 2px 8px hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.2);
}

.queue-item.completed {
    opacity: 0.8;
}

.queue-item.completed:hover {
    opacity: 1;
}

.queue-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.queue-icon {
    font-size: 16px;
}

.queue-priority {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.queue-priority.high {
    background: var(--error-bg);
    color: var(--error);
}

.queue-priority.normal {
    background: var(--info-bg);
    color: var(--info-dark);
}

.queue-status {
    background: var(--success-bg);
    color: var(--success-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.queue-item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 6px;
}

.queue-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
}

.queue-time {
    font-style: italic;
}

/* Task Details Panel */
.task-details-panel {
    background: white;
    padding: 40px;
    overflow-y: auto;
}

.task-detail {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.task-detail.active {
    display: block;
}

.detail-header {
    border-bottom: 2px solid var(--border);
    padding-bottom: 24px;
    margin-bottom: 32px;
}

.detail-title-section h2 {
    color: var(--text-primary);
    font-size: 24px;
    margin: 12px 0 8px 0;
}

.task-type-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.task-type-badge.request {
    background: var(--info-bg);
    color: var(--info-dark);
}

.task-type-badge.invoice {
    background: var(--warning-bg);
    color: var(--warning-dark);
}

.task-type-badge.completed-badge {
    background: var(--success-bg);
    color: var(--success-dark);
}

.task-type-badge.email {
    background: var(--primary-tint-2);
    color: var(--primary-dark);
}

.detail-content {
    max-width: 800px;
}

.request-details-box,
.invoice-details-box,
.attached-docs-box,
.completion-details-box {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.request-details-box h3,
.invoice-details-box h3,
.attached-docs-box h3,
.completion-details-box h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    text-align: right;
}

.detail-value.success {
    color: var(--success);
}

.invoice-table {
    background: white;
    border-radius: 8px;
    padding: 16px;
}

.invoice-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    color: var(--text-tertiary);
    font-size: 14px;
    border-bottom: 1px solid var(--bg-gray-100);
}

.invoice-row:last-child {
    border-bottom: none;
}

.invoice-row.total {
    border-top: 2px solid var(--border-strong);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 16px;
}

.docs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.confidence {
    color: var(--success);
    font-size: 12px;
    font-weight: 500;
}

/* Knowledge Base Styles */
.kb-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 600px;
}

.kb-sidebar {
    background: var(--bg-light);
    padding: 24px;
    border-right: 1px solid var(--border);
}

.kb-sidebar h3, .kb-sidebar h4 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-tree {
    margin-bottom: 32px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    margin-bottom: 4px;
}

.category-item:hover {
    background: var(--border);
}

.category-item.active {
    background: var(--primary-tint);
    color: var(--primary);
}

.category-icon {
    font-size: 16px;
}

.category-item span:nth-child(2) {
    flex: 1;
    font-size: 14px;
}

.doc-count {
    background: var(--border);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.auto-categorization-demo {
    margin-top: 32px;
}

.upload-zone {
    border: 2px dashed var(--border-strong);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

.upload-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.upload-zone p {
    font-size: 12px;
    color: var(--text-secondary);
}

.kb-main {
    padding: 32px;
}

.kb-chat {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 32px;
}

.chat-messages {
    padding: 24px;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message-content {
    background: var(--bg-gray-100);
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
}

.chat-message.user .message-content {
    background: var(--primary);
    color: white;
}

.message-content p {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.sources-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.sources-section ul {
    list-style: none;
    margin-top: 8px;
}

.sources-section li {
    margin-bottom: 6px;
}

.source-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
}

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

.source-category {
    color: var(--text-secondary);
    font-size: 12px;
}

.chat-input-container {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.chat-input-container input {
    flex: 1;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
}

.send-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.send-btn:hover {
    background: var(--primary-dark);
}

.suggested-questions {
    padding: 16px 24px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
}

.suggestion-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.suggestion-pill {
    background: white;
    border: 1px solid var(--border-strong);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.suggestion-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.recent-documents h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.doc-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.doc-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

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

.doc-icon {
    font-size: 24px;
}

.doc-category {
    background: var(--bg-gray-100);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.doc-card h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 14px;
}

.doc-meta {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 12px;
}

.doc-access {
    margin-top: 12px;
}

.access-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.access-badge.all {
    background: var(--success-bg);
    color: var(--success-dark);
}

.access-badge.restricted {
    background: var(--warning-bg);
    color: var(--warning-dark);
}

.access-badge.manager {
    background: var(--info-bg);
    color: var(--info-dark);
}

.access-badge.customer {
    background: var(--primary-tint-2);
    color: var(--primary-dark);
}

.access-level-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.access-level-switcher label {
    font-size: 14px;
}

.access-level-switcher select {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.upload-progress {
    text-align: center;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.file-icon {
    font-size: 32px;
}

.file-name {
    font-size: 14px;
    color: var(--text-tertiary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease-out;
    animation: progressAnimation 2s ease-out forwards;
}

@keyframes progressAnimation {
    to { width: 100%; }
}

.progress-text {
    color: var(--text-secondary);
    font-size: 14px;
}

.categorization-result {
    text-align: left;
}

.detected-info {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.detected-info p {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-tertiary);
}

.suggested-categories p, .suggested-tags p {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.category-suggestions, .tag-cloud {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.category-tag {
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.category-tag:hover {
    border-color: var(--primary);
}

.category-tag.selected {
    border-color: var(--primary);
    background: var(--primary-tint);
    color: var(--primary);
}

.tag {
    background: var(--border);
    color: var(--text-tertiary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.access-suggestion {
    margin-top: 16px;
}

.access-suggestion p {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.access-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: 14px;
}

/* Report Generation Styles */
.report-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 700px;
}

.report-sidebar {
    background: var(--bg-light);
    padding: 24px;
    border-right: 1px solid var(--border);
}

.report-sidebar h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 16px;
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, background-color 0.2s;
}

.template-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.template-card.active {
    border-color: var(--primary);
    background: var(--primary-tint);
}

.template-icon {
    font-size: 28px;
}

.template-info h4 {
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 14px;
}

.template-info p {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.report-main {
    padding: 40px;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

.wizard-step h2 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 24px;
}

.step-description {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.form-section {
    max-width: 600px;
}

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

.form-group label {
    display: block;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group select, .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: 14px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-tertiary);
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
}

.wizard-actions {
    margin-top: 32px;
}

.question-list {
    max-width: 700px;
}

.ai-question {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    transition: opacity 0.3s, transform 0.3s;
}

.question-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.question-content {
    flex: 1;
}

.question-text {
    color: var(--text-tertiary);
    margin-bottom: 16px;
    line-height: 1.6;
}

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

.processing-animation {
    max-width: 600px;
    margin: 40px auto;
}

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

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

.processing-steps {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.processing-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.processing-step.active {
    color: var(--primary);
    font-weight: 500;
}

.processing-step.completed {
    color: var(--success);
}

.step-icon {
    width: 24px;
    text-align: center;
    font-weight: bold;
}

.report-preview {
    max-width: 800px;
}

.preview-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 32px;
}

.preview-icon {
    font-size: 64px;
}

.preview-info h3 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 4px;
}

.preview-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.report-summary h4, .report-sections h4, .download-options h4 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.highlight-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.highlight-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.highlight-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.section-list {
    list-style: none;
    margin-bottom: 32px;
}

.section-list li {
    padding: 8px 0;
    color: var(--primary-dark);
    font-size: 14px;
}

.format-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.format-btn {
    flex: 1;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.format-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.format-icon {
    font-size: 32px;
}

.format-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
}

.email-form .form-group {
    margin-bottom: 16px;
}

.email-form textarea,
.message-preview textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .kb-layout, .report-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .kb-sidebar, .report-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .highlight-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .demo-container {
        overflow: visible;
    }

    .demo-header {
        padding: 16px 20px;
    }

    .header-left {
        gap: 12px;
    }

    .demo-header h1 {
        font-size: 16px;
    }

    .header-actions {
        gap: 8px;
    }

    .task-queue-layout,
    .correspondence-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .queue-sidebar,
    .correspondence-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .task-details-panel,
    .correspondence-main {
        padding: 20px;
    }

    .task-details-panel {
        display: none;
    }

    .queue-list > .task-detail {
        display: none;
        width: 100%;
        background: white;
        border: 2px solid var(--primary);
        border-radius: 8px;
        padding: 16px;
        box-sizing: border-box;
    }

    .queue-list > .task-detail.active {
        display: block;
        animation: fadeIn 0.3s ease-out;
    }

    .task-list, .kb-main, .report-main {
        padding: 20px;
    }

    .analysis-grid,
    .access-level-options {
        grid-template-columns: 1fr;
    }

    .drop-zone {
        padding: 32px 20px;
    }

    .message-content {
        max-width: 85%;
    }

    .document-grid {
        grid-template-columns: 1fr;
    }

    .highlight-grid {
        grid-template-columns: 1fr;
    }

    .format-buttons {
        flex-direction: column;
    }

    .notification {
        left: 10px;
        right: 10px;
        max-width: none;
        transform: translateY(-100px);
    }

    .notification.show {
        transform: translateY(0);
    }
}

/* Document Upload Demo Styles */
.upload-demo-layout {
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.upload-section {
    animation: fadeIn 0.3s ease-out;
}

.upload-intro {
    text-align: center;
    margin-bottom: 40px;
}

.upload-intro h2 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 24px;
}

.upload-intro p {
    color: var(--text-secondary);
    font-size: 16px;
}

.drop-zone {
    border: 3px dashed var(--border-strong);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    background: var(--bg-light);
    transition: border-color 0.3s, background-color 0.3s, transform 0.3s;
    cursor: pointer;
    margin-bottom: 40px;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: var(--bg-gray-100);
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-tint);
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.upload-icon-large {
    font-size: 64px;
}

.drop-zone h3 {
    color: var(--text-primary);
    font-size: 20px;
    margin: 0;
}

.drop-zone p {
    color: var(--text-secondary);
    margin: 0;
}

.supported-formats {
    margin-top: 8px;
}

.supported-formats small {
    color: var(--text-muted);
    font-size: 13px;
}

.sample-documents {
    margin-top: 40px;
}

.sample-documents h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 18px;
}

.sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.sample-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.sample-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sample-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.sample-info h4 {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

.sample-info p {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Analysis Section */
.analysis-section {
    animation: fadeIn 0.3s ease-out;
}

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

.analysis-header h2 {
    color: var(--text-primary);
    font-size: 24px;
}

.document-preview {
    margin-bottom: 32px;
}

.preview-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.preview-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.preview-details h3 {
    color: var(--text-primary);
    font-size: 18px;
    margin-bottom: 4px;
}

.preview-meta {
    color: var(--text-secondary);
    font-size: 14px;
}

.analysis-results {
    background: white;
}

.result-section {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.result-section h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 12px;
}

.section-hint {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
}

.detected-type {
    display: flex;
    gap: 16px;
    align-items: center;
}

.type-badge {
    background: var(--primary-tint);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
}

.confidence-score {
    color: var(--success);
    font-size: 14px;
    font-weight: 500;
}

.category-chips, .tag-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.chip {
    background: var(--bg-gray-100);
    border: 2px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

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

.chip.selected {
    background: var(--primary-tint);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

.tag-chip {
    background: var(--border);
    color: var(--text-tertiary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.remove-tag {
    cursor: pointer;
    font-weight: bold;
    color: var(--text-secondary);
}

.remove-tag:hover {
    color: var(--error);
}

.add-tag-btn {
    background: white;
    border: 1px dashed var(--border-strong);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.add-tag-btn:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

.highlight-section {
    border: 2px solid var(--primary);
    background: hsla(228, 100%, 99%, 1);
}

.required-badge {
    background: var(--error);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.access-level-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.access-option {
    cursor: pointer;
}

.access-option input[type="radio"] {
    display: none;
}

.access-card {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    background: white;
    transition: border-color 0.2s, transform 0.2s, background-color 0.2s;
    height: 100%;
}

.access-option:hover .access-card {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.access-option.selected .access-card,
.access-option input[type="radio"]:checked + .access-card {
    border-color: var(--primary);
    background: var(--primary-tint);
}

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

.access-icon {
    font-size: 24px;
}

.access-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.recommended-badge {
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: auto;
}

.access-description {
    color: var(--text-tertiary);
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.access-examples {
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
}

.collapsible .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.collapsible .section-header:hover {
    opacity: 0.8;
}

.toggle-icon {
    color: var(--text-secondary);
    font-size: 14px;
    transition: transform 0.2s;
}

.collapsible.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.section-content {
    margin-top: 16px;
}

.extracted-data {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 16px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.data-value {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.upload-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
}

/* Success Section */
.success-section {
    animation: fadeIn 0.3s ease-out;
}

.success-content {
    text-align: center;
    padding: 40px;
}

.success-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    font-size: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: successPulse 0.5s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.success-content h2 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 24px;
}

.success-content > p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 16px;
}

.success-summary {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.summary-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.summary-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Footer */
.demo-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    padding: 16px 32px;
    text-align: center;
}

.demo-footer p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

.footer-brand {
    font-family: "Jost", sans-serif;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Correspondence Tracking Styles */
.correspondence-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    min-height: 700px;
}

.correspondence-sidebar {
    background: var(--bg-light);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}

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

.sidebar-header h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0;
}

.unread-badge {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.email-list {
    padding: 12px;
}

.email-item {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, background-color 0.2s;
}

.email-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.email-item.active {
    border-color: var(--primary);
    background: var(--primary-tint);
}

.email-item.read {
    opacity: 0.7;
}

.email-item.read:hover,
.email-item.active {
    opacity: 1;
}

.email-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.sender-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.email-time {
    color: var(--text-secondary);
    font-size: 11px;
}

.email-subject {
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
}

.email-preview {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-tags {
    display: flex;
    gap: 6px;
}

.tag-unread {
    background: var(--info-bg);
    color: var(--info-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-processed {
    background: var(--success-bg);
    color: var(--success-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Correspondence Main Panel */
.correspondence-main {
    background: white;
    padding: 40px;
    overflow-y: auto;
}

.email-detail {
    display: none;
    max-width: 900px;
    animation: fadeIn 0.3s ease-out;
}

.email-detail.active {
    display: block;
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

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

.sender-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.sender-info h2 {
    color: var(--text-primary);
    font-size: 20px;
    margin: 0 0 4px 0;
}

.sender-email {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.email-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.email-subject-line {
    margin-bottom: 24px;
}

.email-subject-line h3 {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.ai-analysis {
    background: hsla(204, 100%, 97%, 1);
    border: 1px solid hsla(201, 94%, 86%, 1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.ai-analysis .ai-header {
    margin-bottom: 16px;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.analysis-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.analysis-value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.analysis-value.priority-normal {
    color: var(--info-dark);
}

.analysis-value.priority-high {
    color: var(--error);
}

.email-body {
    color: var(--text-tertiary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 32px;
}

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

.email-body ul {
    margin: 12px 0 16px 24px;
}

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

.suggested-actions {
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.suggested-actions h4 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0 0 16px 0;
}

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

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

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

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

.btn-action.primary:hover {
    background: var(--primary-dark);
}

.btn-action.secondary {
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

.btn-action.secondary:hover {
    border-color: var(--text-muted);
    background: var(--bg-gray-100);
    color: var(--text-tertiary);
}

.action-icon {
    font-size: 16px;
}

.processed-badge {
    display: inline-block;
    background: var(--success-bg);
    color: var(--success-dark);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 24px;
}

.processed-badge span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Correspondence mobile overrides (must come after correspondence styles) */
@media (max-width: 768px) {
    .correspondence-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .correspondence-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .correspondence-main {
        padding: 20px;
    }
}
