/* AI HelpDesk - Admin Styles */
:root {
    --primary-color: #16a34a;
    --primary-hover: #15803d;
    --primary-light: #f0fdf4;
    --primary-border: #bbf7d0;
    --sidebar-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg-white: #ffffff;
    --bg-gray: #f8fafc;
    --bg-hover: #f1f5f9;
    --error-color: #ef4444;
    --error-hover: #dc2626;
    --warning-color: #f59e0b;
    --success-color: #16a34a;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 16px;
    --radius-pill: 9999px;
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* =============================================
   LAYOUT
   ============================================= */

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

/* =============================================
   SIDEBAR
   ============================================= */

.sidebar {
    width: 240px;
    min-width: 240px;
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    gap: 10px;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

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

.nav-item.active {
    background-color: var(--primary-light) !important;
    color: var(--primary-color) !important;
    border-left-color: var(--primary-color) !important;
    font-weight: 600 !important;
}

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

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

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

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

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

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* =============================================
   MAIN CONTENT
   ============================================= */

.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-gray);
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 32px;
}

/* =============================================
   ADMIN HEADER
   ============================================= */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.admin-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn {
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-xs);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    border-color: #cbd5e1;
    background-color: var(--bg-hover);
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
    box-shadow: var(--shadow-xs);
}

.btn-danger:hover:not(:disabled) {
    background-color: var(--error-hover);
    transform: translateY(-1px);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: var(--radius-sm);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* =============================================
   STATS CARDS
   ============================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1000px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .stats-grid { grid-template-columns: 1fr; }
}

.stat-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    min-height: 100px;
    transition: box-shadow 150ms ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
    word-break: break-word;
    /* Embedding provider text is long — scale it down */
}

/* Smaller text for long embedding provider value */
#embeddingProvider {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 2px;
}

/* Green pill for "green" collection status */
#collectionStatus {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    background-color: #dcfce7;
    color: #15803d;
    margin-top: 4px;
}

/* =============================================
   UPLOAD SECTION
   ============================================= */

.upload-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.1px;
}

.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 200ms ease;
    background-color: var(--bg-gray);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.upload-dropzone svg {
    width: 44px;
    height: 44px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: color 200ms ease;
}

.upload-dropzone:hover svg,
.upload-dropzone.dragover svg {
    color: var(--primary-color);
}

.upload-dropzone p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.upload-dropzone p:last-of-type {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
}

