.chat-messages {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.chat-bubble {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.chat-bubble.user {
    border-left: 4px solid #0d6efd;
}

.chat-bubble.assistant {
    border-left: 4px solid #198754;
}

.chat-header img {
    object-fit: cover;
}

:root {
    --chat-bg: #f8f9fa;
    --chat-card: #ffffff;
    --chat-border: #e5e7eb;
    --chat-ink: #1f2937;
}

:root {
    --admin-bg: #f5f7fb;
    --admin-panel: #ffffff;
    --admin-ink: #0f172a;
    --admin-muted: #5b6478;
    --admin-accent: #1d4ed8;
    --admin-accent-strong: #1e40af;
    --admin-teal: #0f766e;
    --admin-success: #16a34a;
    --admin-warm: #f59e0b;
    --admin-border: #e2e8f0;
    --admin-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.admin-page {
    background: radial-gradient(1200px 600px at 8% -10%, rgba(15, 118, 110, 0.18) 0%, transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(29, 78, 216, 0.12) 0%, transparent 55%),
        radial-gradient(900px 400px at 20% 100%, rgba(245, 158, 11, 0.12) 0%, transparent 55%),
        var(--admin-bg);
    color: var(--admin-ink);
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.admin-page h1,
.admin-page h2,
.admin-page h3,
.admin-page h4,
.admin-page h5 {
    color: var(--admin-ink);
    letter-spacing: -0.01em;
}

.admin-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-subtitle {
    color: var(--admin-muted);
    margin-bottom: 0;
}

.admin-card {
    background: var(--admin-panel);
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    box-shadow: var(--admin-shadow);
    padding: 22px;
    position: relative;
    overflow: hidden;
    animation: adminFadeUp 0.45s ease both;
}

.admin-card + .admin-card {
    margin-top: 16px;
}

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

.admin-section + .admin-section {
    margin-top: 26px;
}

.admin-section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.admin-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: var(--admin-ink);
}

.admin-section-meta {
    font-size: 0.9rem;
    color: var(--admin-muted);
}

.admin-tile {
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    padding: 18px;
    text-decoration: none;
    color: var(--admin-ink);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: adminFadeUp 0.45s ease both;
    position: relative;
    overflow: hidden;
}

.admin-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(15, 118, 110, 0.12), transparent 40%, rgba(245, 158, 11, 0.12) 80%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.admin-tile > * {
    position: relative;
    z-index: 1;
}

.admin-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
    color: var(--admin-ink);
}

.admin-tile:hover::before {
    opacity: 1;
}

.admin-grid .admin-tile:nth-child(1) { animation-delay: 0.04s; }
.admin-grid .admin-tile:nth-child(2) { animation-delay: 0.08s; }
.admin-grid .admin-tile:nth-child(3) { animation-delay: 0.12s; }
.admin-grid .admin-tile:nth-child(4) { animation-delay: 0.16s; }
.admin-grid .admin-tile:nth-child(5) { animation-delay: 0.2s; }
.admin-grid .admin-tile:nth-child(6) { animation-delay: 0.24s; }
.admin-grid .admin-tile:nth-child(7) { animation-delay: 0.28s; }
.admin-grid .admin-tile:nth-child(8) { animation-delay: 0.32s; }
.admin-grid .admin-tile:nth-child(9) { animation-delay: 0.36s; }
.admin-grid .admin-tile:nth-child(10) { animation-delay: 0.4s; }

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

@media (prefers-reduced-motion: reduce) {
    .admin-card,
    .admin-tile {
        animation: none;
        transition: none;
    }
}

.admin-tile-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.admin-tile-meta {
    color: var(--admin-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.admin-page .navbar {
    background: linear-gradient(110deg, #0f172a 0%, #134e4a 45%, #1d4ed8 100%);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
}

.admin-page .navbar-dark .navbar-brand,
.admin-page .navbar-dark .navbar-nav .nav-link {
    color: #f8fafc;
}

.admin-page .navbar-dark .navbar-nav .nav-link:hover {
    color: #ffffff;
}

.admin-page .navbar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
}

.admin-page .navbar .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.admin-page .table {
    margin-bottom: 0;
    border-color: var(--admin-border);
}

.admin-page .table thead th {
    background: #eef2f7;
    color: var(--admin-ink);
    font-weight: 600;
    border-bottom: 1px solid var(--admin-border);
}

.admin-page .table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.admin-page .form-control,
.admin-page .form-select {
    border-radius: 10px;
    border-color: #d7dde8;
}

.admin-page .form-control:focus,
.admin-page .form-select:focus {
    border-color: rgba(29, 78, 216, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(29, 78, 216, 0.15);
}

.admin-page .btn-primary {
    background-color: var(--admin-accent);
    border-color: var(--admin-accent);
}

.admin-page .btn-primary:hover {
    background-color: var(--admin-accent-strong);
    border-color: var(--admin-accent-strong);
}

.admin-page .btn-success {
    background-color: var(--admin-success);
    border-color: var(--admin-success);
}

.admin-page .btn-success:hover {
    background-color: #15803d;
    border-color: #15803d;
}

.admin-page .btn-outline-secondary {
    border-color: #cbd5e1;
    color: #1e293b;
}

.admin-page .alert-secondary {
    background: rgba(29, 78, 216, 0.08);
    border-color: rgba(29, 78, 216, 0.18);
    color: var(--admin-ink);
}

.admin-user-unverified td {
    background: rgba(220, 38, 38, 0.06);
}

.admin-user-unverified td:first-child {
    border-left: 4px solid #dc2626;
}

.admin-user-unverified .admin-user-status {
    color: #b42318;
}

/* Dark theme overrides for chat */
.theme-dark.admin-page {
    background: radial-gradient(1100px 700px at 10% 0%, rgba(14, 116, 144, 0.12) 0%, transparent 60%),
        radial-gradient(1200px 800px at 90% 20%, rgba(245, 158, 11, 0.08) 0%, transparent 60%),
        #0b1220;
    color: #e2e8f0;
}

.theme-dark .navbar {
    background: linear-gradient(100deg, #0f172a 0%, #1f2937 40%, #0b1220 100%);
}

.theme-dark .navbar-dark .navbar-brand,
.theme-dark .navbar-dark .navbar-nav .nav-link {
    color: #e2e8f0;
}

.theme-dark .chat-messages {
    background: #0f172a;
    border: 1px solid #1f2937;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.theme-dark .chat-bubble {
    background: #111827;
    border-color: #1f2937;
    color: #e5e7eb;
}

.theme-dark .chat-bubble.user {
    border-left-color: #60a5fa;
}

.theme-dark .chat-bubble.assistant {
    border-left-color: #34d399;
}

.theme-dark .form-control,
.theme-dark .form-select {
    background: #0b1220;
    color: #e5e7eb;
    border-color: #1f2937;
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(96, 165, 250, 0.25);
    border-color: #60a5fa;
}

.theme-dark .btn-outline-secondary {
    border-color: #334155;
    color: #e2e8f0;
}

.theme-dark .btn-outline-secondary:hover {
    background: #1f2937;
    border-color: #475569;
}

.theme-dark .text-muted {
    color: #94a3b8 !important;
}

.theme-dark .admin-user-unverified td {
    background: rgba(239, 68, 68, 0.16);
}

.theme-dark .admin-user-unverified td:first-child {
    border-left-color: #f87171;
}

.theme-dark .admin-user-unverified .admin-user-status {
    color: #fecaca;
}

.forum-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 12px;
}

.forum-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
}

.forum-labels {
    flex-wrap: wrap;
}

.forum-label {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #374151;
    font-size: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.forum-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
}

.forum-transcript {
    position: relative;
}

.forum-transcript.is-collapsed {
    max-height: 320px;
    overflow: hidden;
    position: relative;
}

.forum-transcript.is-collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    background: linear-gradient(transparent, #f8f9fa);
}

.forum-share-preview {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.forum-comment {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    background: #ffffff;
    white-space: pre-wrap;
}

.forum-comments {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.theme-dark .forum-card,
.theme-dark .forum-comment {
    background: #111827;
    border-color: #1f2937;
}

.theme-dark .forum-label {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #334155;
}

.theme-dark .forum-summary,
.theme-dark .forum-transcript,
.theme-dark .forum-share-preview {
    background: #0f172a;
    border-color: #1f2937;
}

.theme-dark .forum-transcript.is-collapsed::after {
    background: linear-gradient(transparent, #0f172a);
}
