/* ======================================
   Researchus - Dark shadcn-inspired theme
   ====================================== */

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

:root,
[data-theme="dark"] {
    --bg-base: #0c0e1a;
    --bg-sidebar: #0f1120;
    --bg-panel: #121428;
    --bg-card: #171934;
    --bg-input: #1a1d3a;
    --bg-hover: #1e2148;
    --bg-active: #232750;
    --border: #252a4a;
    --border-light: #2d3260;
    --text-primary: #e2e4ed;
    --text-secondary: #8b8fa8;
    --text-muted: #5c6080;
    --accent: #4fd1c5;
    --accent-hover: #38b2ac;
    --accent-dim: rgba(79, 209, 197, 0.15);
    --danger: #f56565;
    --success: #48bb78;
    --info: #4299e1;
    --radius: 8px;
    --radius-sm: 4px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --log-bg: #080a14;
    --log-border: rgba(37, 42, 74, 0.4);
}

[data-theme="light"] {
    --bg-base: #f8f9fb;
    --bg-sidebar: #ffffff;
    --bg-panel: #ffffff;
    --bg-card: #f1f3f7;
    --bg-input: #f1f3f7;
    --bg-hover: #e8ebf0;
    --bg-active: #dfe3ea;
    --border: #d8dce5;
    --border-light: #c8cdd8;
    --text-primary: #1a1d2e;
    --text-secondary: #4a5068;
    --text-muted: #8b90a5;
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --accent-dim: rgba(13, 148, 136, 0.1);
    --danger: #dc2626;
    --success: #16a34a;
    --info: #2563eb;
    --log-bg: #f1f3f7;
    --log-border: rgba(0, 0, 0, 0.06);
}

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-base);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
}

/* ======================================
   Layout: sidebar + main
   ====================================== */

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Icon sidebar */
.icon-sidebar {
    width: 52px;
    min-width: 52px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.sidebar-top, .sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #b4a0d8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    text-decoration: none;
    cursor: default;
    pointer-events: none;
}

.sidebar-logo i {
    font-size: 16px;
    color: white;
}

.sidebar-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    transition: all 0.15s ease;
}

.sidebar-icon:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sidebar-icon.active {
    color: var(--accent);
    background: var(--accent-dim);
}

/* Main area */
.main-area {
    flex: 1;
    overflow: hidden;
}

/* ======================================
   Two-panel layout (list + detail)
   ====================================== */

.two-panel {
    display: flex;
    height: 100vh;
}

.list-panel {
    width: 380px;
    min-width: 380px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-panel {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-base);
    padding: 0;
}

/* Panel header */
.panel-title {
    font-size: 16px;
    font-weight: 600;
    padding: 18px 20px 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.panel-subtitle {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 14px 20px 8px;
}

/* Stats */
.stats-row {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
}

.stat-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.section-divider {
    height: 1px;
    background: var(--border);
    margin: 0 20px;
}

/* Item list */
.item-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.list-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s ease;
}

.list-item:hover {
    background: var(--bg-hover);
}

.list-item.active {
    background: var(--bg-active);
    border-left: 3px solid var(--accent);
    padding-left: 17px;
}

.list-item-title {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.list-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.copy-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: #b4a0d8;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    opacity: 0;
}

.list-item:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background: rgba(180, 160, 216, 0.15);
    color: #c9b8e8;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-postgres {
    background: rgba(66, 153, 225, 0.15);
    color: var(--info);
}

.badge-vector {
    background: rgba(79, 209, 197, 0.15);
    color: var(--accent);
}

.badge-db {
    background: rgba(66, 153, 225, 0.15);
    color: var(--info);
}

/* Detail panel content */
.detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.detail-placeholder i {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.detail-placeholder p {
    max-width: 300px;
    line-height: 1.6;
}

.detail-content {
    padding: 28px 32px;
}

.detail-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.detail-meta-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.copy-btn-visible {
    opacity: 1;
}

/* Delete button */
.delete-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    opacity: 0;
}

.list-item:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    background: rgba(245, 101, 101, 0.15);
    color: var(--danger);
}

.delete-btn-visible {
    opacity: 1;
}

/* Markdown body */
.markdown-body {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 10px;
}

.markdown-body h1 { font-size: 20px; }
.markdown-body h2 { font-size: 17px; }
.markdown-body h3 { font-size: 15px; }

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

.markdown-body ul, .markdown-body ol {
    padding-left: 20px;
    margin: 8px 0;
}

.markdown-body li {
    margin-bottom: 4px;
}

.markdown-body p {
    margin-bottom: 12px;
}

/* ======================================
   Form elements
   ====================================== */

.form-group {
    padding: 0 20px;
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
}

