/**
 * Components CSS
 * Reusable UI components across the application
 *
 * Contents:
 * - Section Headers (gradient backgrounds)
 * - Search/Filter Forms
 * - Cards (containers, stat cards, agent cards)
 * - Tables (dashboard, profile, contact)
 * - Modals/Dialogs
 * - Buttons (standard, action, icon)
 * - Toast Notifications
 * - Animations
 * - Page Headers
 * - Configuration Sections
 * - Form Inputs
 * - Badges/Pills
 * - Alerts/Info Boxes
 * - Interactive States (hover effects)
 * - Customer Selection
 */

/* ============================================
   Accessibility - Focus Styles
   ============================================ */

/* Global focus outline for keyboard navigation */
*:focus-visible {
    outline: 2px solid #1a2234;
    outline-offset: 2px;
}

/* Button focus styles */
.btn-action:focus-visible,
.btn-icon:focus-visible,
button:focus-visible {
    outline: 2px solid #1a2234;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(61, 79, 149, 0.2);
}

/* Link focus styles */
a:focus-visible {
    outline: 2px solid #1a2234;
    outline-offset: 2px;
}

/* Remove default outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Nav item focus */
.nav-item:focus-visible {
    background-color: rgba(255, 255, 255, 0.15);
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: -2px;
}

/* Widget pill/tab focus */
.widget-nav-pill:focus-visible {
    outline: 2px solid #1a2234;
    outline-offset: 2px;
}

/* Skip link for keyboard users (hidden until focused) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #1a2234;
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: 500;
}

.skip-link:focus {
    top: 0;
}

/* ============================================
   Section Headers - Fortune 500 Style
   Clean white/light background, grey text, no gradient
   ============================================ */

