/* ══════════════════════════════════════════════════════════════════
   DocMind AI — Design System & Styles
   Premium dark theme with glassmorphism + vibrant blue accents
   ══════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ───────────────────────────────────────────── */
:root {
    /* Core palette */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2236;
    --bg-card: rgba(26, 34, 54, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);

    /* Accent */
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-dark: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.25);
    --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --accent-gradient-soft: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #60a5fa;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(59, 130, 246, 0.3);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

    /* Status */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Layout */
    --sidebar-width: 260px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
}

/* ── Reset ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    /* Permite desplazamiento vertical global si es necesario */
    -webkit-font-smoothing: antialiased;
}

/* Subtle background pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Nav */
.sidebar-nav {
    padding: 12px;
    flex: 1;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

.nav-item.active {
    background: var(--accent-gradient-soft);
    color: var(--text-accent);
    border: 1px solid var(--border-accent);
}

/* Stats */
.sidebar-stats {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 16px;
    height: 16px;
}

.docs-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-light);
}

.vectors-icon {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

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

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sync-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: pulse 2s infinite;
}

.sync-dot.offline {
    background: var(--danger);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn svg {
    width: 20px;
    height: 20px;
}

.mobile-title {
    font-weight: 700;
    font-size: 1.1rem;
}

/* ── Views ───────────────────────────────────────────────────── */
.view {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.view.active {
    display: flex;
}

.view-header {
    padding: 28px 32px 16px;
}

.view-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.view-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ── Chat View ───────────────────────────────────────────────── */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 32px 16px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 10px;
    /* Más ancha para mejor usabilidad */
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-dark);
    /* Color de acento para mayor visibilidad */
    border-radius: 5px;
    border: 2px solid var(--bg-secondary);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.bot-message .message-avatar {
    background: var(--accent-gradient);
    color: white;
}

.user-message .message-avatar {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.message-avatar svg {
    width: 16px;
    height: 16px;
}

.message-content {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    line-height: 1.6;
}

.bot-message .message-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.user-message .message-content {
    background: var(--accent-gradient);
    color: white;
}

.message-content p {
    margin-bottom: 8px;
}

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

.message-content strong {
    font-weight: 600;
}

.message-content em {
    color: var(--text-accent);
    font-style: italic;
}

.user-message .message-content em {
    color: rgba(255, 255, 255, 0.8);
}

/* Markdown in messages */
.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 12px 0 6px;
    font-weight: 600;
}

.message-content h3 {
    font-size: 1rem;
}

.message-content ul,
.message-content ol {
    margin: 6px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 3px 0;
}

.message-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin: 8px 0;
    overflow-x: auto;
}

.message-content pre code {
    background: none;
    padding: 0;
}

/* Sources */
.message-sources {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.source-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-accent);
    margin: 2px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-light);
    opacity: 0.4;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

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

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Chat input */
.chat-input-area {
    padding-top: 8px;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

#chat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 8px 10px;
    resize: none;
    max-height: 120px;
    outline: none;
    line-height: 1.5;
}

#chat-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

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

.send-btn svg {
    width: 18px;
    height: 18px;
}

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

/* ── Documents View ──────────────────────────────────────────── */
.documents-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 32px 24px;
}

.docs-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
}

.search-box svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.btn-refresh {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-refresh:hover {
    background: var(--bg-glass-hover);
    color: var(--text-accent);
    border-color: var(--border-accent);
}

.btn-refresh svg {
    width: 16px;
    height: 16px;
}

/* Document grid */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    backdrop-filter: blur(10px);
    transition: all var(--transition);
    animation: cardIn 0.3s ease;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.doc-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.doc-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.doc-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.doc-icon.pdf {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.doc-icon.docx {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.doc-icon.xlsx {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.doc-icon.txt {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.doc-icon.csv {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.doc-icon.other {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.doc-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.85rem;
    word-break: break-word;
    line-height: 1.3;
}

.doc-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.doc-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.meta-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.doc-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.doc-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.doc-delete-btn svg {
    width: 14px;
    height: 14px;
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ── Upload View ─────────────────────────────────────────────── */
.upload-container {
    flex: 1;
    padding: 0 32px 24px;
    overflow-y: auto;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.03);
}

.upload-zone.drag-over {
    border-color: var(--accent-light);
    box-shadow: inset 0 0 30px rgba(59, 130, 246, 0.08);
    transform: scale(1.01);
}

.upload-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 30px;
    text-align: center;
    gap: 8px;
}

.upload-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-gradient-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.upload-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-light);
}

.upload-zone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-zone p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.supported-formats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.format-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border: 1px solid var(--border);
}

/* Upload queue */
.upload-queue {
    margin-top: 20px;
}

.upload-queue h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    animation: cardIn 0.3s ease;
}

.queue-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

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

.queue-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.queue-item-progress {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.queue-item-progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.queue-item .status-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

.status-icon.error {
    color: var(--danger);
}

.status-icon.loading {
    color: var(--accent-light);
    animation: spin 1s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

/* ── Toasts ──────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 280px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

.toast.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.toast.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.toast.info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    margin-bottom: 12px;
}

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

.modal p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 100;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-header {
        display: flex;
    }

    .view-header {
        padding: 16px 16px 8px;
    }

    .chat-container {
        padding: 0 16px 12px;
    }

    .documents-container {
        padding: 0 16px 16px;
    }

    .upload-container {
        padding: 0 16px 16px;
    }

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

    .message {
        max-width: 95%;
    }
}