.chat-item .chat-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-item .chat-badge-verbose {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: #64748b; /* match sidebar icon gray */
}
.chat-item .chat-badge-verbose .waves-icon {
    display: inline-block;
}
.message .debug-wrapper {
    width: 100%;
}
.message .debug-header {
    font-weight: 600;
    cursor: pointer;
}
.message .debug-body {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}
.input-actions .btn.btn-secondary#download-chat-btn {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Chat Header Styles */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.chat-header-actions {
    position: relative;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.btn.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn.btn-icon:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #111827;
}

.dropdown-item i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* Chat Settings Modal Styles */
#chat-settings-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: none !important; /* Remove backdrop entirely */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2000 !important;
    pointer-events: none; /* Let clicks through except modal-content */
}

#chat-settings-modal.hidden {
    display: none !important;
}

#chat-settings-modal .modal-content {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important; /* thin border like input */
    border-radius: 12px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
    max-width: 600px !important;
    width: 90% !important;
    max-height: 80vh !important;
    overflow: hidden !important;
    margin: 0 auto !important; /* Ensure centering */
    position: relative !important;
    pointer-events: auto; /* Accept clicks */
}

#chat-settings-modal .modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px 24px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}

#chat-settings-modal .modal-header h3 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #111827 !important;
}

#chat-settings-modal .modal-body {
    padding: 24px !important;
    max-height: 60vh !important;
    overflow-y: auto !important;
    background: #ffffff !important;
}

/* Settings Content Styles */
.settings-section {
    margin-bottom: 24px;
}

.settings-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Chat settings stacked layout */
.chat-settings-stacked {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-item-full-width {
    grid-column: 1 / -1;
}

.settings-item {
    display: flex;
    flex-direction: column;
}

.settings-item label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}

.settings-item .value {
    font-size: 14px;
    color: #111827;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.settings-item .value.boolean {
    color: #059669;
    font-weight: 500;
}

.settings-item .value.null {
    color: #6b7280;
    font-style: italic;
}
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Autofill prevention styles */
input[style*="display:none"] {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Prevent autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px white inset !important;
    -webkit-text-fill-color: #333 !important;
    transition: background-color 5000s ease-in-out 0s;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Home Page Styles */
.home-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.home-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    max-width: 500px;
    width: 100%;
}

.home-header {
    text-align: center;
    margin-bottom: 2rem;
}

.home-logo {
    width: 120px;
    height: auto;
    margin-bottom: 1rem;
}

.home-header h1 {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.home-header p {
    color: #64748b;
    font-size: 1.1rem;
}

/* Auth Container */
.auth-container {
    width: 100%;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    color: #3CAAA0;
    border-bottom: 2px solid #3CAAA0;
}

.auth-tab-content {
    display: none;
}

.auth-tab-content.active {
    display: block;
}

.auth-form {
    width: 100%;
}

.btn-full {
    width: 100%;
    margin-top: 1rem;
}

/* App Page Styles */
.app-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* App Header */
.app-header {
    display: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: #f1f5f9;
    color: #3CAAA0;
}

.header-logo {
    width: 100px;
    height: auto;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    color: #64748b;
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: white;
    border-right: 1px solid #e2e8f0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    padding-top: 0;
}

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

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Desktop sidebar behavior */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0) !important;
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%) !important;
    }
    
    .app-main {
        margin-left: 280px;
    }
    
    .sidebar.collapsed + .app-main {
        margin-left: 0;
    }
}