.form-input, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-muted);
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.radio-label input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
}

.radio-label input[type="radio"]:checked {
    border-color: var(--accent);
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0 20px;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-base);
}

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

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

/* ======================================
   Loading & status states
   ====================================== */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    color: var(--text-muted);
    text-align: center;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.error-banner {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    border-radius: var(--radius);
    padding: 14px 18px;
    color: var(--danger);
    margin: 24px 32px;
}

.error-banner i {
    margin-right: 8px;
}

.status-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
}

.status-message.info {
    background: rgba(66, 153, 225, 0.1);
    border: 1px solid rgba(66, 153, 225, 0.3);
    color: var(--info);
}

.status-message.success {
    background: rgba(72, 187, 120, 0.1);
    border: 1px solid rgba(72, 187, 120, 0.3);
    color: var(--success);
}

.status-message.error {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    color: var(--danger);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    line-height: 1.6;
}

/* ======================================
   Single panel layout (health, etc.)
   ====================================== */

.single-panel {
    height: 100vh;
    overflow-y: auto;
    padding: 0 32px 32px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.page-header .panel-title {
    padding: 0;
    border-bottom: none;
}

/* Small button variant */
.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
    margin: 0;
}

/* Secondary button */
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

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

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

/* ======================================
   Health check page
   ====================================== */

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

.health-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: border-color 0.15s ease;
}

.health-card.loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
    grid-column: 1 / -1;
}

.health-card-ok {
    border-left: 3px solid var(--success);
}

.health-card-fail {
    border-left: 3px solid var(--danger);
}

.health-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.health-card-icon {
    font-size: 16px;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}

.health-card-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.health-ok {
    color: var(--success);
}

.health-fail {
    color: var(--danger);
}

.health-card-detail {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 30px;
    word-break: break-all;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
    margin-bottom: 0;
}

/* ======================================
   Import page
   ====================================== */

.import-summary {
    display: flex;
    gap: 8px;
    padding: 20px;
}

.import-counter {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
}

.import-counter-ok {
    border-top: 2px solid var(--success);
}

.import-counter-skip {
    border-top: 2px solid var(--info);
}

.import-counter-fail {
    border-top: 2px solid var(--danger);
}

.import-counter-number {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.import-counter-ok .import-counter-number { color: var(--success); }
.import-counter-skip .import-counter-number { color: var(--info); }
.import-counter-fail .import-counter-number { color: var(--danger); }

.import-counter-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-top: 2px;
}

.import-progress {
    padding: 0 20px 16px;
}

.import-progress-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
}

.import-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.import-progress-text {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

/* ======================================
   Log output (terminal style)
   ====================================== */

.log-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
}

.log-placeholder i {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.log-placeholder p {
    max-width: 300px;
    line-height: 1.6;
}

.log-output {
    height: 100%;
    overflow-y: auto;
    padding: 16px 20px;
    font-family: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code", "Consolas", monospace;
    font-size: 12px;
    line-height: 1.7;
    background: var(--log-bg);
}

.log-line {
    padding: 3px 0;
    border-bottom: 1px solid var(--log-border);
}

.log-ts {
    color: var(--text-muted);
    margin-right: 8px;
    font-size: 11px;
}

.log-icon {
    margin-right: 6px;
}

.log-index {
    color: var(--text-muted);
    margin-right: 6px;
}

.log-muted {
    color: var(--text-muted);
    font-style: italic;
}

.log-warn {
    color: #ecc94b;
}

/* Log badges */
.log-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-right: 6px;
}

.log-badge-ok {
    background: rgba(72, 187, 120, 0.15);
    color: var(--success);
}

.log-badge-skip {
    background: rgba(66, 153, 225, 0.15);
    color: var(--info);
}

.log-badge-fail {
    background: rgba(245, 101, 101, 0.15);
    color: var(--danger);
}

/* Log line types */
.log-info {
    color: var(--text-secondary);
}

.log-info .log-icon {
    color: var(--info);
}

.log-imported {
    color: var(--text-secondary);
}

.log-skipped {
    color: var(--text-muted);
}

.log-failed {
    color: var(--danger);
}

.log-error-line {
    color: var(--danger);
}

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

.log-complete {
    color: var(--success);
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
}

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

.log-error-detail {
    margin: 4px 0 4px 24px;
    padding: 8px 12px;
    background: rgba(245, 101, 101, 0.08);
    border: 1px solid rgba(245, 101, 101, 0.2);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* ======================================
   Theme toggle
   ====================================== */

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ======================================
   Scrollbar
   ====================================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ======================================
   Auth pages (login, setup)
   ====================================== */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-base);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
}

