:root {
    --bg-dark: #0b0f19;
    --bg-card: rgba(18, 24, 38, 0.75);
    --bg-card-hover: rgba(28, 36, 56, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.4);

    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-glow: 0 8px 32px 0 rgba(99, 102, 241, 0.25);
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.12) 0px, transparent 50%);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 16px 24px;
    gap: 16px;
}

/* Header Styles */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

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

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-text h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-text h1 span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.header-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
}

.status-badge.connected {
    color: var(--accent-emerald);
    border-color: rgba(16, 185, 129, 0.3);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-emerald);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.token-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Workspace Layout */
.workspace {
    display: grid !important;
    grid-template-columns: 420px 1fr;
    gap: 18px;
    flex: 1;
    min-height: 0;
    height: 100%;
}

/* Sidebar & Cards */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.25s ease;
    min-height: 0;
}

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

.card-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h2 i {
    color: var(--primary-light);
}

.badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Clear All Button */
.btn-clear-all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-clear-all i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.btn-clear-all:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.btn-clear-all:hover i {
    transform: scale(1.15);
}

.btn-clear-all:active {
    transform: translateY(0) scale(0.97);
}

/* Drop Zone */
.upload-card {
    flex-shrink: 0;
    padding: 10px 12px;
}

.drop-zone {
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
}

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

.upload-icon {
    font-size: 18px;
    color: var(--primary-light);
}

.drop-content h3 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.upload-actions-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 3px 0 2px;
    width: 100%;
}

.upload-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-action-btn.btn-files {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.upload-action-btn.btn-files:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.upload-action-btn.btn-folder {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.upload-action-btn.btn-folder:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.file-limits {
    font-size: 9px;
    color: var(--text-dim);
    margin-top: 1px;
    opacity: 0.75;
}

/* Upload Progress */
.upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.upload-progress span {
    font-size: 11px;
    color: var(--text-muted);
}

/* Decks List & Details Unified Container Card */
.decks-card {
    flex: 1 1 0%;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.deck-card-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    flex: 1;
    gap: 8px;
    overflow: hidden;
}

.deck-card-view.hidden {
    display: none !important;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-back:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(-1px);
}

.deck-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.deck-search-bar:focus-within {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.deck-search-icon {
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
}

.deck-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #f1f5f9;
    font-size: 13px;
    width: 100%;
    font-family: inherit;
}

.deck-search-input::placeholder {
    color: #64748b;
}

.deck-search-clear-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    padding: 0 2px;
    display: flex;
    align-items: center;
    transition: color 0.15s ease;
}

.deck-search-clear-btn:hover {
    color: #f1f5f9;
}

.deck-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1 1 0%;
    min-height: 0;
    padding-right: 4px;
}

.empty-state {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-dim);
    font-size: 13px;
}

.deck-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.deck-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.deck-item.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary-light);
}

.deck-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.deck-icon {
    font-size: 18px;
    color: #ef4444;
    flex-shrink: 0;
}

.deck-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.35;
}

.deck-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* Slide Breakdown */
.slide-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
}

.slide-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 11px;
}

.slide-number {
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 2px;
}