/* Sidebar Header */
.sidebar-header {
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-user-info .user-info {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.sidebar-user-info .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.sidebar-nav {
    padding: 1rem 0;
    padding-bottom: 0.5rem; /* Reduced to bring chat management closer */
}

.sidebar-menu {
    list-style: none;
}

.sidebar-item {
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 0 0.5rem 0.5rem 0;
}

.sidebar-link:hover {
    background: #f1f5f9;
    color: #3CAAA0;
}

.sidebar-link.active {
    background: #3CAAA0;
    color: white;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    text-align: center;
}

.sidebar-footer p {
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
}

/* Main Content */
.app-main {
    flex: 1;
    padding: 0.5rem; /* Further reduce padding */
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    transition: margin-left 0.3s ease;
    overflow: hidden;
    min-height: 100vh;
}

.sidebar.open + .app-main {
    margin-left: 280px;
}

/* Sections */
.section {
    display: none !important;
    position: relative; /* Enable absolute positioning for child elements */
}

.section.active {
    display: block !important;
}

.section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem; /* Reduce from 1.5rem to 0.5rem */
    color: #1e293b;
}

/* Reduce spacing for paragraphs in sections */
.section p {
    margin-bottom: 0.25rem !important;
    margin-top: 0 !important;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

/* Grid Layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.manage-data-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.manage-data-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Make the first row tiles the same size as the second row */
.manage-data-row:first-child {
    grid-template-columns: repeat(3, 1fr);
}

/* Manage Data Card Styles */
.manage-data-row .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.manage-data-row .card h3 {
    margin-bottom: 1rem;
}

.manage-data-row .card p {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.manage-data-row .card form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.manage-data-row .card form .form-group {
    margin-bottom: 1rem;
}

.manage-data-row .card form .btn {
    margin-top: auto;
    align-self: flex-start;
}

.manage-data-row .card .btn {
    align-self: flex-start;
    margin-top: auto;
}

.manage-data-row .card .status {
    margin-top: 1rem;
}

/* Chat Layout */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px); /* Further reduce height */
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 1px solid #f8fafc;
    overflow: hidden;
}

/* Welcome Message Styles */
.welcome-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: calc(100vh - 120px);
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin: 2rem;
    flex: 1;
}

.welcome-message h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.welcome-message p {
    font-size: 1.25rem;
    color: #64748b;
    max-width: 500px;
    line-height: 1.6;
}

/* Chat Container (when active) */
.chat-container.hidden {
    display: none;
}

/* Chat Header */
.chat-header {
    padding: 1rem 2rem 0.5rem 2rem;
    border-bottom: none; /* Remove border */
    background: transparent; /* Remove white background */
}

.chat-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* Chat Management Styles */
.chat-management {
    margin-top: 0;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.chat-management-header {
    display: flex;
    justify-content: space-between; /* Back to space-between */
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    gap: 0; /* Remove gap */
}

.chat-management-header h4 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 2rem; /* Align with sidebar link icons */
    margin-right: 1rem;
}

.sidebar-new-chat-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.sidebar-new-chat-btn:hover {
    background-color: #f3f4f6;
    color: #3b82f6;
    transform: scale(1.05);
}

.sidebar-new-chat-btn i {
    font-size: 1.26rem;
    margin-right: 0.5rem; /* Add back some margin to move button right */
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
}

.chat-list {
    max-height: 300px;
    overflow-y: auto;
}

.chat-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.chat-item.active {
    background: #3CAAA0;
    border-color: #3CAAA0;
    color: white;
}

.chat-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-title {
    font-weight: 500;
    font-size: 0.875rem;
}

.chat-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    opacity: 0.8;
}

.chat-message-count {
    color: inherit;
}

.chat-date {
    color: inherit;
}

/* Persona Selector Styles */
.persona-selector {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: end;
}

.persona-selector label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    display: block;
}

.persona-selector select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
    font-size: 0.875rem;
}

.persona-selector select:focus {
    outline: none;
    border-color: #3CAAA0;
    box-shadow: 0 0 0 3px rgba(60, 170, 160, 0.1);
}