.upload-form {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.upload-form.show {
    display: block;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

/* =============================================
   FAQ SECTION
   ============================================= */

.faq-section {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* =============================================
   TABLES
   ============================================= */

.faq-table-wrapper {
    overflow-x: auto;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.documents-table {
    width: 100%;
    border-collapse: collapse;
}

.documents-table th {
    padding: 11px 14px;
    text-align: left;
    background-color: var(--bg-gray);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.documents-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13.5px;
    color: var(--text-primary);
    vertical-align: middle;
}

/* Zebra striping */
.documents-table tbody tr:nth-child(even) td {
    background-color: #fafbfc;
}

.documents-table tbody tr:hover td {
    background-color: var(--primary-light);
}

/* Truncate long Q&A cells */
.documents-table td:nth-child(2),
.documents-table td:nth-child(3) {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Remove border on last row */
.documents-table tbody tr:last-child td {
    border-bottom: none;
}

/* =============================================
   CARD (Uploaded FAQ Documents)
   ============================================= */

.card {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.1px;
}

/* =============================================
   TRAINING STATUS & MODEL SETTINGS PANELS
   ============================================= */

.training-status-panel,
.faq-model-settings {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 18px !important;
    background: var(--bg-white) !important;
    margin-bottom: 16px;
}

.training-status-panel h3,
.faq-model-settings h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* =============================================
   EMPTY STATE
   ============================================= */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    opacity: 0.35;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* =============================================
   BADGES
   ============================================= */

.doc-type-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.doc-type-badge.policy   { background: #dbeafe; color: #1d4ed8; }
.doc-type-badge.procedure{ background: #ede9fe; color: #6d28d9; }
.doc-type-badge.faq      { background: #dcfce7; color: #15803d; }
.doc-type-badge.manual   { background: #ffedd5; color: #c2410c; }
.doc-type-badge.other    { background: #f1f5f9; color: #475569; }

.status-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
}

.status-badge.status-active   { background: #dcfce7; color: #15803d; }
.status-badge.status-inactive { background: #f1f5f9; color: #64748b; }

/* =============================================
   ACTION BUTTONS IN TABLE
   ============================================= */

.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* =============================================
   LOADING SPINNER
   ============================================= */

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

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

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background-color: var(--text-primary);
    color: white;
    padding: 11px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    font-weight: 500;
    animation: slideIn 0.25s ease;
    max-width: 340px;
    line-height: 1.5;
}

.toast.success { background-color: var(--primary-color); }
.toast.error   { background-color: var(--error-color); }
.toast.info    { background-color: #3b82f6; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* =============================================
   MODALS
   ============================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background-color: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 500px;
    width: 92%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: background 150ms ease, color 150ms ease;
}

.modal-close:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* =============================================
   DROPDOWN / MORE ACTIONS
   ============================================= */

.more-actions-wrap {
    position: relative;
    display: inline-block;
}

.more-actions-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 200;
    overflow: hidden;
    animation: menuIn 0.15s ease;
}

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

.dropdown-section-label {
    padding: 8px 14px 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background 120ms ease;
}

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

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* =============================================
   SYNC TOOLTIP
   ============================================= */

.sync-tooltip-wrap {
    position: relative;
    display: inline-block;
}

.sync-tooltip-wrap .sync-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    white-space: normal;
    padding: 8px 13px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 999;
    text-align: center;
    line-height: 1.6;
    min-width: 200px;
}

.sync-tooltip-wrap .sync-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

.sync-tooltip-wrap:hover .sync-tooltip {
    visibility: visible;
    opacity: 1;
}

/* =============================================
   ALERTS
   ============================================= */

.alert {
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 500;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* =============================================
   PAGINATION
   ============================================= */

.faq-pagination-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 0;
}

.faq-pagination-bar .pagination-btn { min-width: 80px; }
.faq-pagination-bar .pagination-btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* =============================================
   LOGIN PAGE (kept for completeness)
   ============================================= */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-gray) 100%);
}

.login-card {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-title { font-size: 1.5rem; color: var(--text-primary); margin-bottom: 8px; font-weight: 700; }
.login-subtitle { color: var(--text-secondary); margin-bottom: 32px; }
.login-buttons { display: flex; flex-direction: column; gap: 14px; }

/* =============================================
   CHAT STYLES (reused on chat.html)
   ============================================= */

.chat-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.chat-message {
    max-width: 72%;
    padding: 13px 18px;
    border-radius: 18px;
    animation: fadeIn 0.25s ease;
    font-size: 14px;
    line-height: 1.65;
}

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

.chat-message.bot {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-xs);
}

.chat-message.user {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message-content { white-space: pre-wrap; }
.message-content ul, .message-content ol { margin-left: 18px; margin-top: 7px; }
.message-content li { margin-bottom: 4px; }
.message-content a, .message-content .deep-link { color: var(--primary-color); text-decoration: underline; word-break: break-all; }
.user .message-content a, .user .message-content .deep-link { color: #bbf7d0; }

.message-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 8px;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.user .message-time { color: rgba(255,255,255,0.65); }

/* Welcome */
.welcome-message {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 480px;
    box-shadow: var(--shadow-sm);
}

.welcome-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: var(--text-primary); }
.welcome-list { list-style: none; margin-bottom: 14px; }
.welcome-list li { padding: 3px 0; color: var(--text-secondary); font-size: 13.5px; }
.welcome-list li::before { content: "→ "; color: var(--primary-color); font-weight: 700; }

/* Input area */
.chat-input-container {
    padding: 14px 20px;
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background-color: var(--bg-gray);
    border-radius: var(--radius-pill);
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.chat-input-wrapper.disabled { opacity: 0.55; pointer-events: none; }

.chat-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 120px;
    font-family: inherit;
    color: var(--text-primary);
}

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

.send-btn {
    background-color: var(--primary-color);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) { background-color: var(--primary-hover); transform: scale(1.05); }
.send-btn:disabled { background-color: var(--border-color); cursor: not-allowed; }

/* Suggestion chips */
.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 20px;
}

.suggestion-chip {
    padding: 7px 15px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 150ms ease;
}

.suggestion-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: fit-content;
    box-shadow: var(--shadow-xs);
}

.typing-dots { display: flex; gap: 4px; }

.typing-dots span {
    width: 7px;
    height: 7px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.3s infinite ease-in-out;
}

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

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

/* Table formatting in messages */
.message-content table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.message-content th, .message-content td { padding: 9px 11px; border: 1px solid var(--border-color); text-align: left; }
.message-content th { background-color: var(--bg-gray); font-weight: 600; }

/* Image preview */
.image-preview-container { display: none; padding: 8px 16px; background-color: var(--bg-gray); border-top: 1px solid var(--border-color); }
.image-preview-container.show { display: flex; align-items: center; gap: 12px; }
.image-preview { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-color); }
.remove-image-btn { background: none; border: none; color: var(--error-color); cursor: pointer; font-size: 18px; padding: 4px; }

/* KB banner */
.kb-pending-banner { background-color: var(--warning-color); color: white; padding: 11px 24px; text-align: center; display: none; font-size: 13.5px; font-weight: 500; }
.kb-pending-banner.show { display: block; }

/* Upload btn */
.upload-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); transition: all 150ms ease; }
.upload-btn:hover { background-color: var(--bg-white); color: var(--primary-color); }

/* Suggestions dropdown */
.suggestions-container { position: absolute; bottom: 100%; left: 0; right: 0; background-color: var(--bg-white); border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: 8px; max-height: 280px; overflow-y: auto; box-shadow: var(--shadow-md); display: none; }
.suggestions-container.show { display: block; }
.suggestion-item { padding: 11px 14px; cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: background 150ms ease; }
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background-color: var(--primary-light); }
.suggestion-question { font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.suggestion-category { font-size: 11.5px; color: var(--text-muted); }

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -240px;
        z-index: 100;
        transition: left 0.25s ease;
        height: 100vh;
    }
    .sidebar.open { left: 0; }
    .admin-container { padding: 18px 16px; }
    .chat-message { max-width: 90%; }
    .admin-header { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* File input hidden */
input[type="file"] { display: none; }

/* =============================================
   UTILITY
   ============================================= */

.clear-history-btn {
    background-color: var(--primary-color);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: background 150ms ease;
}

.clear-history-btn:hover { background-color: var(--primary-hover); }

/* Analysis summary */
.analysis-summary { margin-bottom: 16px; padding: 12px 14px; background: var(--bg-gray); border-radius: var(--radius-md); font-size: 13.5px; line-height: 1.6; border: 1px solid var(--border-color); }

/* Inactive doc row */
.doc-row-inactive { opacity: 0.7; background-color: var(--bg-gray); }
.doc-row-inactive:hover td { background-color: #edf0f3 !important; }

/* =============================================
   Pending FAQs (prefixed .pending-)
   ============================================= */
.pending-stats-grid { margin-bottom: 24px; }
.pending-stat-card { min-height: 100px; }
.pending-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.pending-tab { padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--text-secondary); background: none; border: none; border-bottom: 3px solid transparent; cursor: pointer; font-family: inherit; transition: color 150ms ease, border-color 150ms ease; }
.pending-tab:hover { color: var(--text-primary); }
.pending-tab.pending-tab-active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.pending-tab-content { background: var(--bg-white); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--border-color); }
.pending-table-wrapper { overflow-x: auto; margin-bottom: 12px; }
.pending-table { width: 100%; }
.pending-empty { padding: 24px; text-align: center; color: var(--text-muted); }
.pending-badge { margin-left: auto; background: #ef4444; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 999px; }
.pending-badge-nav { display: inline-block; margin-right: 8px; }
.pending-review-query { padding: 12px 14px; background: var(--bg-hover); border-radius: var(--radius-md); font-size: 13px; white-space: pre-wrap; max-height: 120px; overflow-y: auto; border: 1px solid var(--border-color); border-left: 3px solid var(--primary-color); }
.pending-review-original { padding: 10px 12px; background: rgba(245, 158, 11, 0.12); border-radius: var(--radius-md); font-size: 13px; white-space: pre-wrap; max-height: 120px; overflow-y: auto; border: 1px solid var(--warning-color); }
.pending-review-readonly { padding: 10px 12px; background: var(--bg-gray); border-radius: var(--radius-md); font-size: 13px; white-space: pre-wrap; max-height: 120px; overflow-y: auto; border: 1px solid var(--border-color); }
.form-error { display: block; font-size: 12px; color: var(--error-color); margin-top: 4px; }
.btn-full { width: 100%; }
/* Category badges for Approved tab */
.category-badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; }
.category-general { background: #f1f5f9; color: #475569; }
.category-procedures { background: #dbeafe; color: #1d4ed8; }
.category-navigation { background: #ede9fe; color: #6d28d9; }
.category-attendance { background: #ffedd5; color: #c2410c; }
.category-leave { background: #ccfbf1; color: #0f766e; }
.category-payroll { background: #dcfce7; color: #15803d; }
.category-other { background: #f1f5f9; color: #64748b; }
.approved-row { border-left: 3px solid var(--success-color); }
.ask-count-pill { display: inline-block; margin-left: 4px; padding: 2px 6px; font-size: 10px; font-weight: 600; border-radius: var(--radius-pill); background: #dcfce7; color: #15803d; }

/* .bulk-upload-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bulk-clear-link { font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.bulk-clear-link:hover { color: var(--primary-color); text-decoration: underline; } */

.bulk-upload-actions { display: flex; align-items: center; gap: 8px; }
.bulk-clear-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background: var(--bg-white);
    transition: all 150ms ease;
    white-space: nowrap;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.bulk-clear-link:hover {
    border-color: #cbd5e1;
    background-color: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}
.pending-modal.show { display: flex; }