.slide-snippet {
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Chat Section */
.chat-container {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.chat-header-info h2 {
    font-size: 14px;
    font-weight: 600;
}

.chat-header-info p {
    font-size: 11px;
    color: var(--text-muted);
}

/* Suggested Prompts */
.prompts-container {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompts-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.prompts-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.chip-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: inherit;
}

.chip-btn:hover {
    border-color: var(--border-highlight);
    color: #fff;
    background: rgba(99, 102, 241, 0.15);
}

/* Chat Messages Window */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.assistant-message {
    align-self: flex-start;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.user-message .avatar {
    background: var(--accent-cyan);
    color: #fff;
}

.assistant-message .avatar {
    background: var(--primary-gradient);
    color: #fff;
}

.message-content {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-main);
}

.user-message .message-content {
    background: var(--primary-gradient);
    border: none;
    color: #ffffff;
    border-top-right-radius: 4px;
}

.assistant-message .message-content {
    border-top-left-radius: 4px;
}

.welcome-message .message-content {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.welcome-message h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
}

/* Chat Input Bar */
.chat-input-container {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

.chat-form {
    width: 100%;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 8px 8px 8px 18px;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

#userInput,
.chat-input {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 20px;
    padding: 4px 0;
    overflow-y: auto;
    word-break: break-word;
    white-space: pre-wrap;
}

#userInput::placeholder,
.chat-input::placeholder {
    color: var(--text-dim);
}

.send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-glow);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.send-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    box-shadow: none;
    cursor: not-allowed;
}

/* Read More Button Styling */
.read-more-btn {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.read-more-btn:hover {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

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

/* Background Queue Task Card & Items */
.queue-card {
    border-left: 3px solid #3b82f6 !important;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.queue-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;
}

.queue-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(99, 102, 241, 0.3);
}

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

.queue-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.queue-status-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.queue-status-tag.queued {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.queue-status-tag.processing {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
    animation: pulseGlow 1.8s infinite;
}

.queue-status-tag.completed {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

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

.queue-item-stage {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}

.queue-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.queue-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.queue-progress-bar.completed {
    background: linear-gradient(90deg, #10b981, #059669);
}

.queue-progress-bar.failed {
    background: #ef4444;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Floating Toast Notifications Container */
#toastContainer {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.2);
    padding: 12px 18px;
    border-radius: 12px;
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    opacity: 0;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.info .toast-icon {
    color: #60a5fa;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast-body {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 2px;
}

.toast-msg {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

/* Document Intelligence & Details Tabs */
.doc-details-card {
    min-height: 140px;
    max-height: 440px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.doc-details-card.hidden {
    display: none !important;
}

.doc-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 2px;
    gap: 4px;
}

.doc-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.doc-tab:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.04);
}

.doc-tab.active {
    background: rgba(99, 102, 241, 0.25);
    color: #fff;
    border: 1px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.tab-view {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
    scroll-behavior: smooth;
}

.tab-view::-webkit-scrollbar {
    width: 5px;
}

.tab-view::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.tab-view::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

.tab-view::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.4);
}

#expandSummaryBtn {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #818cf8;
    border-radius: 6px;
    padding: 4px 7px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#expandSummaryBtn:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #ffffff;
    border-color: rgba(99, 102, 241, 0.5);
    transform: scale(1.05);
}

.modal-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 14px 16px;
    border-radius: 10px;
}

.modal-meta-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modal-meta-label {
    font-size: 10.5px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.modal-meta-value {
    font-size: 12.5px;
    color: #f1f5f9;
    font-weight: 500;
    word-break: break-word;
}

.btn-open-full-summary {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-open-full-summary:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

/* Executive Summary Styling (Compact, Readable & Scrollable Preview) */
.summary-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: default;
    border-radius: 8px;
    padding: 2px;
}

.summary-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
}

.summary-provider-badge {
    color: #818cf8;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.summary-text-box {
    font-size: 11.5px;
    line-height: 1.5;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid #6366f1;
    padding: 8px 10px;
    border-radius: 0 6px 6px 0;
    white-space: pre-line;
}

.summary-section-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.takeaways-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.takeaway-item {
    display: flex;
    gap: 6px;
    font-size: 11px;
    line-height: 1.45;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 8px;
    border-radius: 6px;
}

.takeaway-item i {
    color: #38bdf8;
    margin-top: 2px;
    font-size: 9px;
    flex-shrink: 0;
}

.deliverables-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.deliverable-chip {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 10px;
}

.audience-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fcd34d;
    font-size: 10.5px;
    padding: 5px 8px;
    border-radius: 6px;
    line-height: 1.4;
}

/* Skeleton Loading Animation */
.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Deck Item Actions & Download Button */
.deck-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.download-deck-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.download-deck-btn:hover {
    color: var(--primary-light) !important;
    background: rgba(99, 102, 241, 0.18) !important;
    transform: translateY(-1px);
}

.edit-meta-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-meta-btn:hover {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.18) !important;
    transform: translateY(-1px);
}

.meta-input {
    width: 100%;
    background: rgba(11, 15, 25, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text-main);
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.meta-input:focus {
    border-color: var(--primary);
    background: rgba(11, 15, 25, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Clickable Citation Reference Badges */
.citation-container {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: var(--radius-md);
}

.citation-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.citation-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 140px;
    overflow-y: auto;
    padding-right: 4px;
}

.citation-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #38bdf8;
    padding: 5px 11px;
    border-radius: 8px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    line-height: 1.4;
}

.citation-link:hover {
    background: rgba(56, 189, 248, 0.16);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.25);
}

.citation-filename {
    font-weight: 600;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.citation-pages {
    color: #94a3b8;
    font-size: 10.5px;
    font-weight: 400;
}

/* Chat Message Actions & Download Summary Button */
.message-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.btn-download-summary {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #34d399;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-download-summary:hover {
    background: rgba(16, 185, 129, 0.25);
    color: #ffffff;
    border-color: #10b981;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-download-deck-summary {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.32);
    color: #f87171;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

.btn-download-deck-summary:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

/* ==============================================================================
   SECURITY GATEWAY / AUTHENTICATION MODAL
   ============================================================================== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 10, 19, 0.88);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: authFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-overlay.hidden {
    display: none !important;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-card {
    background: rgba(18, 24, 38, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.auth-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.auth-icon-glow {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    margin-bottom: 6px;
}

.auth-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

.auth-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-alert.hidden {
    display: none;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrapper i.fa-user,
.auth-input-wrapper i.fa-lock {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input-wrapper input {
    width: 100%;
    background: rgba(11, 15, 25, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 42px 12px 38px;
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.auth-input-wrapper input:focus {
    border-color: var(--primary);
    background: rgba(11, 15, 25, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.auth-input-wrapper input:focus~i.fa-user,
.auth-input-wrapper input:focus~i.fa-lock {
    color: var(--primary-light);
}

.btn-toggle-pwd {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-toggle-pwd:hover {
    color: var(--text-main);
}

.btn-auth-submit {
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    padding: 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    margin-top: 6px;
}

.btn-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

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

.auth-footer-note {
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 4px;
}

/* User Profile Badge & Logout */
.user-auth-badge {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.28);
    padding: 4px 8px 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-light);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-logout:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glow);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

/* Compact Document Summary Popup */
.summary-popup-card {
    max-width: 520px;
    width: 92%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    animation: slideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.summary-popup-card .modal-header {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.summary-popup-card .modal-body {
    padding: 14px 18px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(80vh - 110px);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

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

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

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 60px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}