.section-header {
    background-color: var(--content-card-bg, white);
    color: var(--content-heading, #374151);
    padding: 16px 20px;
    border-bottom: 1px solid var(--content-border, #e5e7eb);
}

.section-header-rounded {
    border-radius: var(--radius-lg, 8px) var(--radius-lg, 8px) 0 0;
}

.section-header h2,
.section-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--content-heading, #374151);
}

.section-header h2 i,
.section-header h3 i {
    color: var(--icon-default, #9ca3af);
}

.section-header p {
    margin: 5px 0 0 0;
    color: var(--content-text-muted, #6b7280);
    font-size: 0.9em;
}

/* Section header with controls - flex layout for title + form */
.section-header-with-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header-title {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: var(--content-heading, #374151);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header-title i {
    color: var(--icon-default, #9ca3af);
    font-size: 0.9em;
}

/* Legacy gradient header - use .section-header-gradient if gradient is needed */
.section-header-gradient {
    background: linear-gradient(135deg, #1a2234, #5a73d4);
    color: white;
    padding: 20px;
}

.section-header-gradient h2,
.section-header-gradient h3 {
    color: white;
}

.section-header-gradient h2 i,
.section-header-gradient h3 i {
    color: white;
}

/* ============================================
   Search/Filter Forms within Headers - Fortune 500 Style
   Light background compatible
   ============================================ */

.header-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-left: auto;
}

.header-input,
.header-select {
    padding: 8px 12px;
    border: 1px solid var(--input-border, #d1d5db);
    border-radius: var(--radius-md, 6px);
    background: var(--input-bg, white);
    color: var(--input-text, #4b5563);
    font-size: 0.9em;
}

.header-input {
    flex: 1 1 250px;
    min-width: 200px;
}

.header-select {
    flex: 0 1 140px;
    min-width: 120px;
}

.header-input::placeholder {
    color: var(--input-placeholder, #9ca3af);
}

.header-input:focus,
.header-select:focus {
    background: var(--input-bg, white);
    outline: none;
    border-color: var(--input-border-focus, #1a2234);
    box-shadow: 0 0 0 2px rgba(26, 34, 52, 0.1);
}

.header-select option {
    background: var(--content-card-bg, white);
    color: var(--content-text, #4b5563);
}

.header-button {
    flex: 0 0 auto;
    padding: 8px 16px;
    background-color: var(--btn-secondary-bg, #e5e7eb);
    color: var(--btn-secondary-text, #374151);
    border: 1px solid var(--content-border, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    white-space: nowrap;
    transition: all 0.2s;
}

.header-button:hover {
    background-color: var(--btn-secondary-bg-hover, #d1d5db);
    border-color: var(--content-border, #d1d5db);
}

.header-button i {
    margin-right: 6px;
}

/* Header button variant - primary (for important actions) */
.header-button-primary {
    background-color: var(--color-primary-light, #e8ebf5);
    color: var(--color-primary-dark, #1a2234);
    border-color: var(--color-primary, #3d4f95);
}

.header-button-primary:hover {
    background-color: var(--color-primary, #3d4f95);
    color: white;
    border-color: var(--color-primary, #3d4f95);
}

/* Header button variant - success (for add/create actions) */
.header-button-success {
    background-color: var(--accent-success-light, #d1fae5);
    color: var(--badge-success-text, #065f46);
    border-color: var(--accent-success, #059669);
}

.header-button-success:hover {
    background-color: var(--accent-success, #059669);
    color: white;
    border-color: var(--accent-success, #059669);
}

/* Header label for filters */
.header-label {
    color: var(--content-text-muted, #6b7280);
    font-size: 0.85em;
    font-weight: 500;
}

/* Legacy dark header form controls - use within .section-header-gradient */
.section-header-gradient .header-input,
.section-header-gradient .header-select {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.section-header-gradient .header-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.section-header-gradient .header-input:focus,
.section-header-gradient .header-select:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

.section-header-gradient .header-select option {
    background: #1a2234;
    color: white;
}

.section-header-gradient .header-button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.section-header-gradient .header-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.result-count {
    font-size: 0.8em;
    font-weight: normal;
    margin-left: 10px;
}

/* ============================================
   Card Containers
   ============================================ */

.card-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.card-content {
    padding: 20px;
}

.card-content-large {
    padding: 30px;
}

/* ============================================
   Statistics Cards - Fortune 500 Style
   NO decorative colored borders, icons are neutral grey
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Compact stat grid - keeps all cards in a row, shrinks on smaller screens */
.stats-grid-compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .stats-grid-compact {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media (max-width: 600px) {
    .stats-grid-compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.stat-card {
    background-color: var(--content-card-bg, white);
    padding: 12px 16px;
    border-radius: var(--radius-lg, 8px);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.1));
    /* NO border-left - Fortune 500 style */
}

/* Compact stat card - reduced vertical size */
.stat-card-compact {
    background-color: var(--content-card-bg, white);
    padding: 10px 14px;
    border-radius: var(--radius-md, 6px);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-card-clickable {
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card-clickable:hover {
    box-shadow: var(--shadow-md, 0 4px 8px rgba(0, 0, 0, 0.12));
    transform: translateY(-1px);
}

/* Legacy color variants - NO LONGER apply borders, kept for compatibility */
.stat-card-primary,
.stat-card-success,
.stat-card-warning,
.stat-card-info,
.stat-card-danger,
.stat-card-secondary {
    /* No colored borders - Fortune 500 style */
}

.stat-card-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.stat-card-label {
    color: var(--content-text-muted, #666);
    font-size: 0.85em;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-card-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--content-heading, #333);
}

/* Compact value - smaller text for tight layouts */
.stat-card-value-compact {
    font-size: 1.3em;
}

.stat-card-icon {
    font-size: 1.5em;
    color: var(--icon-default, #9ca3af);
    opacity: 0.8;
}

/* Compact icon - smaller for tight layouts */
.stat-card-icon-compact {
    font-size: 1.2em;
}

/* Icon color variants - all neutral grey by default (Fortune 500)
   Only use colored variants for true semantic meaning */
.stat-card-icon.primary,
.stat-card-icon.success,
.stat-card-icon.warning,
.stat-card-icon.info,
.stat-card-icon.danger,
.stat-card-icon.secondary {
    color: var(--icon-default, #9ca3af);
}

/* ============================================
   Tables
   ============================================ */

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

.dashboard-table thead {
    border-bottom: 2px solid #1a2234;
}

.dashboard-table th {
    text-align: left;
    padding: 12px;
    font-weight: 600;
    color: #495057;
}

.dashboard-table th.text-center {
    text-align: center;
}

/* Sortable table headers */
.dashboard-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.dashboard-table th.sortable:hover {
    background-color: var(--content-bg, #f5f7fa);
}

.dashboard-table th .sort-icon {
    margin-left: 6px;
    font-size: 0.8em;
    color: var(--content-text-muted, #6b7280);
    opacity: 0.5;
}

.dashboard-table th.sortable:hover .sort-icon {
    opacity: 1;
}

.dashboard-table tbody tr {
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dashboard-table tbody tr:hover {
    background-color: #f8f9fa;
}

.dashboard-table td {
    padding: 6px;
}

.dashboard-table td.text-center {
    text-align: center;
}

/* Profile Detail Tables */
.profile-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.profile-table tr {
    border-bottom: 1px solid #e9ecef;
}

.profile-table-label {
    padding: 5px 15px;
    width: 35%;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.profile-table-value {
    padding: 5px 15px;
    color: #333;
}

/* Profile view: hide empty ("Not set") field rows when toggled off */
.profile-fields-table.hide-empty .crm-empty-field-row {
    display: none;
}

.crm-profile-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.crm-empty-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.crm-empty-toggle input {
    cursor: pointer;
}

/* Edit Profile modal: spreadsheet-style row editor */
.crm-edit-table {
    width: 100%;
    border-collapse: collapse;
}

.crm-edit-table tr.crm-edit-row {
    border-bottom: 1px solid #eef0f2;
}

.crm-edit-section-row td {
    padding: 14px 8px 6px;
    font-weight: 700;
    color: #1a2234;
    border-bottom: 2px solid #1a2234;
}

.crm-edit-section-row:not(:first-child) td {
    padding-top: 22px;
}

.crm-edit-label {
    width: 34%;
    padding: 6px 14px 6px 8px;
    vertical-align: middle;
}

.crm-edit-label-text {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.crm-edit-desc {
    display: block;
    color: #888;
    font-size: 0.78em;
    margin-top: 2px;
    line-height: 1.3;
}

.crm-edit-value {
    padding: 6px 8px;
    vertical-align: middle;
}

.crm-edit-input {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    box-sizing: border-box;
}

textarea.crm-edit-input {
    resize: vertical;
    min-height: 34px;
}

.crm-edit-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-edit-unit {
    color: #666;
    font-weight: 600;
    font-size: 0.85em;
    white-space: nowrap;
}

.crm-edit-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Contact table */
.contact-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.contact-table thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #1a2234;
}

.contact-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
}

.contact-table th.text-center {
    text-align: center;
}

.contact-table tr {
    border-bottom: 1px solid #e9ecef;
}

.contact-table-cell {
    padding: 12px;
}

.contact-table-cell-name {
    padding: 12px;
    font-weight: 500;
}

.contact-table-cell-muted {
    padding: 12px;
    color: #666;
}

.contact-table-cell-center {
    padding: 12px;
    text-align: center;
}

/* Table Hover Effects */
.table-standard {
    width: 100%;
    border-collapse: collapse;
}

.table-standard th,
.table-standard td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border, #e0e0e0);
}

.table-standard th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom-width: 2px;
}

.table-striped tbody tr:nth-child(even) {
    background-color: var(--color-bg-subtle, #f8f9fa);
}

.table-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.table-row-clickable:hover {
    background-color: #f8f9fa !important;
}

.table-row-hover-light:hover { background-color: #f8f9fa !important; }
.table-row-hover-primary:hover { background-color: #e7f1ff !important; }
.table-row-hover-success:hover { background-color: #d4edda !important; }

/* ============================================
   Modal/Dialog System
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.modal-overlay.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-stacked {
    z-index: 1010;
}

.modal-container {
    position: relative;
    background: white;
    width: 90%;
    max-width: 800px;
    margin: 50px auto;
    border-radius: 10px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.modal-overlay.show .modal-container {
    transform: scale(1);
}

.modal-container-sm { max-width: 400px; }
.modal-container-md { max-width: 600px; }
.modal-container-lg { max-width: 1000px; }
.modal-container-xl { max-width: 1200px; }

/* Supporting-information modal — wide enough for the page-thumbnail grid */
.modal-container-evidence {
    max-width: 1100px;
    width: 95%;
}

/* Modal without separate header/body wrappers — apply inner padding */
.modal-body-only { padding: 24px; }

/* Modal Header - Fortune 500: Clean white with dark text, no gradient */
.modal-header {
    background: var(--content-card-bg, white);
    color: var(--page-heading-color, #1a2234);
    padding: 20px;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid var(--content-border, #e5e7eb);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
    color: var(--page-heading-color, #1a2234);
}

.modal-close {
    background: none;
    border: none;
    color: var(--content-text-muted, #6b7280);
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
    background-color: var(--content-bg, #f5f7fa);
    color: var(--page-heading-color, #1a2234);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 30px;
    background-color: var(--color-bg-light);
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 10px 10px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal-fade-in { animation: modalFadeIn var(--transition-fast); }
.modal-slide-in { animation: modalSlideIn var(--transition-normal); }

/* Party Row - Override form-row grid for inline flex layout */
.party-row.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: #1a2234;
    color: white;
}

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

.btn-success {
    background-color: var(--accent-success, #059669);
    color: white;
}

.btn-success:hover {
    background-color: #047857;
}

.btn-danger {
    background-color: var(--accent-danger, #dc2626);
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* Action Buttons (Extended) */
.btn-action {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.btn-action:disabled,
.btn-action[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-action-green { background-color: var(--accent-success, #059669); color: white; }
.btn-action-green:hover { background-color: #047857; text-decoration: none; }

.btn-action-blue { background-color: var(--accent-primary, #1a2234); color: white; }
.btn-action-blue:hover { background-color: var(--accent-primary-hover, #232f47); text-decoration: none; }

.btn-action-gray { background-color: var(--btn-secondary-bg, #e5e7eb); color: var(--btn-secondary-text, #374151); }
.btn-action-gray:hover { background-color: var(--btn-secondary-bg-hover, #d1d5db); text-decoration: none; }

.btn-action-yellow { background-color: var(--accent-warning-light, #fef3c7); color: var(--badge-warning-text, #92400e); }
.btn-action-yellow:hover { background-color: var(--accent-warning, #d97706); color: white; text-decoration: none; }

.btn-action-red { background-color: #b91c1c; color: white; }
.btn-action-red:hover { background-color: #991b1b; text-decoration: none; }

.btn-action-purple { background-color: #ede9fe; color: #5b21b6; }
.btn-action-purple:hover { background-color: #7c3aed; color: white; text-decoration: none; }

.btn-action-teal { background-color: #ccfbf1; color: #0f766e; }
.btn-action-teal:hover { background-color: #0d9488; color: white; text-decoration: none; }

.btn-action-teal { background-color: var(--accent-info-light, #e0f2fe); color: var(--badge-info-text, #075985); }
.btn-action-teal:hover { background-color: var(--accent-info, #0284c7); color: white; text-decoration: none; }

.btn-action-purple { background-color: #8b5cf6; color: white; }
.btn-action-purple:hover { background-color: #7c3aed; text-decoration: none; }

.btn-action-orange { background-color: #f97316; color: white; }
.btn-action-orange:hover { background-color: #ea580c; text-decoration: none; }

.btn-action-info { background-color: var(--color-info); color: white; }
.btn-action-info:hover { background-color: #138496; text-decoration: none; }

.btn-small-action {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* Small action button variant - success (subtle green for add/create actions) */
.btn-small-action-success {
    padding: 6px 12px;
    font-size: 0.85em;
    background-color: var(--accent-success-light, #d1fae5);
    color: var(--badge-success-text, #065f46);
    border: 1px solid var(--accent-success, #059669);
    border-radius: var(--radius-md, 6px);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-small-action-success:hover {
    background-color: rgba(5, 150, 105, 0.15);
    border-color: var(--accent-success, #059669);
    color: var(--badge-success-text, #065f46);
}

.btn-icon-only {
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Icon Buttons */
.btn-icon {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f8f9fa;
    color: #495057;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-sm {
    padding: 4px 8px;
    font-size: 0.85em;
}

/* Icon button semantic colors - use CSS variables (Fortune 500)
   For play/pause/toggle actions, consider using neutral buttons instead */
.btn-icon-warning {
    background-color: var(--accent-warning-light, #fef3c7);
    color: var(--badge-warning-text, #92400e);
}
.btn-icon-warning:hover {
    background-color: var(--accent-warning, #d97706);
    color: white;
}

.btn-icon-success {
    background-color: var(--accent-success-light, #d1fae5);
    color: var(--badge-success-text, #065f46);
}
.btn-icon-success:hover {
    background-color: var(--accent-success, #059669);
    color: white;
}

/* Primary icon button - neutral grey (Fortune 500: minimize color usage) */
.btn-icon-primary {
    background-color: var(--btn-secondary-bg, #e5e7eb);
    color: var(--btn-secondary-text, #374151);
}
.btn-icon-primary:hover {
    background-color: var(--btn-secondary-bg-hover, #d1d5db);
    color: var(--content-heading, #374151);
}

/* Neutral icon button - for non-semantic actions (edit, calendar, etc.) */
.btn-icon-neutral {
    background-color: var(--btn-secondary-bg, #e5e7eb);
    color: var(--content-text-muted, #6b7280);
}
.btn-icon-neutral:hover {
    background-color: var(--btn-secondary-bg-hover, #d1d5db);
    color: var(--content-heading, #374151);
}

/* Danger icon button - for destructive actions (delete, remove) */
.btn-icon-danger {
    background-color: var(--accent-danger-light, #fee2e2);
    color: var(--badge-danger-text, #991b1b);
}
.btn-icon-danger:hover {
    background-color: var(--accent-danger, #dc2626);
    color: white;
}

/* Button States */
.btn-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

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

.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-processing {
    opacity: 0.8;
    cursor: wait;
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast {
    min-width: 300px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #1a2234;
}

.toast-success { border-left-color: #28a745; }
.toast-error { border-left-color: #dc3545; }
.toast-warning { border-left-color: #ffc107; }
.toast-info { border-left-color: var(--color-primary, #3b5998); }

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: #28a745; }
.toast-error .toast-icon { color: #dc3545; }
.toast-warning .toast-icon { color: #ffc107; }
.toast-info .toast-icon { color: var(--color-primary, #3b5998); }

.toast-message {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: #666;
}

.toast.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

/* ============================================
   Animations
   ============================================ */

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

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

/* ============================================
   Page Headers
   ============================================ */

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

.page-header-title {
    margin: 0;
    color: var(--page-heading-color, #1a2234);
    font-size: 1.75em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header-title i {
    color: var(--page-heading-color, #1a2234);
}

.page-header-title .icon-primary {
    color: var(--page-heading-color, #1a2234);
}

.page-header-subtitle {
    margin: 8px 0 0 0;
    color: var(--content-text-muted, #6b7280);
    font-size: 0.95em;
}

/* Section title - for small uppercase subsection headers */
.section-title {
    color: var(--section-heading, #6b7280);
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Card section title - for h2/h3 headings within card containers (Fortune 500 style) */
.card-section-title {
    color: var(--page-heading-color, #1a2234);
    font-size: var(--font-size-h3, 20px);
    font-weight: var(--font-weight-semibold, 600);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-section-title i {
    color: var(--icon-default, #9ca3af);
    font-size: 0.9em;
}

.page-header-meta {
    margin: 5px 0 0 0;
    color: var(--color-text-muted);
    font-size: 0.9em;
}

.page-header-actions {
    display: flex;
    gap: 10px;
}

/* ============================================
   Detail Page Styles - Fortune 500
   Full-page detail views for documents, records, etc.
   ============================================ */

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 20px;
}

.page-header-left {
    flex: 1;
}

.page-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: var(--content-heading, #374151);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title-icon {
    color: var(--icon-default, #9ca3af);
}

.page-subtitle {
    margin: 6px 0 0 0;
    color: var(--content-text-muted, #6b7280);
    font-size: 0.9em;
}

/* Status Bar */
.detail-status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 12px 16px;
    background-color: var(--content-card-bg, white);
    border-radius: var(--radius-lg, 8px);
    box-shadow: var(--shadow-sm);
}

.detail-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-status-label {
    color: var(--content-text-muted, #6b7280);
    font-size: 0.85em;
}

/* Detail Tabs */
.detail-tabs-container {
    background-color: var(--content-card-bg, white);
    border-radius: var(--radius-lg, 8px) var(--radius-lg, 8px) 0 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

.detail-tabs {
    display: flex;
    padding: 0 16px;
    border-bottom: 1px solid var(--content-border, #e5e7eb);
    overflow-x: auto;
}

/* Tab Panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.detail-content {
    background-color: var(--content-card-bg, white);
    border-radius: 0 0 var(--radius-lg, 8px) var(--radius-lg, 8px);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.detail-content .card-container {
    box-shadow: none;
    border-radius: 0;
}

.detail-content .card-content {
    padding: 24px;
}

/* Section titles within detail pages */
.section-title {
    color: var(--content-heading, #374151);
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--icon-default, #9ca3af);
}

.subsection-title {
    color: var(--content-heading, #374151);
    font-size: 0.95em;
    font-weight: 600;
    margin: 0 0 12px 0;
}

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

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

/* Detail Info Grid */
.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.detail-info-grid-wide {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.detail-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-info-label {
    color: var(--content-text-muted, #6b7280);
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-info-value {
    color: var(--content-heading, #374151);
    font-size: 0.95em;
}

/* Detail Text Blocks */
.detail-text-block {
    padding: 16px;
    background-color: var(--content-bg, #f5f7fa);
    border-radius: var(--radius-md, 6px);
    color: var(--content-text, #4b5563);
    line-height: 1.6;
    white-space: pre-wrap;
}

.detail-text-block-lg {
    max-height: 500px;
    overflow-y: auto;
}

.detail-section {
    margin-top: 20px;
}

.detail-list {
    margin: 0;
    padding-left: 20px;
    color: var(--content-text, #4b5563);
}

.detail-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Source Text Container */
.source-text-container {
    max-height: 600px;
    overflow-y: auto;
    background-color: var(--content-bg, #f5f7fa);
    border-radius: var(--radius-md, 6px);
    border: 1px solid var(--content-border, #e5e7eb);
}

.source-text-pre {
    margin: 0;
    padding: 16px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85em;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--content-text, #4b5563);
}

/* Search in text */
.search-info {
    padding: 8px 12px;
    margin-bottom: 12px;
    background-color: var(--accent-info-light, #e0f2fe);
    border-radius: var(--radius-sm, 4px);
    color: var(--badge-info-text, #075985);
    font-size: 0.85em;
}

.search-highlight {
    background-color: var(--accent-warning-light, #fef3c7);
    padding: 1px 2px;
    border-radius: 2px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--content-text-muted, #6b7280);
}

.empty-state-icon {
    font-size: 3em;
    color: var(--icon-muted, #d1d5db);
    margin-bottom: 16px;
}

.empty-state p {
    margin: 8px 0;
}

/* Small form input variant */
.form-input-sm {
    padding: 6px 10px;
    font-size: 0.85em;
}

/* ============================================
   Configuration Form Sections
   ============================================ */

.config-section {
    margin-bottom: 40px;
}

.config-section-header {
    margin-bottom: 25px;
}

.config-section-title {
    color: #1a2234;
    font-size: 1.4em;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-section-divider {
    border: none;
    height: 1px;
    background: #e5e7eb;
    margin: 10px 0 0 0;
}

/* Legacy color variants - kept for backwards compatibility but discouraged */
/* Fortune 500 design: use neutral dividers, not colored ones */
.config-section-title-purple { color: #6f42c1; }
.config-section-title-teal { color: #17a2b8; }
.config-section-title-green { color: #28a745; }

.config-section-divider-purple { background: #e5e7eb; }
.config-section-divider-teal { background: #e5e7eb; }
.config-section-divider-green { background: #e5e7eb; }

/* ============================================
   Form Input Fields
   ============================================ */

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: #1a2234;
    outline: none;
    box-shadow: 0 0 0 3px rgba(61, 79, 149, 0.1);
}

.form-input-error { border-color: #dc3545; }
.form-input-error:focus { border-color: #dc3545; box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1); }

.form-input-success { border-color: #28a745; }
.form-input-success:focus { border-color: #28a745; box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1); }

.form-input-warning { border-color: #ffc107; }
.form-input-warning:focus { border-color: #ffc107; box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1); }

.form-input-static {
    padding: var(--spacing-sm);
    background: var(--content-bg);
    border: 1px solid var(--content-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-body);
    color: var(--content-text);
}

.form-success-text { color: #28a745; font-size: 0.85em; margin-top: 5px; }
.form-warning-text { color: #ffc107; font-size: 0.85em; margin-top: 5px; }

/* Input with icon - for disabled fields showing provider/type info */
.input-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-with-icon i {
    color: var(--color-primary, #4A90E2);
    font-size: 1.1em;
    flex-shrink: 0;
}

.input-with-icon .form-input {
    flex: 1;
    min-width: 0; /* Prevent overflow */
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1em;
}

.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.form-textarea:focus {
    border-color: #1a2234;
    outline: none;
    box-shadow: 0 0 0 3px rgba(61, 79, 149, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.form-help-text {
    color: #666;
    font-size: 0.85em;
    display: block;
    margin-top: 5px;
}

.form-error-text {
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 5px;
}

.form-checkbox {
    margin-right: 8px;
}

/* ============================================
   Badge and Pill Styles
   ============================================ */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.badge-pill {
    border-radius: 12px;
    padding: 4px 10px;
}

.badge-success { background-color: #d4edda; color: #155724; }
.badge-warning { background-color: #fff3cd; color: #856404; }
.badge-info { background-color: #d1ecf1; color: #0c5460; }
.badge-danger { background-color: #f8d7da; color: #721c24; }
.badge-secondary { background-color: #e2e3e5; color: #383d41; }
.badge-primary { background-color: #e7f3ff; color: #0056b3; }
.badge-gray { background-color: #f0f0f0; color: #333; }

/* ============================================
   Connector Logos - For tables and lists
   ============================================ */

.connector-logo-img {
    max-width: 24px;
    max-height: 24px;
    margin-right: 8px;
    vertical-align: middle;
    object-fit: contain;
}

.connector-logo-icon {
    color: var(--color-primary, #4A90E2);
    margin-right: 8px;
    font-size: 1.2em;
    vertical-align: middle;
}

/* ============================================
   Progress Bars
   ============================================ */

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: var(--color-border, #e0e0e0);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-primary, #4A90E2);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-bar-fill-green {
    background: var(--color-success, #27ae60);
}

.progress-bar-fill-yellow {
    background: var(--color-warning, #f39c12);
}

/* ============================================
   Financial Summary
   ============================================ */

.fin-summary-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 24px;
    margin-bottom: 24px;
}

.fin-grand-total {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text, #2c3e50);
    line-height: 1.2;
}

.fin-grand-total-label {
    font-size: 0.85rem;
    color: var(--color-text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.fin-breakdown-row {
    display: flex;
    gap: 32px;
    margin-top: 8px;
}

.fin-breakdown-item {
    display: flex;
    flex-direction: column;
}

.fin-breakdown-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text, #2c3e50);
}

.fin-breakdown-label {
    font-size: 0.75rem;
    color: var(--color-text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fin-verification-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-bg-subtle, #f8f9fa);
    border-radius: 8px;
    margin-bottom: 20px;
}

.fin-verification-row .progress-bar-track {
    flex: 1;
}

.fin-verification-label {
    font-size: 0.85rem;
    color: var(--color-text-muted, #888);
    white-space: nowrap;
}

.fin-verification-pct {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text, #2c3e50);
    white-space: nowrap;
}

.fin-category-card {
    padding: 14px;
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fin-category-card:hover {
    border-color: var(--color-primary, #4A90E2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.fin-category-name {
    font-size: 0.8rem;
    color: var(--color-text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.fin-category-amount {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text, #2c3e50);
}

.fin-category-count {
    font-size: 0.75rem;
    color: var(--color-text-muted, #888);
    margin-top: 2px;
}

.fin-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.fin-subtab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--color-border, #e0e0e0);
    margin-bottom: 20px;
}

.fin-subtab {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted, #888);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.fin-subtab:hover {
    color: var(--color-text, #2c3e50);
}

.fin-subtab.active {
    color: var(--color-primary, #4A90E2);
    border-bottom-color: var(--color-primary, #4A90E2);
}

.fin-events-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

/* ============================================
   Status Pills - Unified Fortune 500 Style
   Use these for all status indicators across the app
   ============================================ */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
}

.status-pill i {
    font-size: 12px;
}

/* Active/Success - Muted green */
.status-pill-active,
.status-pill-success,
.status-pill-uploaded,
.status-pill-completed {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

/* Warm - Light green/lime (heat map: between warning and success) */
.status-pill-warm {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #86efac;
}

/* Inactive/Disabled - Muted gray */
.status-pill-inactive,
.status-pill-disabled {
    background-color: #f3f4f6;
    color: #4b5563;
    border-color: #d1d5db;
}

/* Warning/Pending - Muted amber */
.status-pill-warning,
.status-pill-pending,
.status-pill-processing {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fcd34d;
}

/* Error/Failed - Muted red */
.status-pill-error,
.status-pill-failed,
.status-pill-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Info/Unknown - Muted blue */
.status-pill-info,
.status-pill-unknown {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* Placeholder - Very muted */
.status-pill-placeholder {
    background-color: #f9fafb;
    color: #6b7280;
    border-color: #e5e7eb;
}

/* Legacy solid badge styles (deprecated - use status-pill instead) */
.badge-success-solid {
    padding: 4px 12px;
    background-color: #28a745;
    color: white;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.badge-inactive {
    padding: 4px 12px;
    background-color: #6c757d;
    color: white;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

/* ============================================
   Alert and Info Boxes
   ============================================ */

.alert-box {
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 6px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-box-compact {
    padding: 12px 16px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

/* Alert variants - Using Fortune 500 design system colors */
.alert-box-info {
    background-color: var(--accent-info-light, #e0f2fe);
    border-left-color: var(--accent-info, #0284c7);
    color: var(--badge-info-text, #075985);
}
.alert-box-warning {
    background-color: var(--accent-warning-light, #fef3c7);
    border-left-color: var(--accent-warning, #d97706);
    color: var(--badge-warning-text, #92400e);
}
.alert-box-success {
    background-color: var(--accent-success-light, #d1fae5);
    border-left-color: var(--accent-success, #059669);
    color: var(--badge-success-text, #065f46);
}
.alert-box-danger {
    background-color: var(--accent-danger-light, #fee2e2);
    border-left-color: var(--accent-danger, #dc2626);
    color: var(--badge-danger-text, #991b1b);
}
.alert-box-progress {
    background-color: var(--accent-info-light, #e0f2fe);
    border-left-color: var(--accent-info, #0284c7);
    color: var(--badge-info-text, #075985);
}

/* ============================================
   Card Hover Effects
   ============================================ */

.agent-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
}

.agent-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card-clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.card-clickable:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* ============================================
   Team Member Rows (Activity Manager, etc.)
   ============================================ */

.team-member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    transition: background-color 0.15s ease;
}

.team-member-row:last-child {
    border-bottom: none;
}

.team-member-row:hover {
    background-color: var(--bg-hover, #f9fafb);
}

.team-member-name {
    font-weight: 500;
    min-width: 160px;
    color: var(--content-heading, #333);
}

.team-member-email {
    color: var(--content-text-muted, #666);
    flex: 1;
    font-size: 0.9em;
}

/* ============================================
   Suggested Action Items
   ============================================ */

.suggested-action-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border, #f0f0f0);
}

.suggested-action-item:last-child {
    border-bottom: none;
}

.suggested-action-icon {
    margin-top: 2px;
    flex-shrink: 0;
}

.suggested-action-icon.priority-high { color: #dc3545; }
.suggested-action-icon.priority-medium { color: #f59e0b; }
.suggested-action-icon.priority-low { color: #6b7280; }

/* ============================================
   User Picker Select
   ============================================ */

.user-picker-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: var(--radius-md, 6px);
    background-color: var(--content-card-bg, white);
    font-size: 0.95em;
    color: var(--content-text, #333);
    cursor: pointer;
}

.user-picker-select:focus {
    outline: none;
    border-color: var(--accent-primary, #1a2234);
    box-shadow: 0 0 0 3px rgba(26, 34, 52, 0.1);
}

/* ============================================
   Recipient Checkbox List
   ============================================ */

.recipient-list {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    padding: 4px 0;
}

.recipient-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.recipient-item:hover {
    background-color: var(--bg-hover, #f9fafb);
}

.recipient-item input[type="checkbox"] {
    flex-shrink: 0;
}

.recipient-item-name {
    font-weight: 500;
    color: var(--content-heading, #333);
}

.recipient-item-email {
    color: var(--content-text-muted, #666);
    font-size: 0.85em;
    margin-left: auto;
}

/* ============================================
   Customer Selection - Tabular View (Fortune 500)
   ============================================ */

/* Container - centered layout */
.customer-selection-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 40px 20px;
    background-color: var(--content-bg, #f5f7fa);
}

/* Panel - white card with shadow */
.customer-selection-panel {
    background: var(--content-card-bg, #ffffff);
    border-radius: 8px;
    box-shadow: var(--shadow-lg, 0 4px 12px rgba(0, 0, 0, 0.1));
    width: 100%;
    max-width: 800px;
    padding: 30px;
}

/* Header */
.customer-selection-header {
    margin-bottom: 24px;
    text-align: center;
}

.customer-selection-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--content-heading, #374151);
    margin: 0 0 8px 0;
}

.customer-selection-title i {
    margin-right: 10px;
    color: var(--accent-primary, #3D4F95);
}

.customer-selection-subtitle {
    font-size: 1rem;
    color: var(--content-text-muted, #6b7280);
    margin: 0;
}

/* Search Bar */
.customer-selection-search {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.customer-search-input-wrapper {
    position: relative;
    flex: 1;
}

.customer-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--content-text-muted, #6b7280);
}

.customer-search-input-wrapper .form-input {
    padding-left: 38px;
}

.customer-count-display {
    font-size: 0.875rem;
    color: var(--content-text-muted, #6b7280);
    white-space: nowrap;
}

.customer-count-suspended {
    color: var(--accent-danger, #dc2626);
}

/* Table Container - scrollable */
.customer-selection-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--content-border, #e5e7eb);
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Table Styles */
.customer-selection-table {
    margin: 0;
}

.customer-selection-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--table-header-bg, #f5f7fa);
}

.customer-selection-table th {
    padding: 12px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--content-text-muted, #6b7280);
    font-weight: 600;
}

.customer-selection-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

/* Column widths */
.customer-col-role {
    width: 180px;
}

.customer-col-status {
    width: 120px;
}

/* Row Styles */
.customer-row {
    transition: background-color 0.15s ease;
}

.customer-row:hover {
    background-color: var(--table-row-hover, #f5f7fa);
}

.customer-row-selected {
    background-color: var(--accent-info-light, #e0f2fe) !important;
}

.customer-row-suspended {
    background-color: var(--accent-danger-light, #fee2e2);
}

.customer-row-suspended:hover {
    background-color: #fecaca !important;
}

/* Customer Name Cell */
.customer-cell-name {
    min-width: 200px;
}

.customer-name-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-radio {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary, #3D4F95);
    cursor: pointer;
}

.customer-name-label {
    font-weight: 500;
    color: var(--content-heading, #374151);
    cursor: pointer;
}

.customer-name-suspended {
    color: var(--accent-danger, #dc2626);
}

.customer-website {
    font-size: 0.75rem;
    color: var(--content-text-muted, #6b7280);
    margin-top: 4px;
    margin-left: 28px;
}

.customer-website i {
    margin-right: 4px;
}

.customer-suspension-reason {
    font-size: 0.75rem;
    color: var(--accent-warning, #d97706);
    margin-top: 4px;
    margin-left: 28px;
}

.customer-suspension-reason i {
    margin-right: 4px;
}

/* Role Cell */
.customer-cell-role {
    color: var(--content-text, #4b5563);
}

.customer-role-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.customer-role-muted {
    color: var(--content-text-muted, #6b7280);
}

/* Footer */
.customer-selection-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--content-border, #e5e7eb);
}

/* Current Context */
.customer-current-context {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--content-border, #e5e7eb);
    text-align: center;
    color: var(--content-text-muted, #6b7280);
}

.customer-current-context p {
    margin: 0 0 4px 0;
    font-size: 0.875rem;
}

.customer-current-context small {
    font-size: 0.75rem;
}

/* No Results */
.customer-no-results {
    padding: 40px 20px;
    text-align: center;
    color: var(--content-text-muted, #6b7280);
}

.customer-no-results i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.customer-no-results p {
    margin: 0;
}

/* Legacy support - keep old classes for backwards compatibility */
.customer-option {
    margin: 10px 0;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.customer-option:hover {
    border-color: #1a2234;
    background-color: #f8f9ff;
}

.customer-option.selected {
    border-color: #1a2234;
    background-color: #f8f9ff;
}

.customer-option.suspended-customer {
    border-color: #ffebee;
    background-color: #ffebee;
    opacity: 0.8;
}

.customer-option.suspended-customer:hover {
    border-color: #dc3545;
    background-color: #f8d7da;
    opacity: 1;
}

.customer-option.suspended-customer.selected {
    border-color: #dc3545;
    background-color: #f8d7da;
    opacity: 1;
}

/* ============================================
   Mock Interactivity
   ============================================ */

.mock-hidden {
    display: none !important;
}

.mock-shown.mock-shown-block { display: block; }
.mock-shown.mock-shown-inline-block { display: inline-block; }
.mock-shown.mock-shown-inline { display: inline; }

.mock-toggle-target {
    transition: opacity 0.2s ease-in-out;
}

/* ============================================
   MFA Setup Components
   ============================================ */

.checklist {
    list-style: none;
    padding: 0;
}

.checklist li {
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-success {
    color: var(--color-success);
}

.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.progress-step i {
    font-size: 32px;
}

.progress-step.completed i {
    color: var(--color-success);
}

.progress-step.active i {
    color: var(--color-primary);
}

.progress-step span {
    font-size: 14px;
    font-weight: 500;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--color-border);
    max-width: 100px;
}

.qr-code-container {
    text-align: center;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.qr-code-image {
    max-width: 256px;
    border: 2px solid white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.manual-entry {
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: underline;
    padding: 5px 10px;
}

.manual-code {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.manual-code code {
    font-family: monospace;
    font-size: 16px;
    letter-spacing: 2px;
    background: white;
    padding: 10px 15px;
    border-radius: 4px;
}

.backup-codes-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.backup-code {
    font-family: monospace;
    font-size: 16px;
    letter-spacing: 2px;
    padding: 12px;
    background: white;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

/* ============================================
   Compact Agent Cards - Fortune 500 Style
   ============================================ */

.compact-agent-card {
    background-color: var(--content-card-bg, white);
    border-radius: var(--radius-lg, 8px);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.1));
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.compact-agent-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 8px rgba(0,0,0,0.15));
}

/* Agent Card Header - Fortune 500: No gradient, grey text, no border */
.compact-agent-card-header {
    background: transparent;
    color: var(--section-heading, #6b7280);
    padding: 16px 16px 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: none;
}

.compact-agent-card-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm, 4px);
    object-fit: cover;
    background-color: var(--content-bg, #f5f7fa);
    flex-shrink: 0;
}

.compact-agent-card-icon-placeholder {
    width: 28px;
    height: 28px;
    background-color: var(--content-bg, #f5f7fa);
    border-radius: var(--radius-sm, 4px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.compact-agent-card-icon-placeholder i {
    font-size: 14px;
    color: var(--icon-default, #9ca3af);
}

.compact-agent-card-title-wrapper {
    flex: 1;
    min-width: 0;
}

.compact-agent-card-title {
    margin: 0;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--section-heading, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* Status Indicator - Only show for errors */
.compact-agent-card-status {
    display: none; /* Hide by default */
}

.compact-agent-card-status-error {
    display: block; /* Only show error state */
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-danger, #dc2626);
    flex-shrink: 0;
}

/* Hide active and ready status dots */
.compact-agent-card-status-active,
.compact-agent-card-status-ready {
    display: none;
}

.compact-agent-card-content {
    padding: 16px;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.compact-agent-card-description {
    margin: 0;
    color: var(--content-text, #4b5563);
    font-size: 0.85em;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact-agent-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}

.compact-agent-card-footer i {
    font-size: 0.75em;
    color: var(--content-text-muted, #6b7280);
}

.compact-agent-card-footer span {
    font-size: 0.75em;
    color: var(--content-text-muted, #6b7280);
}

/* Page Heading Styles */
.page-heading {
    color: var(--page-heading-color, #1a2234);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.page-heading-logo {
    width: 20px;
    height: auto;
}

.page-heading-icon {
    font-size: 1em;
    color: var(--page-heading-color, #1a2234);
}

/* Logo in page-header-title */
.page-header-title .page-heading-logo {
    width: 24px;
    height: auto;
}

/* ============================================
   Stat Card Additional Utilities
   Main stat-card styles are defined earlier in this file
   ============================================ */

/* Stat card header variant (for more complex stat cards) */
.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: var(--content-heading, #374151);
}

/* Stat values - use neutral colors for counts, semantic only for status */
.stat-value-primary { color: var(--content-heading, #374151); } /* Neutral dark grey for counts */
.stat-value-neutral { color: var(--content-heading, #374151); } /* Neutral dark grey */
.stat-value-success { color: var(--accent-success, #059669); } /* Green only for positive status */
.stat-value-danger { color: var(--accent-danger, #dc2626); }   /* Red only for errors/issues */

.stat-card-description {
    color: var(--content-text-muted, #666);
    margin: 5px 0 0 0;
    font-size: 0.9em;
}

/* Stat card icons - muted grey by default (Fortune 500) */
.stat-icon-primary,
.stat-icon-neutral,
.stat-icon-success,
.stat-icon-danger {
    color: var(--icon-default, #9ca3af);
    margin-right: 10px;
}

/* ============================================
   Sidebar Image Icons
   For img-based icons (like the Commons logo)
   that need opacity treatment to match FontAwesome icons
   ============================================ */

#flock-sidebar .nav-icon-img {
    width: 20px;
    height: auto;
    margin-right: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

#flock-sidebar .nav-item:hover .nav-icon-img {
    opacity: 1;
}

#flock-sidebar .nav-item.active .nav-icon-img,
#flock-sidebar .nav-item[aria-current="page"] .nav-icon-img {
    opacity: 1;
}

/* ============================================
   Advisor Components - Fortune 500 Style
   Clean, minimal design with typography hierarchy
   ============================================ */

/* Advisor Container - Grid layout for chat interface */
.advisor-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    flex: 1;
    min-height: 0; /* Important for flex child with overflow */
}

/* Left Navigation Panel */
.advisor-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

/* Section Cards */
.advisor-section {
    background-color: var(--content-card-bg, white);
    border-radius: var(--radius-lg, 8px);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.1));
    overflow: hidden;
}

/* Section Headers - Fortune 500: Grey text, no gradient */
.advisor-section-header {
    background: transparent;
    color: var(--section-heading, #6b7280);
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--content-border, #e5e7eb);
    display: flex;
    align-items: center;
    gap: 8px;
}

.advisor-section-header i {
    color: var(--icon-default, #9ca3af);
    font-size: 0.9em;
}

.advisor-section-content {
    padding: 8px;
    max-height: 280px;
    overflow-y: auto;
}

/* Agent/Tier/Topic Buttons */
.advisor-button {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 4px;
    background-color: var(--content-bg, #f5f7fa);
    border: 1px solid var(--content-border, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.advisor-button:hover {
    background-color: var(--content-card-bg, white);
    border-color: var(--accent-primary, #1a2234);
}

.advisor-button.active {
    background-color: var(--accent-primary, #1a2234);
    color: white;
    border-color: var(--accent-primary, #1a2234);
}

.advisor-button-title {
    font-weight: 600;
    font-size: 0.875em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.advisor-button-title i {
    color: var(--icon-default, #9ca3af);
}

.advisor-button.active .advisor-button-title i {
    color: white;
}

.advisor-button-desc {
    font-size: 0.75em;
    color: var(--content-text-muted, #6b7280);
    margin-top: 4px;
}

.advisor-button.active .advisor-button-desc {
    color: rgba(255, 255, 255, 0.8);
}

/* Focus-list explainer + per-agent tool list */
.advisor-nav-hint {
    font-size: 0.75em;
    color: var(--content-text-muted, #6b7280);
    padding: 8px 12px 12px;
    line-height: 1.4;
}

.advisor-button-tools {
    font-size: 0.7em;
    color: var(--content-text-muted, #6b7280);
    margin-top: 4px;
    line-height: 1.4;
}

.advisor-button.active .advisor-button-tools {
    color: rgba(255, 255, 255, 0.85);
}

/* Back Button */
.advisor-back-btn {
    padding: 8px 12px;
    margin-bottom: 8px;
    background-color: transparent;
    border: 1px solid var(--content-border, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    color: var(--content-text-muted, #6b7280);
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.advisor-back-btn:hover {
    background-color: var(--content-bg, #f5f7fa);
    color: var(--content-text, #4b5563);
}

/* Chat Area */
.advisor-chat {
    background-color: var(--content-card-bg, white);
    border-radius: var(--radius-lg, 8px);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.1));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Header - Fortune 500: Clean, no gradient */
.advisor-chat-header {
    background-color: var(--content-card-bg, white);
    color: var(--content-heading, #374151);
    padding: 16px 20px;
    border-bottom: 1px solid var(--content-border, #e5e7eb);
}

.advisor-chat-title {
    font-size: 1.125em;
    font-weight: 600;
    color: var(--page-heading-color, #1a2234);
    display: flex;
    align-items: center;
    gap: 10px;
}

.advisor-chat-title i {
    color: var(--icon-default, #9ca3af);
}

.advisor-chat-subtitle {
    font-size: 0.8em;
    color: var(--content-text-muted, #6b7280);
    margin-top: 4px;
}

.advisor-chat-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.advisor-reset-btn {
    padding: 6px 12px;
    background-color: var(--btn-secondary-bg, #e5e7eb);
    border: none;
    border-radius: var(--radius-md, 6px);
    color: var(--btn-secondary-text, #374151);
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s;
}

.advisor-reset-btn:hover {
    background-color: var(--btn-secondary-bg-hover, #d1d5db);
}

/* Messages Area */
.advisor-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--content-bg, #f5f7fa);
}

.advisor-message {
    margin-bottom: 16px;
}

.advisor-message-user {
    text-align: right;
}

.advisor-message-content {
    display: inline-block;
    max-width: 75%;
    padding: 12px 16px;
    border-radius: var(--radius-lg, 8px);
}

.advisor-message-user .advisor-message-content {
    background-color: var(--accent-primary, #1a2234);
    color: white;
    border-bottom-right-radius: 4px;
}

.advisor-message-assistant .advisor-message-content {
    background-color: var(--content-card-bg, white);
    color: var(--content-text, #4b5563);
    border: 1px solid var(--content-border, #e5e7eb);
    border-bottom-left-radius: 4px;
}

.advisor-message-label {
    font-weight: 600;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    opacity: 0.8;
}

.advisor-message-text {
    line-height: 1.5;
    font-size: 0.9em;
}

.advisor-message-time {
    font-size: 0.7em;
    opacity: 0.6;
    margin-top: 6px;
}

/* Empty State */
.advisor-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--content-text-muted, #6b7280);
}

.advisor-empty-state i {
    font-size: 48px;
    color: var(--icon-muted, #d1d5db);
    margin-bottom: 16px;
    display: block;
}

.advisor-empty-state p {
    margin: 8px 0;
}

/* Typing Indicator */
.advisor-typing {
    display: inline-block;
    padding: 12px 16px;
    background-color: var(--content-card-bg, white);
    border: 1px solid var(--content-border, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
}

.advisor-typing-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: var(--icon-default, #9ca3af);
    border-radius: 50%;
    animation: advisor-typing 1s infinite;
}

.advisor-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.advisor-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes advisor-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Input Area */
.advisor-input-area {
    padding: 16px 20px;
    background-color: var(--content-card-bg, white);
    border-top: 1px solid var(--content-border, #e5e7eb);
}

.advisor-input-form {
    display: flex;
    gap: 12px;
}

.advisor-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--input-border, #d1d5db);
    border-radius: var(--radius-md, 6px);
    font-size: 0.9em;
    background-color: var(--input-bg, white);
    color: var(--input-text, #4b5563);
    transition: border-color 0.2s;
}

.advisor-input:focus {
    outline: none;
    border-color: var(--input-border-focus, #1a2234);
}

.advisor-input::placeholder {
    color: var(--input-placeholder, #9ca3af);
}

.advisor-send-btn {
    padding: 12px 20px;
    background-color: var(--btn-primary-bg, #1a2234);
    color: var(--btn-primary-text, white);
    border: none;
    border-radius: var(--radius-md, 6px);
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.advisor-send-btn:hover:not(:disabled) {
    background-color: var(--btn-primary-bg-hover, #2a3a7a);
}

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

/* ============================================
   Slideshow Controls (CIM Document Detail)
   ============================================ */

.slideshow-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bg-tertiary, #f8f9fa);
    border-radius: var(--radius-md, 6px);
    border: 1px solid var(--border-color, #e5e7eb);
}

.slideshow-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slideshow-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Slide Section */
.slide-section {
    background-color: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
}

.slide-section-header {
    padding: 16px 20px;
    background-color: var(--bg-tertiary, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.slide-section-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    display: flex;
    align-items: center;
    gap: 10px;
}

.slide-section-header h4 i {
    color: var(--color-primary, #3b5998);
}

.slide-section-body {
    padding: 20px;
}

/* Detail Field */
.detail-field {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light, #f3f4f6);
}

.detail-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.detail-field-value {
    font-size: 0.95rem;
    color: var(--text-primary, #1f2937);
    line-height: 1.5;
}

.detail-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.detail-field-header .detail-field-label {
    margin-bottom: 0;
}

.detail-field-edit {
    margin-top: 8px;
}

.detail-field-edit textarea {
    width: 100%;
    min-height: 80px;
    padding: 8px 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    resize: vertical;
    font-family: inherit;
    color: var(--text-primary, #1f2937);
}

/* ============================================
   Intake Form Grid (CIM Document Detail)
   ============================================ */

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

.intake-form-field {
    background-color: var(--bg-tertiary, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    padding: 16px;
}

.intake-field-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.intake-field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.intake-field-value {
    font-size: 0.95rem;
    color: var(--text-primary, #1f2937);
    line-height: 1.5;
}

.intake-field-edit {
    margin-top: 8px;
}

.intake-field-edit .form-input {
    width: 100%;
    margin-bottom: 0;
}

/* Intake Form Category Section */
.intake-category-section {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
}

.intake-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background-color: var(--bg-tertiary, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.intake-category-header i {
    color: var(--text-muted, #6b7280);
    font-size: 0.9rem;
}

.intake-category-section .intake-form-grid {
    padding: 16px;
}

.intake-category-section .data-table {
    margin-bottom: 0;
    border: none;
    border-radius: 0;
}

.intake-category-section .data-table thead th {
    background-color: var(--bg-primary, #ffffff);
}

/* Section Header Row */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Section Title Count (slideshow) */
.section-title-count {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted, #6b7280);
    margin-left: 8px;
}

/* Loading container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted, #6b7280);
}

.loading-container i {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--color-primary, #3b5998);
}

/* Source text container */
.source-text-container {
    max-height: 600px;
    overflow-y: auto;
    background-color: var(--bg-tertiary, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 6px);
}

.source-text-pre {
    margin: 0;
    padding: 20px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-primary, #1f2937);
}

/* Search info */
.search-info {
    padding: 8px 12px;
    margin-bottom: 12px;
    background-color: var(--bg-tertiary, #f8f9fa);
    border-radius: var(--radius-sm, 4px);
    font-size: 0.875rem;
    color: var(--text-muted, #6b7280);
}

.search-highlight {
    background-color: #fef08a;
    padding: 1px 2px;
    border-radius: 2px;
}

/* ============================================
   Matchmaking Scores (CIM Opportunity Tab)
   ============================================ */

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

.matchmaking-score-card {
    background-color: var(--bg-tertiary, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    padding: 16px;
}

.matchmaking-score-card-muted {
    opacity: 0.6;
}

.matchmaking-score-card-muted .matchmaking-score-header {
    margin-bottom: 6px;
}

.matchmaking-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.matchmaking-metric-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.matchmaking-data-status {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.matchmaking-data-status-found {
    background-color: #ecfdf5;
    color: #065f46;
}

.matchmaking-data-status-missing {
    background-color: var(--bg-tertiary, #f3f4f6);
    color: var(--text-muted, #9ca3af);
}

.matchmaking-score-value {
    font-size: 0.9rem;
    color: var(--text-secondary, #4b5563);
    line-height: 1.6;
    max-height: 120px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}

.matchmaking-score-value.expanded {
    max-height: none;
}

.matchmaking-score-value p {
    margin: 0 0 8px 0;
}

.matchmaking-score-value p:last-child {
    margin-bottom: 0;
}

.matchmaking-score-value strong {
    color: var(--text-primary, #1f2937);
}

.matchmaking-show-more {
    display: none;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--color-primary, #3b5998);
    cursor: pointer;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
}

.matchmaking-show-more:hover {
    text-decoration: underline;
}

/* ============================================
   Editable Field Container
   ============================================ */

.editable-field-container {
    background-color: var(--bg-tertiary, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    padding: 16px;
}

.editable-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.editable-field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    display: flex;
    align-items: center;
    gap: 8px;
}

.editable-field-label i {
    color: var(--text-muted, #6b7280);
}

.editable-field-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.editable-field-edit .form-input {
    width: 100%;
}

/* ============================================
   View Toggle Group
   ============================================ */

.view-toggle-group {
    display: inline-flex;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
}

.view-toggle-btn {
    padding: 8px 12px;
    border: none;
    background-color: var(--bg-primary, #ffffff);
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.view-toggle-btn:not(:last-child) {
    border-right: 1px solid var(--border-color, #e5e7eb);
}

.view-toggle-btn:hover {
    background-color: var(--bg-tertiary, #f8f9fa);
}

.view-toggle-btn.active {
    background-color: var(--color-primary, #3b5998);
    color: white;
}

/* ============================================
   Button Icon Variants
   ============================================ */

/* .btn-icon-success defined above (lines 880-887) — do not duplicate */

.btn-icon-gray {
    color: var(--text-muted, #6b7280);
}

.btn-icon-gray:hover {
    background-color: var(--bg-tertiary, #f8f9fa);
}

/* ============================================
   Table Actions Column
   ============================================ */

.table-actions-col {
    width: 80px;
    text-align: center;
}

/* ============================================
   Detail Page Tab Styling
   ============================================ */

.detail-tabs-container {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.detail-tabs .tab-button {
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted, #6b7280);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.detail-tabs .tab-button:hover {
    color: var(--text-primary, #1f2937);
    background-color: var(--bg-tertiary, #f8f9fa);
}

.detail-tabs .tab-button.active {
    color: var(--text-primary, #1f2937);
    border-bottom-color: var(--text-primary, #1f2937);
}

.detail-tabs .tab-button i {
    font-size: 0.85rem;
    color: inherit;
}

/* Responsive */
@media (max-width: 768px) {
    .container-full-height {
        height: auto;
        min-height: calc(100vh - 60px);
    }

    .advisor-container {
        grid-template-columns: 1fr;
        flex: none;
    }

    .advisor-nav {
        max-height: 200px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .advisor-section {
        flex: 1;
        min-width: 200px;
    }

    .advisor-section-content {
        max-height: 150px;
    }

    .advisor-chat {
        min-height: 400px;
    }

    .slideshow-controls {
        flex-direction: column;
        gap: 12px;
    }

    .intake-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Form Stack and Status Buttons
   ============================================ */

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section {
    padding: 25px;
    background-color: var(--bg-white, #fff);
    border: 1px solid var(--content-border, #dee2e6);
    border-radius: var(--radius-md, 6px);
}

/* Compact decision form — denser padding/gaps to fit one screen */
.form-section-compact {
    padding: 16px;
}

.form-stack-compact {
    gap: 14px;
}

.card-content-compact {
    padding-top: 12px;
    padding-bottom: 12px;
}

/* Two-column field row (e.g. Pipeline Stage + Expected Close Date) */
.form-field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.form-field-col {
    flex: 1 1 220px;
    min-width: 200px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--content-border, #e9ecef);
}

/* Status button group for decision forms */
.status-button-group {
    display: flex;
    gap: 10px;
}

.status-button {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid;
    background-color: white;
    border-radius: var(--radius-md, 6px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.status-button-success {
    border-color: var(--accent-success, #059669);
    color: var(--accent-success, #059669);
}

.status-button-success.active {
    background-color: var(--accent-success, #059669);
    color: white;
}

.status-button-gray {
    border-color: var(--content-text-muted, #6c757d);
    color: var(--content-text-muted, #6c757d);
}

.status-button-gray.active {
    background-color: var(--content-text-muted, #6c757d);
    color: white;
}

.status-button-danger {
    border-color: var(--accent-danger, #dc2626);
    color: var(--accent-danger, #dc2626);
}

.status-button-danger.active {
    background-color: var(--accent-danger, #dc2626);
    color: white;
}

/* ============================================
   Connector Cards
   ============================================ */

.connector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-20, 20px);
    margin-bottom: var(--spacing-20, 20px);
}

.connector-card {
    background: var(--surface-white, #ffffff);
    border: 2px solid var(--border-light, #e5e7eb);
    border-radius: var(--border-radius-md, 8px);
    padding: var(--spacing-20, 20px);
    transition: all 0.2s ease;
    cursor: pointer;
}

.connector-card:hover {
    border-color: var(--color-primary, #3d4f95);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.connector-card-selected {
    border-color: var(--color-primary, #3d4f95);
    background: var(--background-blue-subtle, #f0f4ff);
}

.connector-card-label {
    display: block;
    cursor: pointer;
}

.connector-checkbox {
    margin-right: var(--spacing-10, 10px);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.connector-card-content {
    margin-left: var(--spacing-30, 30px);
}

.connector-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-10, 10px);
    margin-bottom: var(--spacing-15, 15px);
}

.connector-icon {
    font-size: 24px;
    color: var(--color-primary, #3d4f95);
}

.connector-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--content-text-primary, #1a202c);
}

.connector-card-details {
    display: flex;
    align-items: center;
    gap: var(--spacing-10, 10px);
    margin-bottom: var(--spacing-10, 10px);
}

.connector-type-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--background-gray-light, #f3f4f6);
    color: var(--content-text-secondary, #4b5563);
    border-radius: var(--border-radius-sm, 4px);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.connector-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--border-radius-sm, 4px);
    font-size: 12px;
    font-weight: 500;
}

.connector-status-active {
    background: var(--background-success, #d1fae5);
    color: var(--accent-success, #059669);
}

.connector-status-inactive {
    background: var(--background-gray-light, #f3f4f6);
    color: var(--content-text-muted, #6b7280);
}

.connector-configure-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-5, 5px);
    color: var(--color-primary, #3d4f95);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-top: var(--spacing-10, 10px);
}

.connector-configure-link:hover {
    color: var(--color-primary-dark, #2c3b6e);
    text-decoration: underline;
}

/* ============================================
   Advanced Configuration Collapsible Sections
   ============================================ */

.advanced-config {
    margin-top: var(--spacing-30, 30px);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--border-radius-md, 8px);
    padding: var(--spacing-15, 15px);
    background: var(--background-gray-light, #f9fafb);
}

.advanced-config-summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--content-text-secondary, #6b7280);
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-10, 10px);
}

.advanced-config-summary::-webkit-details-marker {
    display: none;
}

.advanced-config-summary::before {
    content: '\25B6';
    display: inline-block;
    transition: transform 0.2s;
    font-size: 12px;
}

.advanced-config[open] .advanced-config-summary::before {
    transform: rotate(90deg);
}

.advanced-config-summary:hover {
    color: var(--content-text-primary, #1f2937);
}

/* ============================================
   Schema Editor (Placeholder/Mock Agent Modals)
   ============================================ */

.schema-item-row {
    display: flex;
    gap: var(--spacing-10, 10px);
    align-items: center;
    margin-bottom: var(--spacing-8, 8px);
}

.schema-item-row .form-input {
    flex: 1;
}

.schema-item-row .form-input-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.schema-items-list {
    background: var(--color-background, #f9fafb);
    border-radius: 6px;
    padding: var(--spacing-10, 10px);
    min-height: 40px;
}

.schema-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-5, 5px);
}

.schema-subsection {
    background: var(--color-white, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: var(--spacing-15, 15px);
}

.placeholder-schema-section,
.placeholder-action-section {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: var(--spacing-15, 15px);
}

.placeholder-schema-section[open],
.placeholder-action-section[open] {
    background: var(--color-background, #f9fafb);
}

.schema-editor-content {
    padding-top: var(--spacing-10, 10px);
}

.section-divider {
    border: none;
    border-top: 1px solid var(--color-border, #e5e7eb);
    margin: var(--spacing-20, 20px) 0;
}

/* Small button icon variant */
.btn-icon-sm {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    padding: 0;
    flex-shrink: 0;
}

/* Form label small variant */
.form-label-sm {
    font-size: 0.85rem;
    margin-bottom: var(--spacing-5, 5px);
}

/* Text utilities for schema editor */
.text-sm {
    font-size: 0.85rem;
}

.text-muted {
    color: var(--content-text-secondary, #6b7280);
}

.p-15 {
    padding: var(--spacing-15, 15px);
}

/* ============================================
   Canvas Schema Editor Toolbar & Controls
   ============================================ */

.canvas-toolbar {
    display: flex;
    gap: var(--spacing-10, 10px);
    align-items: center;
    padding: var(--spacing-10, 10px) var(--spacing-15, 15px);
    background: var(--color-background, #f9fafb);
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.canvas-add-item-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-5, 5px);
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--color-primary, #4f46e5);
    background: transparent;
    border: 1px dashed var(--color-primary, #4f46e5);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: var(--spacing-5, 5px);
    width: 100%;
    justify-content: center;
}

.canvas-add-item-btn:hover {
    background: rgba(79, 70, 229, 0.08);
    border-style: solid;
}

.canvas-add-item-btn i {
    font-size: 0.75rem;
}

/* Small action button variant for toolbar */
.btn-action-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Extra-small action button variant for inline presets */
.btn-action-xs {
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 3px;
}

/* Structure presets row */
.structure-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* Remove button for schema items in canvas nodes */
.canvas-node-remove {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-danger, #ef4444);
    cursor: pointer;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
    margin-left: auto;
}

.canvas-node-remove:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.1);
}

.canvas-node-remove i {
    font-size: 0.7rem;
}

/* ============================================
   Small Action Button Color Variants
   ============================================ */

.btn-action-sm-blue {
    padding: 6px 12px;
    font-size: 0.8rem;
    background-color: var(--color-primary, #1a2234);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-action-sm-blue:hover { background-color: #2d3a4f; }

.btn-action-sm-red {
    padding: 6px 12px;
    font-size: 0.8rem;
    background-color: #ffe7e7;
    color: #dc3545;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-action-sm-red:hover { background-color: #dc3545; color: white; }

.btn-action-sm-green {
    padding: 6px 12px;
    font-size: 0.8rem;
    background-color: #d4edda;
    color: #28a745;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* ============================================
   Widget Management Utilities
   ============================================ */

.filter-form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-form-field {
    flex: 1;
    min-width: 200px;
}

.filter-form-field-narrow {
    flex: 0 1 160px;
    min-width: 160px;
}

.filter-form-actions {
    display: flex;
    gap: 8px;
}

.action-btn-group {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.inline-form {
    display: inline;
}

.bulk-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.bulk-action-panel {
    padding: 20px;
    background-color: var(--content-card-bg, #f8f9fa);
    border: 1px solid var(--border-color, #e9ecef);
    border-radius: 6px;
}

.bulk-action-title {
    margin: 0 0 15px 0;
    color: var(--content-heading, #333);
}

.bulk-action-title i {
    margin-right: 8px;
}

.page-header-back-link {
    color: inherit;
    text-decoration: none;
    margin-right: 10px;
    font-size: 0.7em;
}

/* ==================== Document Detail Panel ==================== */
.doc-detail-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.doc-detail-section:last-child {
    border-bottom: none;
}

.doc-detail-section-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

.doc-detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--spacing-sm);
}

.doc-detail-info-label {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-bottom: 2px;
}

.doc-detail-info-value {
    display: block;
    font-size: var(--font-size-small);
    color: var(--color-text-primary);
}

/* Details Tab — Document Header Zone */
.doc-detail-header-zone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-subtle, #f8f9fa);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
}

.doc-detail-header-item {
    color: var(--color-text-primary);
    font-weight: 500;
}

.doc-detail-header-sep {
    color: var(--color-text-muted);
    margin: 0 2px;
}

/* Details Tab — Metadata Actions */
.doc-detail-meta-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* Details Tab — AI Suggestion Hints */
.doc-detail-suggestion-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-detail-ai-suggestion {
    font-size: var(--font-size-xs);
    color: var(--color-primary);
    padding: 4px 8px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.doc-detail-ai-suggestion i {
    color: #d97706;
}

/* Details Tab — Status Actions */
.doc-detail-status-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* Details Tab — Secondary Link */
.doc-detail-secondary-link {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-decoration: none;
    cursor: pointer;
}

.doc-detail-secondary-link:hover {
    color: var(--color-text-secondary);
    text-decoration: underline;
}

/* Details Tab — Preprocessing Results */
.doc-preproc-summary {
    font-size: var(--font-size-small);
    color: var(--color-text-primary);
    line-height: 1.5;
}

.doc-preproc-names,
.doc-preproc-tables,
.doc-preproc-confidence {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* Processing Pipeline */
.doc-pipeline {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    min-width: 90px;
}

.pipeline-connector {
    width: 24px;
    height: 2px;
    background: var(--color-border-light);
}

.pipeline-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.pipeline-pending .pipeline-icon { color: var(--color-text-muted); }
.pipeline-active .pipeline-icon { color: var(--color-primary); }
.pipeline-done .pipeline-icon { color: var(--color-success); }
.pipeline-failed .pipeline-icon { color: var(--color-danger); }

.pipeline-action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
}
.pipeline-status-done {
    color: var(--color-success);
    font-size: var(--font-size-base);
}
.pipeline-status-active {
    color: var(--color-primary);
    font-size: var(--font-size-xs);
    white-space: nowrap;
}
.pipeline-status-waiting {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}
.pipeline-action-btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.pipeline-action-btn:hover { opacity: 0.85; }
.pipeline-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pipeline-btn-do {
    background: var(--color-primary);
    color: #fff;
}
.pipeline-btn-retry {
    background: var(--color-warning, #ffc107);
    color: #333;
}

/* Modal footer split layout */
.modal-footer-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-border-light);
}

.modal-footer-left,
.modal-footer-right {
    display: flex;
    gap: var(--spacing-sm);
}

/* Party select rows */
.party-select-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.party-select-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
}

.party-select-row .party-relationship-select {
    margin-left: auto;
    width: 140px;
}

/* Document party badges */
.doc-party-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ============================================
   Auth Method Selector (Connector Edit)
   ============================================ */

.auth-method-selector {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.auth-method-option {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--spacing-sm);
    row-gap: 2px;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--color-border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.auth-method-option:hover {
    border-color: var(--color-primary);
    background-color: var(--color-bg-hover);
}

.auth-method-option input[type="radio"] {
    margin: 0;
    grid-row: 1 / span 2;
    align-self: center;
}

.auth-method-option input[type="radio"]:checked ~ .auth-method-label {
    color: var(--color-primary);
    font-weight: 600;
}

.auth-method-label {
    grid-column: 2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    font-size: var(--font-size-base);
}

.auth-method-desc {
    grid-column: 2;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Read-only field paired with a copy button (e.g. OAuth callback URL) */
.copy-field {
    display: flex;
    gap: var(--spacing-sm);
    align-items: stretch;
}

.copy-field .form-input {
    flex: 1;
    font-family: var(--font-family-mono, monospace);
}

/* Numbered setup steps in the Bring-Your-Own-App panel */
.byo-steps {
    padding-left: var(--spacing-lg);
}

.byo-steps li {
    margin-bottom: var(--spacing-xs);
}

.hidden {
    display: none !important;
}

.btn-nowrap {
    white-space: nowrap;
}

.mt-5 {
    margin-top: 5px;
}

.mb-0 {
    margin-bottom: 0;
}

/* ================================
   Proposal Review Components
   ================================ */

.proposal-review-section {
    margin-bottom: 20px;
}

.proposal-item {
    padding: 16px 20px;
    border-left: 4px solid var(--color-warning, #ffc107);
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.15s ease;
}

.proposal-item:last-child {
    border-bottom: none;
}

.proposal-item:hover {
    background-color: #f8f9fa;
}

.proposal-item-create {
    border-left-color: var(--color-success, #28a745);
}

.proposal-item-update {
    border-left-color: var(--color-info, #17a2b8);
}

.proposal-item-delete {
    border-left-color: var(--color-danger, #dc3545);
}

.proposal-type-badge {
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.proposal-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-warning, #ffc107);
    font-size: 0.8em;
    font-weight: 500;
    margin-left: 8px;
}

.proposal-indicator i {
    font-size: 0.9em;
}

.proposal-diff {
    margin-top: 8px;
    padding: 10px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 0.88em;
    line-height: 1.5;
}

.proposal-diff-old {
    background-color: #fdd;
    padding: 1px 4px;
    border-radius: 2px;
    text-decoration: line-through;
    color: #721c24;
}

.proposal-diff-new {
    background-color: #d4edda;
    padding: 1px 4px;
    border-radius: 2px;
    color: #155724;
}

.unlock-status-bar {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
    color: #856404;
    font-size: 0.9em;
}

.proposal-unlock-remaining {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

/* ==================== Job Queue Panel ==================== */

.card-header-collapsible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    background: var(--color-bg-secondary, #f8f9fa);
    border-bottom: 1px solid var(--color-border, #dee2e6);
    border-radius: var(--border-radius, 6px) var(--border-radius, 6px) 0 0;
    user-select: none;
    transition: background 0.15s ease;
}

.card-header-collapsible:hover {
    background: var(--color-bg-tertiary, #e9ecef);
}

.badge-processing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    background: #cce5ff;
    color: #004085;
}

.badge-failed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    background: #f8d7da;
    color: #721c24;
}

.job-queue-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.job-queue-body-inner {
    padding: var(--spacing-md);
}

.job-row-running {
    background: #e8f4fd;
}

.job-row-failed {
    background: #fef0f0;
}

.job-target-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-help {
    cursor: help;
}

/* ═══════════════════════════════════════════════════════════════
   Gap Analysis
   ═══════════════════════════════════════════════════════════════ */

.gap-completion-bar {
    height: 10px;
    background: var(--color-border, #e5e7eb);
    border-radius: 5px;
    overflow: hidden;
}

.gap-completion-fill {
    height: 100%;
    background: var(--color-success, #22c55e);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.gap-summary-row {
    display: flex;
    gap: 16px;
}

.gap-summary-card {
    flex: 1;
    padding: 20px 16px;
    border-radius: 8px;
    text-align: center;
}

.gap-summary-danger { background: #fef2f2; border: 1px solid #fecaca; }
.gap-summary-warning { background: #fffbeb; border: 1px solid #fde68a; }
.gap-summary-success { background: #f0fdf4; border: 1px solid #bbf7d0; }

.gap-summary-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.gap-summary-danger .gap-summary-value { color: #dc2626; }
.gap-summary-warning .gap-summary-value { color: #d97706; }
.gap-summary-success .gap-summary-value { color: #16a34a; }

.gap-summary-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted, #6b7280);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.gap-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.gap-section-danger { background: #fef2f2; color: #dc2626; }
.gap-section-warning { background: #fffbeb; color: #d97706; }

.gap-category-group {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
}

.gap-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-bg-subtle, #f9fafb);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
}

.gap-category-header:hover { background: var(--color-border, #e5e7eb); }

.gap-chevron {
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 0.7rem;
}

.gap-chevron.rotated { transform: rotate(-90deg); }

.gap-category-body { padding: 4px 0; }
.gap-category-body.collapsed { display: none; }

.gap-item {
    padding: 6px 12px 6px 16px;
    border-bottom: 1px solid var(--color-border-light, #f3f4f6);
}

.gap-item:last-child { border-bottom: none; }

.gap-item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

.gap-item-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.gap-field-name { font-weight: 500; }

.gap-current-value {
    margin-left: 24px;
    font-size: 0.78rem;
    color: var(--color-text-muted, #6b7280);
    font-style: italic;
}

.gap-reason {
    margin-left: 24px;
    margin-top: 2px;
    font-size: 0.78rem;
    color: #92400e;
    background: #fffbeb;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════
   Supplemental Documents
   ═══════════════════════════════════════════════════════════════ */

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

.supplement-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.supplement-item:hover { background: var(--color-bg-subtle, #f9fafb); }

.supplement-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.supplement-item-icon {
    font-size: 1.2rem;
    color: var(--color-primary, #2563eb);
}

.supplement-item-name {
    font-weight: 500;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════
   Suggestion Review
   ═══════════════════════════════════════════════════════════════ */

.suggestion-accepted { background: #f0fdf4; }
.suggestion-accepted td { color: #166534; }

.suggestion-rejected {
    background: #fafafa;
    opacity: 0.6;
}
.suggestion-rejected td { text-decoration: line-through; color: #9ca3af; }

.suggestion-excerpt {
    padding: 4px 12px 8px 12px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}

/* Badge variants for confidence */
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* ==========================================================================
   Work Product Cards (Opportunity Document Detail)
   ========================================================================== */

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

.wp-card {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 16px;
    background: var(--color-bg, #fff);
    transition: box-shadow 0.15s ease;
}

.wp-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wp-card-available {
    border-color: #86efac;
}

.wp-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 15px;
}

.wp-card-status {
    margin-bottom: 12px;
}

.wp-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Work product detail header bar */
.wp-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    margin-bottom: 16px;
}

.wp-detail-header .section-title {
    flex: 1;
    margin: 0;
}

.wp-detail-header .section-title-count {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted, #6b7280);
    margin-left: 8px;
}

/* Config page: template cards */
.config-card {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    background: var(--color-bg, #fff);
    overflow: hidden;
}

.config-card-header {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    cursor: pointer;
}

.config-card-header:hover {
    background: #f3f4f6;
}

.config-card-body {
    border-top: 1px solid var(--color-border, #e5e7eb);
}

.config-sub-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafbfc;
}

.config-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

.badge-sm {
    font-size: 10px;
    padding: 1px 6px;
}

.form-input-xs {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 4px;
    width: 120px;
}

.form-input-sm {
    font-size: 13px;
    padding: 5px 10px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 4px;
    width: 200px;
}

.btn-action-xs {
    font-size: 11px;
    padding: 3px 8px;
}

.grid-2col { display: grid; grid-template-columns: 1fr 1fr; }
.grid-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.gap-15 { gap: 15px; }
.gap-10 { gap: 10px; }
.gap-5 { gap: 5px; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.pt-20 { padding-top: 20px; }
.flex-col { display: flex; flex-direction: column; }
.flex-row { display: flex; flex-direction: row; align-items: center; }

/* ============================================
   Job Queue
   ============================================ */

.jq-filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.jq-filter-field {
    flex: 1;
    min-width: 140px;
}

.jq-filter-action {
    flex: 0 0 auto;
}

.jq-section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text-primary, #1a2234);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jq-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary, #1a2234);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
}

.jq-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.jq-status-pending {
    background: #fff3cd;
    color: #856404;
}

.jq-status-running {
    background: #cce5ff;
    color: #004085;
}

.jq-status-completed {
    background: #d4edda;
    color: #155724;
}

.jq-status-failed {
    background: #f8d7da;
    color: #721c24;
}

.jq-action-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.85em;
    border-radius: 4px;
    background: #6c757d;
    color: #fff;
}

.jq-row-failed {
    background: #fff5f5;
}

.jq-error-message {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #dc3545;
    font-family: monospace;
    font-size: 0.85em;
}

.jq-col-check { width: 40px; }
.jq-col-actions { width: 50px; }

.mr-10 { margin-right: 10px; }
.ml-5 { margin-left: 5px; }
.p-0 { padding: 0; }

.stat-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

@media (max-width: 768px) {
    .jq-filter-row {
        flex-direction: column;
    }
    .jq-filter-field {
        width: 100%;
    }
    .stat-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   File Drop Overlay & Drop Zone
   ============================================ */

/* Overlay shown when dragging files over a container */
.file-drop-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 34, 52, 0.85);
    border: 3px dashed var(--color-primary, #4a90d9);
    border-radius: 8px;
    z-index: 100;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.file-drop-overlay.active {
    display: flex;
    pointer-events: auto;
}

.file-drop-content {
    text-align: center;
    color: white;
}

.file-drop-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.9;
}

.file-drop-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.file-drop-subtext {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Static drop zone for empty states */
.file-drop-zone {
    border: 2px dashed var(--color-border, #d1d5db);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.file-drop-zone:hover {
    border-color: var(--color-primary, #4a90d9);
    background-color: var(--color-bg-secondary, #f0f4f8);
}

.file-drop-zone-icon {
    font-size: 2.5rem;
    color: var(--color-text-muted, #6b7280);
    margin-bottom: 12px;
}

.file-drop-zone-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary, #1a2234);
    margin-bottom: 4px;
}

.file-drop-zone-subtext {
    font-size: 0.85rem;
    color: var(--color-text-muted, #6b7280);
}

/* ============================================
   Scoring Cards (Matchmaking Metrics)
   ============================================ */

.scoring-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.scoring-card-strong {
    border-left: 4px solid #28a745;
    padding: 10px;
    background: #f0fff0;
    border-radius: 4px;
}

.scoring-card-warm {
    border-left: 4px solid #ffc107;
    padding: 10px;
    background: #fffdf0;
    border-radius: 4px;
}

.scoring-card-weak {
    border-left: 4px solid #fd7e14;
    padding: 10px;
    background: #fff8f0;
    border-radius: 4px;
}

.scoring-card-none {
    border-left: 4px solid #dc3545;
    padding: 10px;
    background: #fff0f0;
    border-radius: 4px;
}

.scoring-card-strong label,
.scoring-card-warm label,
.scoring-card-weak label,
.scoring-card-none label {
    display: block;
    font-weight: 600;
    font-size: 0.85em;
    margin-bottom: 6px;
}

.scoring-card-strong textarea,
.scoring-card-warm textarea,
.scoring-card-weak textarea,
.scoring-card-none textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9em;
    resize: vertical;
}

/* ============================================
   Metric Section Containers
   ============================================ */

.metric-section-extraction {
    background: #f7f9fc;
    border: 2px solid #d0d7e2;
    border-left: 4px solid var(--color-primary, #3d4f95);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.metric-section-analysis {
    background: #faf8f5;
    border: 2px solid #d9d2c7;
    border-left: 4px solid #e8a838;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.metric-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05em;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.metric-section-header i {
    font-size: 0.95em;
}

.metric-section-extraction .metric-section-header {
    color: var(--color-primary, #3d4f95);
    border-bottom-color: #d0d7e2;
}

.metric-section-analysis .metric-section-header {
    color: #b07d1a;
    border-bottom-color: #d9d2c7;
}

/* ============================================
   Auto-Resize Textarea
   ============================================ */

.textarea-autoresize {
    overflow: hidden;
    resize: none;
    min-height: 2.8em;
    max-height: 60vh;
    transition: height 0.1s ease;
}

.textarea-autoresize.has-overflow {
    overflow-y: auto;
}

/* ============================================
   Case Manager: Collaboration & Control
   ============================================ */

/* Historical timeline entries — muted appearance */
.timeline-entry-historical {
    opacity: 0.6;
    border-left-color: var(--color-border-light, #d0d7e2) !important;
}

.timeline-entry-historical .timeline-content {
    background: var(--color-bg-light, #f8f9fa);
}

/* Edited badge — clickable to show edit history */
.timeline-edited-badge {
    cursor: pointer;
    font-size: 0.75rem;
}

.timeline-edited-badge:hover {
    opacity: 0.8;
}

/* Star icon for starred cases */
.star-icon {
    cursor: pointer;
    color: var(--color-text-muted, #8c95a6);
    font-size: 1.1rem;
    transition: color 0.15s ease, transform 0.15s ease;
}

.star-icon:hover {
    color: #e6a817;
    transform: scale(1.15);
}

.star-icon.star-active {
    color: #e6a817;
}

/* Source filter dropdown */
.source-filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 50;
    background: var(--color-bg, #ffffff);
    border: 1px solid var(--color-border, #d0d7e2);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    min-width: 260px;
    max-height: 340px;
    overflow-y: auto;
    padding: 8px 0;
}

.source-filter-group {
    padding: 4px 12px;
}

.source-filter-group-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted, #8c95a6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 0 2px;
    border-bottom: 1px solid var(--color-border-light, #eee);
    margin-bottom: 4px;
}

.source-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.85rem;
    cursor: pointer;
}

.source-filter-item:hover {
    color: var(--color-primary, #3d4f95);
}

/* Historical toggle button on entries */
.timeline-historical-toggle {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--color-border, #d0d7e2);
    background: transparent;
    color: var(--color-text-muted, #8c95a6);
    cursor: pointer;
    white-space: nowrap;
}

.timeline-historical-toggle:hover {
    background: var(--color-bg-light, #f8f9fa);
    color: var(--color-text, #333);
}

/* Bulk selection checkbox on timeline entries */
.timeline-bulk-checkbox {
    margin-right: 8px;
    cursor: pointer;
}

/* Bulk action bar */
.timeline-bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-bg-light, #f0f2f5);
    border: 1px solid var(--color-border, #d0d7e2);
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

/* Editors card */
.editor-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border-light, #eee);
}

.editor-list-item:last-child {
    border-bottom: none;
}

.editor-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.editor-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.editor-email {
    font-size: 0.8rem;
    color: var(--color-text-muted, #8c95a6);
}

/* Timeline inclusion indicator */
.badge-informational {
    background: var(--color-bg-light, #f0f2f5);
    color: var(--color-text-muted, #8c95a6);
    border: 1px solid var(--color-border, #d0d7e2);
    font-size: 0.72rem;
}

/* Edit history popover */
.edit-history-popover {
    position: absolute;
    z-index: 100;
    background: var(--color-bg, #ffffff);
    border: 1px solid var(--color-border, #d0d7e2);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    min-width: 280px;
    max-width: 400px;
    max-height: 300px;
    overflow-y: auto;
    padding: 12px;
    font-size: 0.82rem;
}

.edit-history-entry {
    padding: 6px 0;
    border-bottom: 1px solid var(--color-border-light, #eee);
}

.edit-history-entry:last-child {
    border-bottom: none;
}

.edit-history-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted, #8c95a6);
    margin-bottom: 4px;
}

.edit-history-field {
    font-size: 0.78rem;
    padding: 2px 0;
}

.edit-history-field .field-name {
    font-weight: 600;
    color: var(--color-text, #333);
}

/* Starred filter toggle */
.starred-filter-toggle {
    display: inline-flex;
    gap: 0;
    border: 1px solid var(--color-border, #d0d7e2);
    border-radius: 4px;
    overflow: hidden;
}

.starred-filter-btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-text-muted, #8c95a6);
}

.starred-filter-btn.active {
    background: var(--color-primary, #3d4f95);
    color: #fff;
}

.starred-filter-btn:hover:not(.active) {
    background: var(--color-bg-light, #f0f2f5);
}

/* ============================================
   Dateless Resources Section
   ============================================ */

.dateless-resources-section {
    margin-top: 24px;
    border: 1px solid var(--color-border, #d0d7e2);
    border-radius: 8px;
    background: var(--color-bg, #ffffff);
    overflow: hidden;
}

.dateless-resources-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8f9fb 0%, #f0f2f5 100%);
    border-bottom: 1px solid var(--color-border-light, #eee);
}

.dateless-header-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary, #1a2234);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dateless-header-title i {
    color: var(--color-text-muted, #8c95a6);
}

.dateless-help-text {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted, #8c95a6);
    margin-top: 4px;
    font-weight: 400;
}

.dateless-resources-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dateless-resource-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--color-border-light, #eee);
    border-radius: 6px;
    background: var(--color-bg, #ffffff);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dateless-resource-card:hover {
    border-color: var(--color-border, #d0d7e2);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.dateless-resource-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--color-bg-light, #f0f2f5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted, #8c95a6);
    font-size: 0.95rem;
}

.dateless-resource-body {
    flex: 1;
    min-width: 0;
}

.dateless-resource-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--color-text-primary, #1a2234);
    line-height: 1.3;
    margin-bottom: 4px;
}

.dateless-resource-summary {
    font-size: 0.8rem;
    color: var(--color-text-secondary, #555);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dateless-resource-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--color-text-muted, #8c95a6);
}

.dateless-resource-doc,
.dateless-resource-pages {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dateless-resource-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 2px;
}

/* ============================================
   Historical 3-Way Toggle
   ============================================ */

.historical-toggle {
    display: inline-flex;
    gap: 0;
    border: 1px solid var(--color-border, #d0d7e2);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.historical-toggle-btn {
    padding: 3px 10px;
    font-size: 0.78rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--color-text-muted, #8c95a6);
    border-right: 1px solid var(--color-border, #d0d7e2);
    white-space: nowrap;
}

.historical-toggle-btn:last-child {
    border-right: none;
}

.historical-toggle-btn.active {
    background: var(--color-primary, #3d4f95);
    color: #fff;
}

.historical-toggle-btn:hover:not(.active) {
    background: var(--color-bg-light, #f0f2f5);
}

/* ==================== Legal Lens Cards ==================== */

/* ---- Stat Row (grid container for stat cards) ---- */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

/* ---- Legal Lens Dashboard ---- */
.lens-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.lens-card {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 16px;
    background: white;
    display: flex;
    flex-direction: column;
}

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

.lens-card-icon {
    font-size: 1.4em;
    color: var(--icon-default, #9ca3af);
}

.lens-filter-input {
    max-width: 250px;
}

.lens-filter-select {
    max-width: 200px;
}

/* ==================== Source Viewer Sidebar ==================== */

.source-viewer-sidebar {
    position: fixed;
    right: -450px;
    top: 0;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.source-viewer-sidebar.active {
    right: 0;
}

.source-viewer-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    flex-shrink: 0;
}

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

.source-viewer-title {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 350px;
}

.source-viewer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.source-viewer-nav-btns {
    display: flex;
    gap: 4px;
}

.source-viewer-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    font-size: 0.9em;
    line-height: 1.6;
    white-space: pre-wrap;
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, sans-serif);
}

.source-viewer-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-muted, #6b7280);
}

.source-viewer-highlight {
    background-color: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 2px 4px;
    border-radius: 2px;
}

.source-viewer-page-break {
    border-top: 1px dashed var(--color-border, #e5e7eb);
    margin: 16px 0;
    padding-top: 8px;
    color: var(--color-text-muted, #6b7280);
    font-size: 0.8em;
}

.source-citation-link {
    color: var(--color-primary, #2563eb);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.source-citation-link:hover {
    text-decoration-style: solid;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.78em;
    border-radius: 4px;
    background: var(--color-bg-secondary, #f0f4f8);
    color: var(--color-text-secondary, #4b5563);
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.source-badge:hover {
    border-color: var(--color-primary, #2563eb);
    color: var(--color-primary, #2563eb);
}

.source-badge-manual {
    cursor: default;
    opacity: 0.7;
}

.source-badge-manual:hover {
    border-color: transparent;
    color: var(--color-text-secondary, #4b5563);
}

/* ==================== Entity Explorer ==================== */

.entity-list-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.entity-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.entity-list-item:hover {
    border-color: var(--color-primary, #2563eb);
    background: var(--color-primary-bg, #eff6ff);
}

.entity-list-item-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.entity-list-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.timeline-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-compact-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border-left: 3px solid var(--color-primary, #2563eb);
    background: var(--color-bg-secondary, #f8f9fa);
    border-radius: 0 4px 4px 0;
}

/* ==================== Entity Links in Content ==================== */

.entity-link {
    color: var(--color-primary, #2563eb);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-primary, #2563eb);
    cursor: pointer;
    white-space: nowrap;
}

.entity-link:hover {
    border-bottom-style: solid;
    background: var(--color-primary-bg, #eff6ff);
    border-radius: 2px;
}

.entity-link i {
    font-size: 0.8em;
    opacity: 0.7;
    margin-right: 1px;
}

/* ============================================================
   Portfolio Brief — Screen Styles
   ============================================================ */

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

.brief-cim-card {
    margin-bottom: 24px;
}

.brief-trend-delta {
    font-size: 0.65em;
    font-weight: 600;
    margin-left: 6px;
}

.brief-trend-positive {
    color: var(--color-success, #155724);
}

.brief-trend-negative {
    color: var(--color-danger, #721c24);
}

/* ============================================
   EVIDENCE GALLERY (Finance Evidence Phase 1)
   Shared file -> fact selection UI (_evidence_gallery.html)
   ============================================ */

.evidence-gallery {
    /* Always rendered inside a modal now — drop the own card border/padding. */
    padding: 0;
    background: transparent;
}

.evidence-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-sm, 8px);
    margin-bottom: var(--spacing-md, 16px);
}

.evidence-gallery-title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--color-text-primary, #333);
}

.evidence-target-label {
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6c757d);
}

.evidence-target-label-key {
    font-weight: 600;
    margin-right: var(--spacing-xs, 4px);
}

.evidence-target-label-empty {
    font-style: italic;
    color: var(--color-text-muted, #999);
}

.evidence-upload-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs, 4px);
    padding: 0;
    margin-bottom: var(--spacing-sm, 8px);
}

.evidence-upload-panel .btn-action {
    align-self: flex-start;
    margin-top: var(--spacing-sm, 8px);
}

.evidence-render-status {
    margin-top: var(--spacing-sm, 8px);
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6c757d);
}

.evidence-render-progress {
    margin-top: var(--spacing-xs, 4px);
    max-width: 320px;
}

.evidence-render-progress .progress-bar-fill {
    width: 0;
}

/* Responsive thumbnail grid */
.evidence-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--spacing-md, 16px);
    margin-bottom: var(--spacing-lg, 24px);
}

.evidence-page-cell {
    position: relative;
    border: 2px solid var(--color-border-light, #dee2e6);
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
    cursor: pointer;
    background: var(--color-bg-white, #ffffff);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.evidence-page-cell:hover {
    border-color: var(--color-text-secondary, #6c757d);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.evidence-page-cell-selected {
    border-color: var(--color-success, #28a745);
    box-shadow: 0 0 0 2px var(--color-success, #28a745);
}

.evidence-page-thumb {
    display: block;
    width: 100%;
    height: auto;
    background: var(--color-bg-medium, #e9ecef);
}

.evidence-page-number {
    padding: var(--spacing-xs, 4px) var(--spacing-sm, 8px);
    font-size: 0.75rem;
    text-align: center;
    color: var(--color-text-secondary, #6c757d);
    background: var(--color-bg-light, #f8f9fa);
    border-top: 1px solid var(--color-border-light, #dee2e6);
}

/* Selection checkmark badge — hidden until the cell is selected */
.evidence-page-check {
    position: absolute;
    top: var(--spacing-xs, 4px);
    right: var(--spacing-xs, 4px);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--color-success, #28a745);
    color: #fff;
    font-size: 0.7rem;
    z-index: 1;
}

.evidence-page-cell-selected .evidence-page-check {
    display: flex;
}

.evidence-empty-state {
    text-align: center;
    padding: var(--spacing-xl, 32px);
    color: var(--color-text-muted, #999);
}

.evidence-empty-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm, 8px);
}

.evidence-empty-text {
    margin: 0;
}

.evidence-justification-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs, 4px);
    padding: var(--spacing-md, 16px);
    background: var(--color-bg-light, #f8f9fa);
    border-radius: var(--radius-md, 6px);
}

.evidence-justification-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-sm, 8px);
    margin: 0 0 var(--spacing-sm, 8px) 0;
    font-size: 1rem;
    color: var(--color-text-primary, #333);
}

.evidence-selection-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text-secondary, #6c757d);
}

.evidence-action-row {
    display: flex;
    gap: var(--spacing-sm, 8px);
    margin-top: var(--spacing-sm, 8px);
    flex-wrap: wrap;
}

.evidence-justification-hint {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--color-text-secondary, #6c757d);
    margin-left: var(--spacing-xs, 4px);
}

/* ---- Saved applications (entered positionings) ---- */
.evidence-applications {
    margin-top: var(--spacing-md, 16px);
    border-top: 1px solid var(--color-border, #dee2e6);
    padding-top: var(--spacing-sm, 8px);
}

.evidence-applications-title {
    margin: 0 0 var(--spacing-sm, 8px) 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.evidence-applications-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs, 4px);
}

.evidence-application-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 8px);
    padding: var(--spacing-xs, 4px) var(--spacing-sm, 8px);
    background: var(--color-bg-white, #ffffff);
    border-radius: var(--radius-sm, 4px);
}

.evidence-stance-badge {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 8px;
    border-radius: var(--radius-pill, 999px);
    color: #fff;
    background: var(--color-text-secondary, #6c757d);
}

.evidence-stance-enrich { background: var(--color-primary, #2563eb); }
.evidence-stance-support { background: var(--color-success, #28a745); }
.evidence-stance-challenge { background: var(--color-danger, #dc3545); }
.evidence-stance-unknown { background: var(--color-text-secondary, #6c757d); }

.evidence-application-pages {
    flex: 0 0 auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-primary, #333);
}

.evidence-application-justification {
    flex: 1 1 auto;
    font-size: 0.8rem;
    color: var(--color-text-secondary, #6c757d);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.evidence-application-delete {
    flex: 0 0 auto;
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--color-text-secondary, #6c757d);
    cursor: pointer;
    padding: var(--spacing-xs, 4px);
    border-radius: var(--radius-sm, 4px);
}

.evidence-application-delete:hover {
    color: var(--color-danger, #dc3545);
    background: var(--color-bg-light, #f8f9fa);
}

/* ---- Evidence suggestions review surface (Finance Evidence Phase 3) ---- */
.evidence-suggestions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm, 8px);
    padding: var(--spacing-md, 16px);
    background: var(--color-bg-white, #ffffff);
    border: 1px solid var(--color-border-light, #dee2e6);
    border-radius: var(--radius-md, 6px);
}

.evidence-suggestions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-sm, 8px);
}

.evidence-suggestions-title {
    margin: 0;
    font-size: 1rem;
    color: var(--color-text-primary, #333);
}

.evidence-suggestions-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6c757d);
}

.evidence-suggestions-status {
    padding: var(--spacing-sm, 8px) var(--spacing-md, 16px);
    background: var(--color-bg-light, #f8f9fa);
    border-radius: var(--radius-sm, 4px);
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6c757d);
}

.evidence-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm, 8px);
}

.evidence-suggestions-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs, 4px);
    padding: var(--spacing-lg, 24px);
    color: var(--color-text-muted, #999);
    text-align: center;
}

.evidence-suggestions-empty-icon {
    font-size: 1.8rem;
}

.evidence-suggestions-empty-text {
    margin: 0;
    font-size: 0.9rem;
}

.evidence-suggestion-row {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs, 4px);
    padding: var(--spacing-md, 16px);
    background: var(--color-bg-light, #f8f9fa);
    border: 1px solid var(--color-border-light, #dee2e6);
    border-radius: var(--radius-md, 6px);
}

.evidence-suggestion-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm, 8px);
}

.evidence-suggestion-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs, 4px);
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6c757d);
}

.evidence-suggestion-target {
    font-weight: 600;
    color: var(--color-text-primary, #333);
}

.evidence-suggestion-field {
    padding: 1px var(--spacing-xs, 4px);
    background: var(--color-bg-medium, #e9ecef);
    border-radius: var(--radius-sm, 4px);
    font-family: monospace;
    font-size: 0.8rem;
}

.evidence-suggestion-change {
    margin: var(--spacing-xs, 4px) 0;
    font-size: 0.9rem;
}

.evidence-suggestion-current {
    color: var(--color-text-secondary, #6c757d);
    text-decoration: line-through;
}

.evidence-suggestion-arrow {
    color: var(--color-text-secondary, #6c757d);
}

.evidence-suggestion-proposed {
    font-weight: 600;
    color: var(--color-success, #28a745);
}

.evidence-suggestion-edit {
    width: 100%;
    margin: var(--spacing-xs, 4px) 0;
    font-size: 0.9rem;
}

.evidence-suggestion-reason {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-primary, #333);
}

.evidence-suggestion-footer {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 8px);
    margin-top: var(--spacing-xs, 4px);
    flex-wrap: wrap;
}

/* Direction badges: support / challenge / unknown */
.evidence-direction-badge {
    display: inline-block;
    padding: 2px var(--spacing-sm, 8px);
    border-radius: var(--radius-sm, 4px);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--color-bg-white, #ffffff);
}

.evidence-direction-support {
    background: var(--color-success, #28a745);
}

.evidence-direction-challenge {
    background: var(--color-danger, #dc3545);
}

.evidence-direction-unknown {
    background: var(--color-text-secondary, #6c757d);
}

/* Decided-status pills */
.evidence-suggestion-status {
    display: inline-block;
    padding: 2px var(--spacing-sm, 8px);
    border-radius: var(--radius-sm, 4px);
    font-size: 0.8rem;
    font-weight: 600;
}

.evidence-suggestion-status-approved {
    background: var(--color-success, #28a745);
    color: var(--color-bg-white, #ffffff);
}

.evidence-suggestion-status-rejected {
    background: var(--color-bg-medium, #e9ecef);
    color: var(--color-text-secondary, #6c757d);
}

/* ==========================================================================
   Match activity + live materials (Finance Evidence Phase 2, spec §5)
   ========================================================================== */

.match-activity {
    /* Transparent wrapper — the two groups below render as their own cards. */
    margin-top: 30px;
}
.match-activity-card {
    /* Match the .card-container card style (white, rounded, elevated) so each
       group reads the same as the Client Decision card it sits beside. */
    margin-bottom: 30px;
    padding: var(--spacing-lg, 20px);
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.match-activity-header {
    margin-bottom: var(--spacing-md, 16px);
}

/* Compact header — title and "Analyze a document" button on one row */
.match-activity-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm, 8px);
    margin-bottom: var(--spacing-sm, 8px);
}

/* Compact pair-activity control — single dense row, tighter spacing */
.match-activity-control-compact {
    margin-bottom: var(--spacing-sm, 8px);
}

.match-activity-inline-label {
    margin: 0;
    white-space: nowrap;
    align-self: center;
}

.match-activity-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary, #1a2234);
}

.match-activity-control {
    margin-bottom: var(--spacing-md, 16px);
}

.match-activity-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm, 8px);
    margin-bottom: var(--spacing-sm, 8px);
}

.match-activity-input {
    max-width: 180px;
}

.match-activity-note {
    flex: 1 1 200px;
    min-width: 160px;
}

.match-activity-side-states {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm, 8px);
    color: var(--color-text-secondary, #6c757d);
    font-size: 0.85rem;
}

.match-activity-side-label {
    font-weight: 600;
}

/* Activity badge — qualitative liveness states (decision #20). */
.activity-badge {
    display: inline-block;
    padding: 2px var(--spacing-sm, 8px);
    border-radius: var(--radius-sm, 4px);
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--color-bg-medium, #e9ecef);
    color: var(--color-text-secondary, #6c757d);
}

.activity-badge-none {
    background: var(--color-bg-medium, #e9ecef);
    color: var(--color-text-secondary, #6c757d);
}

.activity-badge-engaged {
    background: var(--color-info, #17a2b8);
    color: var(--color-bg-white, #ffffff);
}

.activity-badge-pursued {
    background: var(--color-success, #28a745);
    color: var(--color-bg-white, #ffffff);
}

.activity-badge-paused {
    background: var(--color-warning, #ffc107);
    color: var(--color-primary, #1a2234);
}

/* Live sale materials lists */
.materials-section {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md, 16px);
}

.materials-group {
    flex: 1 1 280px;
    min-width: 240px;
}

/* Compact materials — two tight columns, smaller min-width so they stay
   side-by-side, and reduced spacing to fit one screen. */
.materials-section-compact {
    gap: var(--spacing-sm, 8px);
}

.materials-section-compact .materials-group {
    flex: 1 1 0;
    min-width: 180px;
}

.materials-section-compact .materials-group-title {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.materials-group-title {
    font-weight: 600;
    color: var(--color-primary, #1a2234);
    margin-bottom: var(--spacing-sm, 8px);
}

.materials-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Activity-log entries reuse .materials-group, but they sit in a COLUMN list —
   so .materials-group's `flex: 1 1 280px` (a horizontal-grid basis) was turning
   into a 280px row HEIGHT per entry (the stray white space). Size to content. */
.activity-log-entry {
    flex: 0 0 auto;
    min-width: 0;
}

.materials-empty {
    color: var(--color-text-secondary, #6c757d);
    font-style: italic;
    font-size: 0.85rem;
}

.materials-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm, 8px);
    padding: 6px var(--spacing-sm, 8px);
    background: var(--color-bg-white, #ffffff);
    border: 1px solid var(--color-border-light, #dee2e6);
    border-radius: var(--radius-sm, 4px);
    font-size: 0.85rem;
}

.materials-item-class {
    font-weight: 600;
    color: var(--color-primary, #1a2234);
}

.materials-item-file {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-primary, #333);
}

.materials-item-meta,
.materials-item-target {
    color: var(--color-text-secondary, #6c757d);
}

.materials-item-status {
    padding: 1px 6px;
    border-radius: var(--radius-sm, 4px);
    font-size: 0.75rem;
    background: var(--color-bg-medium, #e9ecef);
    color: var(--color-text-secondary, #6c757d);
}

.materials-item-status-complete {
    background: var(--color-success, #28a745);
    color: var(--color-bg-white, #ffffff);
}

.materials-item-status-failed {
    background: var(--color-danger, #dc3545);
    color: var(--color-bg-white, #ffffff);
}

.materials-item-status-rendering {
    background: var(--color-info, #17a2b8);
    color: var(--color-bg-white, #ffffff);
}

.materials-item-status-pending {
    background: var(--color-bg-medium, #e9ecef);
    color: var(--color-text-secondary, #6c757d);
}

/* ==========================================================================
   Per-target supporting-information document list (history)
   Shared by the opportunity + CRM "Supporting Information" tabs and the
   matchmaker materials lists. Builds on the .materials-item row family.
   ========================================================================== */

.evidence-doc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.evidence-doc-item {
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.evidence-doc-item:hover,
.evidence-doc-item:focus {
    background: var(--color-bg-light, #f8f9fa);
    border-color: var(--color-primary, #1a2234);
    outline: none;
}

.materials-sent-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill, 999px);
    background: var(--color-bg-medium, #e9ecef);
    color: var(--color-primary, #1a2234);
    text-decoration: none;
    white-space: nowrap;
}

a.materials-sent-chip:hover {
    background: var(--color-primary, #1a2234);
    color: #fff;
}

.evidence-doc-delete {
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--color-text-secondary, #6c757d);
    cursor: pointer;
    padding: var(--spacing-xs, 4px);
    border-radius: var(--radius-sm, 4px);
}

.evidence-doc-delete:hover {
    color: var(--color-danger, #dc3545);
    background: var(--color-bg-medium, #e9ecef);
}

.evidence-doc-empty {
    color: var(--color-text-secondary, #6c757d);
    font-style: italic;
    font-size: 0.85rem;
}

/* ==========================================================================
   Match pair-launch evidence (Finance Evidence roadmap A, decisions #7/#18/#19)
   ========================================================================== */

.match-evidence-sides {
    margin-top: var(--spacing-lg, 20px);
    padding-top: var(--spacing-md, 15px);
    border-top: 1px solid var(--color-border, #dee2e6);
}

.match-evidence-side-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm, 10px);
    margin-bottom: var(--spacing-md, 15px);
}

.match-evidence-action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md, 15px);
}

.match-evidence-hint {
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6c757d);
}

.match-evidence-results {
    margin-top: var(--spacing-lg, 20px);
    padding-top: var(--spacing-md, 15px);
    border-top: 1px solid var(--color-border, #dee2e6);
}

.match-evidence-results-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary, #1a2234);
    margin-bottom: var(--spacing-md, 15px);
}

.match-evidence-record {
    margin-bottom: var(--spacing-lg, 20px);
    padding: var(--spacing-md, 15px);
    background: var(--color-bg-light, #f8f9fa);
    border-radius: var(--radius-md, 6px);
    border-left: 3px solid var(--color-primary, #0d6efd);
}

.match-evidence-record-header {
    font-weight: 600;
    color: var(--color-text-primary, #1a2234);
    margin-bottom: var(--spacing-xs, 5px);
}

.match-evidence-record-status {
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6c757d);
    margin-bottom: var(--spacing-sm, 10px);
}

.match-evidence-record-empty {
    font-size: 0.85rem;
    color: var(--color-text-secondary, #6c757d);
    font-style: italic;
    margin: 0;
}

/* ============================================================
   Activity Manager — Oversight tab (Feature C)
   ============================================================ */
.oversight-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 8px;
    margin-bottom: 8px;
}

.oversight-status-icon {
    margin-right: 4px;
}

.oversight-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.oversight-filter-input {
    flex: 1 1 220px;
    max-width: 340px;
}

.oversight-groupby {
    display: flex;
    align-items: center;
    gap: 6px;
}

.oversight-groupby .btn-action.active {
    background-color: var(--accent-primary, #1a2234);
    color: #fff;
}

.oversight-feed {
    display: flex;
    flex-direction: column;
}

.oversight-feed-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--content-border, #e5e7eb);
}

.oversight-feed-item:last-child {
    border-bottom: none;
}

.oversight-feed-icon {
    flex: 0 0 24px;
    text-align: center;
    color: var(--content-text-muted, #6b7280);
    padding-top: 2px;
}

.oversight-feed-body {
    flex: 1 1 auto;
    min-width: 0;
}

.oversight-feed-summary {
    font-size: 0.9em;
    color: var(--content-heading, #1a2234);
}

.oversight-feed-meta {
    margin-top: 2px;
}

.oversight-feed-time {
    flex: 0 0 auto;
    white-space: nowrap;
    padding-top: 2px;
}

/* ==================== Advisor Tool Chips ==================== */
/* Tool-call transparency chips in the advisor chat (ADVISOR_TOOL_USE.md §6.3) */

.advisor-tool-chips {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.advisor-tool-chip {
    background: var(--color-gray-50, #f8f9fa);
    border: 1px solid var(--color-gray-200, #e9ecef);
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-gray-700, #495057);
}

.advisor-tool-chip summary {
    cursor: pointer;
    padding: 6px 10px;
    user-select: none;
    list-style: none;
}

.advisor-tool-chip summary::-webkit-details-marker {
    display: none;
}

.advisor-tool-chip summary i {
    margin-right: 6px;
    color: var(--color-primary, #1976d2);
}

.advisor-tool-chip[open] {
    background: var(--color-gray-100, #f1f3f5);
}

.advisor-tool-chip-detail {
    padding: 4px 10px 8px;
    border-top: 1px solid var(--color-gray-200, #e9ecef);
}

.advisor-tool-chip-detail pre {
    margin: 4px 0 0;
    padding: 6px;
    background: var(--color-gray-100, #f1f3f5);
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 160px;
    overflow-y: auto;
}

.advisor-tool-chip-error summary i {
    color: var(--color-danger, #dc3545);
}

.advisor-tool-chip-error {
    border-color: var(--color-danger, #dc3545);
}

/* ---- Grouped tool calls: one collapsible summary per assistant turn ---- */
.advisor-tool-group {
    border: 1px solid var(--color-gray-200, #e9ecef);
    border-radius: 8px;
    background: var(--color-gray-50, #f8f9fa);
    margin-bottom: 8px;
    overflow: hidden;
}

.advisor-tool-group-summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-gray-700, #495057);
}

.advisor-tool-group-summary::-webkit-details-marker { display: none; }

.advisor-tool-group[open] .advisor-tool-group-summary {
    border-bottom: 1px solid var(--color-gray-200, #e9ecef);
}

.advisor-tool-group-icon { color: var(--color-primary, #1976d2); }

/* Completed + all-ok = green check; error = red; working keeps the blue spinner */
.advisor-tool-group:not(.advisor-tool-group-working):not(.advisor-tool-group-error) .advisor-tool-group-icon {
    color: var(--color-success, #28a745);
}
.advisor-tool-group-error .advisor-tool-group-icon { color: var(--color-danger, #dc3545); }

.advisor-tool-group-count { font-weight: 400; color: var(--color-gray-500, #adb5bd); }
.advisor-tool-group-meta { color: var(--color-gray-500, #adb5bd); font-weight: 400; font-variant-numeric: tabular-nums; }

.advisor-tool-group-chevron {
    margin-left: auto;
    color: var(--color-gray-400, #ced4da);
    font-size: 11px;
    transition: transform 0.15s ease;
}
.advisor-tool-group[open] .advisor-tool-group-chevron { transform: rotate(180deg); }

.advisor-tool-group .advisor-tool-chips { padding: 6px; margin-bottom: 0; gap: 5px; }

/* ---- Graphical inner chips: icon badge + status dot + tabular timing ---- */
.advisor-tool-chip summary {
    display: flex;
    align-items: center;
    gap: 8px;
}

.advisor-tool-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(25, 118, 210, 0.09);
    color: var(--color-primary, #1976d2);
    font-size: 11px;
    flex: none;
}
/* Override the generic `.advisor-tool-chip summary i` margin/color inside the badge */
.advisor-tool-chip summary .advisor-tool-chip-icon { margin-right: 0; }
.advisor-tool-chip summary .advisor-tool-chip-icon i { margin: 0; color: inherit; }

.advisor-tool-chip-error .advisor-tool-chip-icon {
    background: rgba(220, 53, 69, 0.09);
    color: var(--color-danger, #dc3545);
}

.advisor-tool-chip-name { flex: 1 1 auto; min-width: 0; }

.advisor-tool-chip-time {
    color: var(--color-gray-500, #adb5bd);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    flex: none;
}

.advisor-tool-chip-status { flex: none; font-size: 11px; }
.advisor-tool-chip summary i.advisor-tool-chip-status.ok { color: var(--color-success, #28a745); margin-right: 0; }
.advisor-tool-chip summary i.advisor-tool-chip-status.err { color: var(--color-danger, #dc3545); margin-right: 0; }

@media (prefers-reduced-motion: reduce) {
    .advisor-tool-group-chevron { transition: none; }
}

/* ==================== Advisor "Connect a web assistant" panel ==================== */
.advisor-connect {
    margin: 10px 14px 0;
    border: 1px solid var(--color-gray-200, #e9ecef);
    border-radius: 8px;
    background: var(--color-gray-50, #f8f9fa);
    overflow: hidden;
}
.advisor-connect-summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-gray-700, #495057);
}
.advisor-connect-summary::-webkit-details-marker { display: none; }
.advisor-connect-summary > i.fa-plug { color: var(--color-primary, #1976d2); }
.advisor-connect-chevron {
    margin-left: auto;
    color: var(--color-gray-400, #ced4da);
    font-size: 11px;
    transition: transform 0.15s ease;
}
.advisor-connect[open] .advisor-connect-chevron { transform: rotate(180deg); }
.advisor-connect[open] .advisor-connect-summary {
    border-bottom: 1px solid var(--color-gray-200, #e9ecef);
}
.advisor-connect-body { padding: 12px 14px 16px; }
.advisor-connect-lead {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--color-gray-700, #495057);
}
.advisor-connect-copyrow {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}
.advisor-connect-input {
    flex: 1 1 auto;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    background: #fff;
}
.advisor-connect-steps {
    margin: 12px 0 8px;
    padding-left: 20px;
    font-size: 13px;
    color: var(--color-gray-700, #495057);
    line-height: 1.6;
}
.advisor-connect-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--color-gray-500, #adb5bd);
}
.advisor-connect-note > i { color: var(--color-primary, #1976d2); margin-right: 4px; }
@media (prefers-reduced-motion: reduce) {
    .advisor-connect-chevron { transition: none; }
}

/* Blinking cursor while an advisor answer is streaming token-by-token.
   NOTE: no `white-space: pre-wrap` here — the streaming text is rendered markdown
   HTML, and pre-wrap would preserve the newlines marked.js emits between block
   elements as extra blank lines (they collapse once the class is removed at the
   end, which is why spacing "tightened up" after completion). */
.advisor-streaming-text::after {
    content: '\258c';
    margin-left: 1px;
    color: var(--color-primary, #1976d2);
    animation: advisor-caret 1s steps(1) infinite;
}
@keyframes advisor-caret {
    50% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .advisor-streaming-text::after { animation: none; }
}