/* Generic modal styles (ensure they don't affect chat settings modal overlay) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Keep generic .modal styles but ensure chat settings overrides win */
.modal {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8fafc;
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

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

.message.system {
    align-items: center;
}

.message-content {
    max-width: 70%;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.message.user .message-content {
    background: #3CAAA0;
    color: white;
    border-color: #3CAAA0;
}

.message.assistant .message-content {
    background: white;
    color: #1e293b;
}

.message.system .message-content {
    background: #f1f5f9;
    color: #64748b;
    text-align: center;
    font-style: italic;
}

.chat-input-container {
    padding: 0.25rem 1.5rem 0.5rem 1.5rem; /* Further reduce padding */
    background: transparent;
    border-top: 1px solid #f8fafc;
    margin-top: auto; /* Push to bottom */
}

.chat-form {
    width: 100%;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem;
    transition: all 0.2s;
}

.input-wrapper:focus-within {
    border-color: #3CAAA0;
    box-shadow: 0 0 0 3px rgba(60, 170, 160, 0.1);
}

.input-wrapper textarea {
    flex: 1;
    border: none;
    background: none;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: #1e293b;
    outline: none;
    min-height: 24px;
    max-height: 120px;
}

.send-button {
    background: #3CAAA0;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover {
    background: #2d8a82;
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.new-chat-button {
    background: #3CAAA0;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 0.5rem;
}

.new-chat-button:hover {
    background: #2a8a82;
    transform: scale(1.05);
}

.new-chat-button i {
    font-size: 1rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1e293b;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3CAAA0;
    box-shadow: 0 0 0 3px rgba(60, 170, 160, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    gap: 0.5rem;
}

.btn-primary {
    background: #3CAAA0;
    color: white;
}

.btn-primary:hover {
    background: #2d8a82;
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}

/* Status Messages */
.status {
    margin: 0.25rem 0; /* Reduce from 1rem to 0.25rem */
    padding: 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    height: 3.5rem; /* Fixed height instead of min-height to prevent any expansion */
    display: flex;
    align-items: center;
    box-sizing: border-box; /* Include padding in height calculation */
}

/* Show empty status divs with same fixed height */
.status:empty {
    height: 3.5rem;
    padding: 0.5rem 1rem; /* Reduce padding when empty */
}

.status.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.status.info {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.status.loading {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fed7aa;
}

/* Checkbox styles */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 16px;
    height: 16px;
    accent-color: #3CAAA0;
}

/* Progress bar styles */
.progress-container {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.progress-container.hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: #3CAAA0;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.9rem;
    color: #64748b;
    text-align: center;
}

/* Stats */
.stats {
    color: #64748b;
}

.stats p {
    margin-bottom: 0.5rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3CAAA0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Typing indicator styles */
.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background-color: #3CAAA0;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Typing indicator specific styling */
.typing-indicator .message-content {
    padding: 0.75rem 1rem;
    min-width: 60px;
    max-width: 80px;
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    .typing-dots span {
        animation: none;
        opacity: 0.6;
    }
}

.loading-overlay p {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
}

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

/* Admin-only elements */
[data-admin-only] {
    display: none;
}

[data-admin-only].admin-visible {
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .home-container {
        padding: 2rem;
        margin: 1rem;
    }
    
    .app-header {
        display: none;
    }
    
    .app-main {
        padding: 1rem;
        margin-top: 0;
        margin-bottom: 0;
        min-height: 100vh;
        overflow: hidden;
    }
    
    .sidebar {
        width: 100%;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.open + .app-main {
        margin-left: 0;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .manage-data-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-container {
        height: 75vh;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .welcome-message {
        margin: 1rem;
        padding: 2rem 1rem;
    }
    
    .welcome-message h2 {
        font-size: 2rem;
    }
    
    .welcome-message p {
        font-size: 1.125rem;
    }
    
    .chat-header {
        padding: 1rem;
    }
    
    .chat-header h2 {
        font-size: 1.25rem;
    }
    
    .chat-management-header {
        padding: 0.75rem 1rem;
    }
    
    .sidebar-new-chat-btn {
        width: 28px;
        height: 28px;
    }
    
    .sidebar-new-chat-btn i {
        font-size: 1.08rem;
    }
}

@media (min-width: 769px) {
    .sidebar-toggle {
        display: none;
    }
}

/* Footer */
.footer {
    background: white;
    color: #64748b;
    padding: 0.7rem 0;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-top: 1px solid #e2e8f0;
    height: 42px;
}

/* Hide footer when app page is visible (not on login page) */
.app-page:not(.hidden) ~ .footer {
    display: none;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
}

/* Ensure footer stays at bottom */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

/* Prevent scrolling only when app page is visible */
body.app-page-visible {
    overflow: hidden;
}

/* Allow scrolling on home page */
.home-page {
    overflow: auto;
}

.app-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-main {
    flex: 1;
    overflow: hidden;
}

/* Manage Persona Styles */
.manage-persona-container {
    max-width: 800px;
    margin: 0 auto;
}

.persona-editor {
    margin-top: 1rem;
}

.persona-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.persona-text {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 120px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    line-height: 1.6;
    color: #374151;
}

.persona-edit {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.persona-edit.hidden {
    display: none;
}

.persona-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    background-color: white;
}

.persona-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.persona-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.persona-actions .btn {
    min-width: 80px;
} 

/* Profile Management Styles */
.manage-profiles-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.profile-selector label {
    font-weight: 500;
    color: #1e293b;
}

.profile-selector select {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.profile-editor {
    margin-top: 1rem;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.profile-display,
.profile-edit {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-display .form-group,
.profile-edit .form-group {
    margin-bottom: 1rem;
}

.profile-display .form-group input,
.profile-display .form-group select,
.profile-edit .form-group input,
.profile-edit .form-group select {
    max-width: 500px;
    width: 100%;
}

/* Remove spinner arrows from number inputs */
.profile-display input[type="number"],
.profile-edit input[type="number"] {
    -moz-appearance: textfield;
}

.profile-display input[type="number"]::-webkit-outer-spin-button,
.profile-display input[type="number"]::-webkit-inner-spin-button,
.profile-edit input[type="number"]::-webkit-outer-spin-button,
.profile-edit input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.profile-edit.hidden {
    display: none;
}

.profile-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.profile-actions .btn {
    min-width: 80px;
}

/* Enable scrolling for manage-profiles section */
#manage-profiles {
    overflow-y: auto;
    max-height: calc(100vh - 80px);
    padding-bottom: 2rem;
}

/* Invite Code Management Styles */
.invite-code-management {
    margin-top: 1rem;
}

.invite-code-create {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.invite-code-create h4 {
    margin-bottom: 1rem;
    color: #1e293b;
    font-weight: 600;
}

.invite-code-form {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 1rem;
    align-items: end;
}

.invite-code-form .form-group {
    margin-bottom: 0;
}

.invite-code-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.invite-code-form input,
.invite-code-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out;
}

.invite-code-form input:focus,
.invite-code-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.invite-code-list h4 {
    margin-bottom: 1rem;
    color: #1e293b;
    font-weight: 600;
}

.invite-codes-table {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.invite-codes-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.invite-codes-table th {
    background: #f8fafc;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.invite-codes-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.invite-codes-table tr:last-child td {
    border-bottom: none;
}

.invite-codes-table tr:hover {
    background: #f8fafc;
}

.invite-codes-table code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    color: #1e293b;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.status-used {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.status-revoked {
    background: #f3f4f6;
    color: #374151;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 0.375rem;
}

@media (max-width: 768px) {
    .invite-code-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .invite-codes-table {
        font-size: 0.75rem;
    }
    
    .invite-codes-table th,
    .invite-codes-table td {
        padding: 0.5rem;
    }
} 

/* Ensure the dashboard section can scroll */
#dashboard {
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

/* View Data Section */
.view-data-container {
    max-height: none;
    height: auto;
    overflow-y: visible; /* Remove nested scrolling - let Tabulator handle it */
    padding: 0;
    position: relative;
    margin-top: 0;
    margin-bottom: 0;
}

/* RAG Data Browser Styles - Tabulator.js */
.rag-data-list {
    margin-top: 0;
    margin-bottom: 0;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow-x: visible; /* Remove nested scrolling - let Tabulator handle it */
    overflow-y: visible; /* Remove nested scrolling - let Tabulator handle it */
}

.rag-data-controls {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    margin-top: 0; /* Remove top margin completely to move box up */
    margin-bottom: 0; /* Remove bottom margin for seamless connection to table */
    padding: 10px;
    border-radius: 8px 8px 0 0; /* Rounded top corners only */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Add subtle shadow for depth */
}

/* Reduce spacing in main content area */
.main-content {
    padding-top: 0.5rem; /* Reduce top padding */
}

.main-content h2 {
    margin-bottom: 0.5rem; /* Reduce margin below subtitle */
}

/* Target the specific subtitle paragraph */
.main-content p {
    margin-bottom: 0.25rem !important; /* Aggressively reduce margin below subtitle paragraph */
    margin-top: 0 !important; /* Remove top margin completely */
}

/* Tabulator Custom Styling */
.tabulator {
    font-family: inherit;
    font-size: 0.875rem;
    min-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto; /* Allow horizontal scrolling within Tabulator */
    overflow-y: auto; /* Allow vertical scrolling within Tabulator */
    border-radius: 0 0 8px 8px; /* Rounded bottom corners to match controls */
}

#rag-data-table {
    min-width: 100%;
    overflow-x: visible;
    width: 100%;
    margin: 0;
    padding: 0;
}

.tabulator .tabulator-header {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.tabulator .tabulator-header .tabulator-col {
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
}

.tabulator .tabulator-header .tabulator-col:hover {
    background-color: #e9ecef;
}

.tabulator .tabulator-row {
    border-bottom: 1px solid #e9ecef;
}

.tabulator .tabulator-row:hover {
    background-color: #f8f9fa;
}

.tabulator .tabulator-cell {
    padding: 0.5rem;
    border-right: 1px solid #e9ecef;
}

/* Status cell styling */
.tabulator .tabulator-cell[data-field="status"] {
    text-align: center;
    font-size: 0.8rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tabulator {
        font-size: 0.75rem;
    }
    
    .tabulator .tabulator-cell {
        padding: 0.25rem;
    }
}

.rag-data-header-row {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rag-data-header {
    padding: 0.5rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-right: 1px solid #e9ecef;
    white-space: nowrap;
    background: #f8f9fa;
    vertical-align: top;
}

.rag-data-header.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.rag-data-header.sortable:hover {
    background: #e9ecef;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sort-icon {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 0.5rem;
}

/* Column filter styles */
.column-filter {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    background: white;
    transition: border-color 0.2s;
}

.column-filter:focus {
    outline: none;
    border-color: #3CAAA0;
    box-shadow: 0 0 0 2px rgba(60, 170, 160, 0.1);
}

.column-filter::placeholder {
    color: #9ca3af;
    font-size: 0.7rem;
}

/* Date filter container */
.date-filter-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.date-filter-container .column-filter {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

.rag-data-header:last-child {
    border-right: none;
}

.rag-data-row {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
    background: #fff;
}

.rag-data-row:nth-child(even) {
    background: #f8f9fa;
}

.rag-data-row:hover {
    background: #e3f2fd;
}

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

.rag-data-cell {
    padding: 0.75rem 0.5rem;
    border-right: 1px solid #e9ecef;
    vertical-align: top;
    word-break: break-word;
}

.rag-data-cell:last-child {
    border-right: none;
}

/* Special cell styles */
.rag-data-status-cell {
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.2;
}

.rag-data-id-cell {
    font-family: monospace;
    font-size: 0.75rem;
    background: #f8f9fa;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rag-data-id-cell code {
    background: none;
    padding: 0;
    font-size: inherit;
}

/* Removed hardcoded column CSS rules - now using Tabulator.js dynamic columns */

.no-data {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

.rag-data-pagination {
    margin-top: 0;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Tabulator pagination styling */
.tabulator .tabulator-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0.25rem 0.5rem;
    margin: 0;
}

/* Remove spacing from Tabulator footer in view-data section */
#view-data .tabulator .tabulator-footer {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.tabulator .tabulator-footer .tabulator-page-size {
    margin-right: 1rem;
}

.tabulator .tabulator-footer .tabulator-page {
    margin: 0 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tabulator .tabulator-footer .tabulator-page:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.tabulator .tabulator-footer .tabulator-page.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.tabulator .tabulator-footer .tabulator-page-size select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    color: #495057;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rag-data-page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.rag-data-page-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.rag-data-page-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: #6c757d;
}

/* Responsive adjustments for RAG data browser */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .rag-data-table-container {
        font-size: 0.75rem;
    }
    
    .rag-data-header,
    .rag-data-cell {
        padding: 0.5rem 0.25rem;
    }
    
    /* Removed hardcoded mobile column CSS rules - now using Tabulator.js responsive layout */
    
    .filter-actions {
        flex-direction: column;
    }
}

/* End of RAG Data Browser Styles */

/* View Data Section Spacing */
.view-data-container {
    margin-bottom: 0px;
}

.rag-data-pagination {
    margin-bottom: 0px;
    padding-bottom: 0px;
}

/* View Data Section - Ensure proper scrolling */
#view-data {
    min-height: 100vh;
    padding-bottom: 50px;
}

/* Remove all spacing between data table and context section */
#view-data .view-data-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

#view-data .view-data-container .rag-data-list {
    margin-bottom: 0 !important;
    height: auto !important;
    min-height: 0 !important;
}

#view-data .view-data-container .rag-data-pagination {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

/* Context Table Styles */
.context-table-container {
    margin-top: 0px !important;
    padding-top: 5px !important;
    padding-bottom: 5px;
    padding-left: 5px;
    padding-right: 5px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

/* Remove spacing between view-data-container and context-table-container */
#view-data .view-data-container + .context-table-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#view-data .view-data-container {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

#view-data .rag-data-pagination {
    margin-bottom: 0 !important;
    padding-bottom: 0.25rem !important;
}

#view-data .rag-data-list {
    margin-bottom: 0 !important;
}

.context-selector {
    margin-bottom: 5px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* Make Delete Context button match Add Row button height */
#delete-context-btn {
    padding: 8px 16px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    height: auto !important;
    line-height: 1.2 !important;
}

/* Make Save Context button match Delete Context button height */
#save-context-btn {
    padding: 8px 16px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    height: auto !important;
    line-height: 1.2 !important;
}

/* Consistent styling for all RAG data browser buttons */
#add-row-btn,
#add-to-context-btn,
#save-changes-btn {
    padding: 8px 16px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    height: auto !important;
    line-height: 1.2 !important;
    border: none !important;
    border-radius: 0.375rem !important; /* Bootstrap standard - matches Save Context/Delete Context */
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    white-space: nowrap !important;
    min-width: 120px !important;
}

/* Button positioning with proper spacing - account for Save Changes size changes */
#save-changes-btn {
    right: 20px !important;
    min-width: 140px !important; /* Extra space for "(X)" when items selected */
}

#add-to-context-btn {
    right: 180px !important;
}

#add-row-btn {
    right: 320px !important; /* Moved further right to account for Save Changes button */
}

.context-selector {
    display: flex;
    align-items: flex-start; /* Keep flex-start for proper alignment */
    gap: 15px;
    margin-bottom: 8px;
}

.context-selector .form-group {
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.context-selector .form-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    font-size: 0.85rem; /* Ensure all labels have same font size */
    text-align: left;
    line-height: 1.2;
    height: 20px; /* Fixed height for consistent alignment */
}

.context-selector .form-group input,
.context-selector .form-group textarea,
.context-selector .form-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit; /* Ensure all use the same font family */
    font-weight: inherit; /* Ensure all use the same font weight */
    height: calc(0.85rem + 12px + 2px); /* Same height for all inputs */
    box-sizing: border-box; /* Ensure padding is included in height calculation */
}

/* Make textarea height match input field height */
.context-selector .form-group textarea {
    height: calc(0.85rem + 12px + 2px); /* font-size + padding + border */
    resize: vertical; /* Allow vertical resize but maintain initial height */
}

.context-table-container h3 {
    margin: 0 0 4px 0;
    color: #495057;
    font-size: 0.95rem;
    font-weight: 600;
}

.context-table-container p {
    margin: 0 0 6px 0;
    color: #6c757d;
    font-size: 0.8rem;
}

.context-entries-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 10px;
}

.context-entries-header h3,
.context-entries-header p {
    margin: 0;
}

.context-buttons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.context-table {
    background: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    overflow: hidden;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
}

/* Context Management Section Styles */
.context-management-container {
    max-width: 800px;
    margin: 0 auto;
}

.context-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.context-selector label {
    font-weight: 600;
    color: #495057;
    margin: 0;
    min-width: 120px;
}

.context-selector select {
    flex: 1;
    max-width: 300px;
}

.context-fields {
    padding: 20px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.context-fields .form-group {
    margin-bottom: 20px;
}

.context-fields label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.context-fields input,
.context-fields textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.context-fields input:focus,
.context-fields textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.context-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.context-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.context-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .context-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .context-selector label {
        min-width: auto;
    }
    
    .context-selector select {
        max-width: none;
    }
    
    .context-actions {
        flex-direction: column;
    }
}

/* Visual feedback for selected RAG data rows */
.tabulator .tabulator-row.tabulator-selected {
    background-color: #e3f2fd !important;
    border-left: 3px solid #2196f3 !important;
}

.tabulator .tabulator-row:hover {
    background-color: #f5f5f5 !important;
}

.tabulator .tabulator-row.tabulator-selected:hover {
    background-color: #bbdefb !important;
}

/* Checkbox styling for table cells */
.tabulator .tabulator-cell input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #007bff;
}