.auth-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #b4a0d8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.auth-logo i {
    font-size: 22px;
    color: white;
}

/* Large brain logo for login page */
.auth-logo-large {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-brain-svg {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    filter: drop-shadow(0 0 20px rgba(180, 160, 216, 0.35))
           drop-shadow(0 0 40px rgba(180, 160, 216, 0.15));
    animation: brain-breathe 4s ease-in-out infinite;
}

@keyframes brain-breathe {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(180, 160, 216, 0.35))
               drop-shadow(0 0 40px rgba(180, 160, 216, 0.15));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 28px rgba(180, 160, 216, 0.5))
               drop-shadow(0 0 56px rgba(180, 160, 216, 0.25));
        transform: scale(1.03);
    }
}

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

.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-subtitle strong {
    color: var(--accent);
}

.auth-error {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 16px;
    text-align: left;
}

.auth-error i {
    margin-right: 6px;
}

.auth-field {
    margin-bottom: 16px;
    text-align: left;
}

.auth-btn {
    width: 100%;
    margin: 8px 0 0 0;
    padding: 12px;
}

/* ======================================
   Settings page
   ====================================== */

.settings-section {
    margin-bottom: 8px;
}

.settings-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.settings-section-title i {
    color: var(--accent);
    margin-right: 8px;
    width: 18px;
    text-align: center;
}

.settings-section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* User list items */
.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.user-inactive {
    opacity: 0.5;
}

.badge-role-admin {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-role-member {
    background: rgba(66, 153, 225, 0.15);
    color: var(--info);
}

.badge-pending {
    background: rgba(139, 143, 168, 0.15);
    color: var(--text-muted);
}

.badge-inactive {
    background: rgba(245, 101, 101, 0.15);
    color: var(--danger);
}

/* Invite link */
.invite-link-box {
    margin-top: 8px;
}

.invite-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.invite-link-row .form-input {
    flex: 1;
    font-size: 12px;
}

/* Sidebar user */
.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}

.sidebar-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ======================================
   Dashboard animated brain SVG
   ====================================== */

.brain-anim-svg {
    width: 440px;
    height: 320px;
    margin-bottom: 20px;
}

/* Floating documents */
.floating-doc.doc-left {
    animation: float-left 5s ease-in-out infinite;
}

.floating-doc.doc-right {
    animation: float-right 5.5s ease-in-out infinite;
}

@keyframes float-left {
    0%, 100% { transform: translate(28px, 70px); }
    50% { transform: translate(28px, 62px); }
}

@keyframes float-right {
    0%, 100% { transform: translate(220px, 60px); }
    50% { transform: translate(220px, 52px); }
}

/* Scan line sweeping down the documents */
.scan-line-1 {
    animation: scan-doc 3s ease-in-out infinite;
}

.scan-line-2 {
    animation: scan-doc 3s ease-in-out infinite 1.5s;
}

@keyframes scan-doc {
    0% { y: 8; opacity: 0; }
    10% { opacity: 0.6; }
    80% { opacity: 0.6; }
    90% { y: 32; opacity: 0; }
    100% { y: 32; opacity: 0; }
}

/* Brain glow pulse */
.brain-glow {
    animation: glow-pulse 4s ease-in-out infinite;
}

.brain-glow-outer {
    animation: glow-pulse 4s ease-in-out infinite 1s;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.1; r: 48; }
    50% { opacity: 0.25; r: 52; }
}

/* Neural dots glow */
.neural-dot {
    filter: drop-shadow(0 0 4px rgba(79, 209, 197, 0.6));
}

/* Connection line dash animation */
.connection-line {
    animation: dash-flow 2s linear infinite;
}

@keyframes dash-flow {
    to { stroke-dashoffset: -14; }
}

/* Brain half subtle pulse */
.brain-half {
    animation: brain-stroke-pulse 4s ease-in-out infinite;
}

.brain-right {
    animation-delay: 0.5s;
}

@keyframes brain-stroke-pulse {
    0%, 100% { stroke: #b4a0d8; stroke-width: 1.8; }
    50% { stroke: #c9b8e8; stroke-width: 2.1; }
}

.brain-detail {
    animation: detail-fade 4s ease-in-out infinite;
}

@keyframes detail-fade {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.6; }
}

/* How-to guide on dashboard placeholder */
.how-to-guide {
    margin-top: 24px;
    text-align: center;
    max-width: 520px;
}

.how-to-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-align: center;
}

.how-to-steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0;
}

.how-to-steps li {
    counter-increment: step;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 6px 0;
}

.how-to-steps li::before {
    content: counter(step) ".";
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
}

.how-to-steps a {
    color: var(--accent);
}