/* =================================================================
   OAUTH / GOOGLE SIGN-IN STYLES
   ================================================================= */

.oauth-container {
    margin-bottom: 20px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #dadce0;
    color: #3c4043;
    font-weight: 500;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #c6c9cc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google:active {
    background: #f1f3f4;
}

.btn-google .google-icon {
    flex-shrink: 0;
}

.oauth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #94a3b8;
    font-size: 13px;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.oauth-divider span {
    padding: 0 16px;
}

/* =================================================================
   PENDING APPROVAL STYLES
   ================================================================= */

.pending-approval-container {
    text-align: center;
    padding: 40px 20px;
}

.pending-approval-icon {
    color: #f59e0b;
    margin-bottom: 24px;
}

.pending-approval-icon svg {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pending-approval-container h3 {
    color: #1e293b;
    font-size: 24px;
    margin-bottom: 16px;
}

.pending-approval-container p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.pending-approval-email {
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 20px 0;
}

.pending-approval-email strong {
    color: #334155;
}

#pending-logout-btn {
    margin-top: 24px;
}

/* =================================================================
   ADMIN USER APPROVAL DASHBOARD STYLES
   ================================================================= */

.pending-users-section {
    margin-bottom: 32px;
}

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

.pending-users-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 18px;
    color: #1e293b;
}

.pending-count-badge {
    background: #f59e0b;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

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

.pending-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.pending-user-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pending-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pending-user-name {
    font-weight: 600;
    color: #1e293b;
}

.pending-user-email {
    font-size: 13px;
    color: #64748b;
}

.pending-user-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.pending-user-actions {
    display: flex;
    gap: 8px;
}

.btn-approve {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-approve:hover {
    background: #059669;
}

.btn-reject {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reject:hover {
    background: #dc2626;
}

.no-pending-users {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    background: #f8fafc;
    border-radius: 8px;
}

.no-pending-users svg {
    color: #10b981;
    margin-bottom: 12px;
}

.bulk-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.btn-bulk-approve {
    background: #10b981;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-bulk-approve:hover {
    background: #059669;
} 