/* ===== DC AGENTS THEME ===== */
/* Custom theme styles for DC Agents platform */

/* Global body styles */
html, body {
    background-color: var(--dc-off-white);
    min-height: 100vh;
    font-family: 'Roboto', sans-serif;
}

/* DC Brand Color Variables */
:root {
    /* Brand Colors */
    --dc-beige: rgb(223, 202, 156);
    --dc-off-white: #F8F8F8;
    --dc-dark-blue: rgb(18, 38, 53);
    --dc-blue: rgb(25, 62, 130);
    --dc-light-blue: rgb(134, 171, 209);

    /* RGB values for alpha transparency */
    --dc-primary-rgb: 25, 62, 130;
    --dc-primary-dark-rgb: 18, 38, 53;
    --dc-success-rgb: 40, 167, 69;
    --dc-info-rgb: 23, 162, 184;
    --dc-warning-rgb: 255, 193, 7;
    --dc-danger-rgb: 220, 53, 69;
}

/* ===== BUTTON STYLING ===== */

/* Primary Button - DC Blue outline style */
.btn-primary {
    background-color: white;
    border: 1px solid var(--dc-blue);
    color: var(--dc-blue);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(25, 62, 130, 0.15);
    text-decoration: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--dc-light-blue);
    border-color: var(--dc-blue);
    color: var(--dc-blue);
    text-decoration: none;
}

.btn-primary:active,
.btn-primary:focus {
    background-color: var(--dc-dark-blue);
    border-color: var(--dc-dark-blue);
    color: white;
    box-shadow: 0 2px 4px rgba(18, 38, 53, 0.2);
    text-decoration: none;
}

/* Secondary Button - Beige style */
.btn-secondary {
    background-color: white;
    border: 1px solid var(--dc-beige);
    color: var(--dc-dark-blue);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
    border-color: var(--dc-beige);
    text-decoration: none;
}

.btn-secondary:active,
.btn-secondary:focus {
    background-color: #f8f9fa;
    text-decoration: none;
}

/* Danger Button - Subtle styling */
.btn-danger {
    background-color: white;
    border: 1px solid #ef4444;
    color: #ef4444;
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
    text-decoration: none;
}

.btn-danger:active,
.btn-danger:focus {
    background-color: #fee2e2;
    border-color: #dc2626;
    color: #dc2626;
    text-decoration: none;
}

/* Small Button */
.btn-sm {
    padding: 0.375rem 0.9rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

/* Icon-only buttons */
.btn i.fas,
.btn i.far {
    font-size: 0.9rem;
}

/* Badge Styling */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
}

.badge.bg-primary {
    background-color: var(--dc-blue);
    color: white;
}

.badge.bg-secondary {
    background-color: white;
    color: var(--dc-dark-blue);
    border: 1px solid #e5e7eb;
}

/* DC Brand Utility Classes */
.bg-dc-beige { background-color: var(--dc-beige); }
.bg-dc-brown { background-color: var(--dc-brown); }
.bg-dc-off-white { background-color: var(--dc-off-white); }
.bg-dc-dark-blue { background-color: var(--dc-dark-blue); }
.bg-dc-blue { background-color: var(--dc-blue); }
.bg-dc-light-blue { background-color: var(--dc-light-blue); }
.bg-dc-primary { background-color: var(--dc-blue); }

.text-dc-beige { color: var(--dc-beige); }
.text-dc-brown { color: var(--dc-brown); }
.text-dc-off-white { color: var(--dc-off-white); }
.text-dc-dark-blue { color: var(--dc-dark-blue); }
.text-dc-blue { color: var(--dc-blue); }
.text-dc-light-blue { color: var(--dc-light-blue); }

/* Visibility Badge Styling */
.visibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.visibility-badge-public {
    background-color: white;
    color: var(--dc-blue);
    border: 1px solid var(--dc-blue);
}

.visibility-badge-specific {
    background-color: white;
    color: #9ca3af;
    border: 1px solid #9ca3af;
}

.visibility-badge-private {
    background-color: white;
    color: var(--dc-dark-blue);
    border: 1px solid var(--dc-dark-blue);
}

/* Card Styling */
.card-dc {
    border: 1px solid rgba(223, 202, 156, 0.3);
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.card-dc:hover {
    /* Hover effect removed per user request */
}

.card-dc .card-header {
    background-color: white;
    border-bottom: 1px solid rgba(223, 202, 156, 0.3);
    color: var(--dc-dark-blue);
    border-radius: 12px 12px 0 0;
    font-weight: 600;
}

.card-dc .card-body {
    padding: 1.5rem;
}

/* ===== FORM STYLING ===== */

/* Base form control */
.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--dc-dark-blue);
    background-color: white;
    background-clip: padding-box;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(25, 62, 130, 0.15);
    outline: none;
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: #f3f4f6;
    opacity: 1;
}

/* Textarea */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Select */
.form-select {
    display: block;
    width: 100%;
    padding: 10px 40px 10px 14px;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--dc-dark-blue);
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234b5563' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.form-select:focus {
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(25, 62, 130, 0.15);
    outline: none;
}

.form-select:disabled {
    background-color: #f3f4f6;
}

/* Labels */
.form-label {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dc-dark-blue);
}

/* Form text / help text */
.form-text {
    margin-top: 4px;
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Checkbox and Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 1.5rem;
    padding-left: 0;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    background-color: white;
    border: 2px solid #d1d5db;
    appearance: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.form-check-input[type="checkbox"] {
    border-radius: 4px;
}

.form-check-input[type="radio"] {
    border-radius: 50%;
}

.form-check-input:checked {
    background-color: var(--dc-blue);
    border-color: var(--dc-blue);
}

.form-check-input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.form-check-input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
    background-size: contain;
}

.form-check-input:focus {
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(25, 62, 130, 0.15);
    outline: none;
}

.form-check-label {
    font-size: 0.9375rem;
    color: var(--dc-dark-blue);
    cursor: pointer;
}

/* Input group */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    font-size: 0.9375rem;
    font-weight: 400;
    color: #6b7280;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

.input-group > .input-group-text:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .input-group-text:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

/* Form validation states */
.is-valid {
    border-color: #22c55e;
}

.is-valid:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.is-invalid {
    border-color: #ef4444;
}

.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: #ef4444;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

.valid-feedback {
    display: none;
    width: 100%;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: #22c55e;
}

.is-valid ~ .valid-feedback {
    display: block;
}

/* Clean spacing for button groups */
.btn + .btn {
    margin-left: 0.5rem;
}

/* Responsive button adjustments */
@media (max-width: 768px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

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

/* ===== CUSTOM BUTTON VARIANTS ===== */

/* New Agent Button - fills on hover */
.btn-new-agent {
    background-color: white;
    border: 1px solid var(--dc-blue);
    color: var(--dc-blue);
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(25, 62, 130, 0.1);
    text-decoration: none;
}

.btn-new-agent:hover,
.btn-new-agent:focus {
    background-color: var(--dc-blue);
    border-color: var(--dc-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(25, 62, 130, 0.25);
    text-decoration: none;
}

.btn-new-agent:active {
    background-color: var(--dc-dark-blue);
    border-color: var(--dc-dark-blue);
    color: white;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(18, 38, 53, 0.2);
}

/* Chat Button - icon style button */
.btn-chat {
    background-color: white;
    color: var(--dc-blue);
    padding: 0.375rem;
    border-radius: 6px;
    border: 1px solid var(--dc-blue);
    transition: all 0.15s ease-in-out;
    font-size: 1rem;
    box-shadow: none;
    text-decoration: none;
}

.btn-chat:hover,
.btn-chat:focus {
    background-color: rgba(25, 62, 130, 0.1);
    border-color: var(--dc-blue);
    color: var(--dc-blue);
    transform: scale(1.05);
    text-decoration: none;
}

.btn-chat:active {
    background-color: rgba(25, 62, 130, 0.15);
    border-color: var(--dc-dark-blue);
    color: var(--dc-dark-blue);
    transform: scale(1.02);
}

.btn-chat.btn-sm {
    padding: 0.25rem;
    font-size: 0.9rem;
}

/* ===== DASHBOARD COMPONENT STYLES ===== */

/* Ghost Button */
.btn-ghost {
    background: transparent;
    color: var(--dc-blue);
    padding: 8px 12px;
    border: none;
    font-weight: 500;
    font-size: 0.875rem;
    box-shadow: none;
    cursor: pointer;
}

.btn-ghost:hover {
    background: rgba(25, 62, 130, 0.08);
    color: var(--dc-blue);
}

/* Icon Button */
.btn-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    background: var(--dc-dark-blue);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.btn-icon:hover {
    background: var(--dc-blue);
    transform: translateX(2px);
}

/* ===== DASHBOARD HEADER ===== */
.dashboard > .header,
.dashboard header.header {
    margin-bottom: 48px;
}

.dashboard .header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard .header-left h1 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    letter-spacing: -0.025em;
    margin-bottom: 8px;
    margin-top: 0;
}

.dashboard .header-left p {
    font-size: 0.9375rem;
    color: #4b5563;
    font-weight: 400;
    margin-bottom: 0;
}

.dashboard .header-actions {
    display: flex;
    gap: 12px;
}

/* ===== STATS GRID ===== */
.dashboard .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.dashboard .stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    box-shadow: none;
}

.dashboard .stat-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dashboard .stat-label {
    font-size: 0.8125rem;
    color: #9ca3af;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dc-dark-blue);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

/* ===== CONTENT GRID ===== */
.dashboard .content-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* ===== CARD ENHANCEMENTS ===== */
.dashboard .card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: none;
}

.dashboard .card > .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    border-radius: 0;
}

.dashboard .card-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard .card-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dc-dark-blue);
    border-radius: 8px;
    color: white;
    font-size: 0.875rem;
}

.dashboard .card-icon.beige {
    background: var(--dc-beige);
    color: var(--dc-dark-blue);
}

.dashboard .card-header .card-title,
.dashboard .card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin: 0;
}

.dashboard .card > .card-body {
    padding: 16px;
}

/* ===== CONVERSATION LIST ===== */
.dashboard .conversation-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dashboard .conversation-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.dashboard .conversation-item:hover {
    background: #f8fafc;
    text-decoration: none;
}

.dashboard .conversation-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, var(--dc-dark-blue) 0%, var(--dc-blue) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.dashboard .conversation-content {
    flex: 1;
    min-width: 0;
}

.dashboard .conversation-title {
    font-weight: 500;
    color: var(--dc-dark-blue);
    font-size: 0.9375rem;
    margin-bottom: 4px;
}

.dashboard .conversation-meta {
    font-size: 0.8125rem;
    color: #9ca3af;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard .conversation-meta span:not(:last-child)::after {
    content: '\00b7';
    margin-left: 8px;
    color: #e5e7eb;
}

.dashboard .conversation-action {
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.dashboard .conversation-item:hover .conversation-action {
    opacity: 1;
}

/* ===== FAVORITES GRID ===== */
.dashboard .favorites-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.dashboard .favorite-card {
    padding: 20px 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    background: white;
}

.dashboard .favorite-card:hover {
    border-color: var(--dc-dark-blue);
    box-shadow: 0 4px 12px rgba(15, 23, 41, 0.08);
}

.dashboard .favorite-icon {
    width: 48px;
    height: 48px;
    background: var(--dc-beige);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    color: var(--dc-dark-blue);
    font-size: 1.125rem;
}

.dashboard .favorite-name {
    font-weight: 600;
    color: var(--dc-dark-blue);
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.dashboard .favorite-desc {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0;
}

.dashboard .favorite-btn {
    margin-top: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--dc-dark-blue);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    padding: 0;
}

.dashboard .favorite-card:hover .favorite-btn {
    opacity: 1;
}

.dashboard .favorite-btn:hover {
    background: var(--dc-blue);
}

/* ===== ACTIONS SECTION ===== */
.dashboard .actions-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
}

.dashboard .actions-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.dashboard .actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.dashboard .action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--dc-dark-blue);
}

.dashboard .action-card:hover {
    border-color: var(--dc-dark-blue);
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 41, 0.08);
    text-decoration: none;
    color: var(--dc-dark-blue);
}

.dashboard .action-card i {
    font-size: 1.25rem;
    color: var(--dc-blue);
}

.dashboard .action-card span {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ===== MOST USED BANNER ===== */
.dashboard .most-used-banner {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 24px;
}

.dashboard .most-used-label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    font-weight: 600;
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

.dashboard .most-used-agent {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.dashboard .most-used-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--dc-dark-blue);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.dashboard .most-used-info h4 {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--dc-dark-blue);
    margin: 0;
}

.dashboard .most-used-info span {
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* ===== DASHBOARD RESPONSIVE ===== */
@media (max-width: 1024px) {
    .dashboard .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard .content-grid {
        grid-template-columns: 1fr;
    }
    .dashboard .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .dashboard .stats-grid {
        grid-template-columns: 1fr;
    }
    .dashboard .header-content {
        flex-direction: column;
        gap: 20px;
    }
    .dashboard .header-left h1 {
        font-size: 1.5rem;
    }
    .dashboard .most-used-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .dashboard .conversation-action {
        opacity: 1;
    }
    .dashboard .favorite-btn {
        opacity: 1;
    }
}

/* ===== FOCUS STATES FOR ACCESSIBILITY ===== */
.btn:focus-visible,
.action-card:focus-visible,
.favorite-card:focus-visible,
.conversation-item:focus-visible {
    outline: 2px solid var(--dc-blue);
    outline-offset: 2px;
}

/* ===== AGENT LIST PAGE STYLES ===== */

/* Filters Section */
.filters-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    margin-bottom: 32px;
}

.filters-grid {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.filter-item {
    flex: 1;
}

.filter-item.filter-search {
    flex: 2;
}

.filter-item .form-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Agents Section */
.agents-section {
    margin-bottom: 48px;
}

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

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin: 0;
}

/* Agents Grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Agent Card */
.agent-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.agent-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.agent-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 20px 0;
    gap: 12px;
}

.agent-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin: 0;
    line-height: 1.4;
}

.agent-card-body {
    padding: 12px 20px 16px;
    flex: 1;
}

.agent-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 12px;
    line-height: 1.5;
}

.agent-folders {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.folder-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
}

.agent-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.8125rem;
    color: #9ca3af;
}

.agent-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.agent-actions-left,
.agent-actions-right {
    display: flex;
    gap: 4px;
}

.btn-action {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--dc-blue);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-action:hover {
    background: rgba(25, 62, 130, 0.1);
    color: var(--dc-dark-blue);
}

.btn-action-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.empty-state i {
    font-size: 2.5rem;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin: 0 0 8px;
}

.empty-state p {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0 0 20px;
    max-width: 400px;
}

.empty-state-large {
    padding: 80px 24px;
}

.empty-state-large i {
    font-size: 3.5rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}

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

.modal-container {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.2s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #9ca3af;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: var(--dc-dark-blue);
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Alert Component */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert i {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

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

/* Folder Modal Styles */
.folder-section {
    margin-bottom: 20px;
}

.folder-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    align-items: center;
}

.folder-tag-active {
    background: var(--dc-blue);
    color: white;
}

.folder-tag-available {
    background: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.folder-tag-available:hover {
    border-color: var(--dc-blue);
    color: var(--dc-blue);
}

.folder-tag-btn {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    display: flex;
    align-items: center;
}

.folder-tag-btn:hover {
    opacity: 1;
}

/* Utility Classes */
.d-inline {
    display: inline;
}

.text-warning {
    color: #f59e0b;
}

.text-muted {
    color: #9ca3af;
}

.text-danger {
    color: #ef4444;
}

/* Agent List Responsive */
@media (max-width: 1200px) {
    .agents-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filters-grid {
        flex-wrap: wrap;
    }
    .agents-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .filters-grid {
        flex-direction: column;
    }
    .section-title h2 {
        font-size: 1rem;
    }
}

/* ========================================
   AGENT DETAIL PAGE STYLES
   ======================================== */

/* Container */
.agent-detail-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.agent-detail-container *,
.agent-detail-container *::before,
.agent-detail-container *::after {
    box-sizing: border-box;
}

/* Alert styling in detail container */
.agent-detail-container .alert {
    margin: 0;
}

/* Card styling for detail pages */
.agent-detail-container .card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.agent-detail-container .card-body {
    padding: 24px !important;
    box-sizing: border-box;
}

/* Alert Info */
.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* Form Grid - 2 column layout */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* Form Group */
.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-grid .form-group {
    margin-bottom: 0;
}

.form-group-inner {
    margin-bottom: 16px;
}

.form-group-inner:last-child {
    margin-bottom: 0;
}

/* Label with info icon */
.form-label i {
    font-size: 0.75rem;
    margin-left: 6px;
    cursor: help;
}

/* Checkbox Group */
.checkbox-group {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.checkbox-group .form-check {
    margin-bottom: 8px;
}

.checkbox-group .form-check:last-child {
    margin-bottom: 0;
}

/* Parameter Stack - vertical stack for temp/top-p */
.parameter-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Agent Info Card */
.agent-info-card {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin-top: 32px;
}

.agent-info-card h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-info-card h6 i {
    color: var(--text-muted);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

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

.info-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-value {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.info-value-mono {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8125rem;
    word-break: break-all;
}

/* Agent Detail Responsive */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   AGENT FORM PAGE STYLES (Create/Edit)
   ======================================== */

/* Container */
.agent-form-container {
    max-width: 900px;
    margin: 0 auto;
}

.agent-form-container *,
.agent-form-container *::before,
.agent-form-container *::after {
    box-sizing: border-box;
}

.agent-form-container .card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.agent-form-container .card-body {
    padding: 24px;
}

/* Form Label Row - label with inline controls */
.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 12px;
}

.form-label-row .form-label {
    margin-bottom: 0;
}

/* Prompt Selector */
.prompt-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt-selector-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.prompt-selector .form-select {
    min-width: 200px;
    max-width: 300px;
}

/* Form Select Small */
.form-select-sm {
    padding: 6px 32px 6px 10px;
    font-size: 0.8125rem;
}

/* Subjects Controls */
.subjects-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.subjects-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Subjects Search */
.subjects-search {
    margin-bottom: 16px;
}

.subjects-search .form-control {
    max-width: 300px;
}

/* Subjects Grid */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.subject-item {
    transition: opacity 0.2s ease;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.checkbox-label:hover {
    border-color: var(--dc-blue);
    background: #f0f4ff;
}

.checkbox-label:has(input:checked) {
    background: #e0e7ff;
    border-color: var(--dc-blue);
    color: var(--dc-blue);
}

.checkbox-label span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Subjects Toggle */
.subjects-toggle {
    text-align: center;
    margin-top: 12px;
}

/* Behavior Presets */
.behavior-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 12px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: var(--dc-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preset-btn.active {
    background: var(--dc-blue);
    border-color: var(--dc-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(25, 62, 130, 0.3);
}

.preset-icon {
    font-size: 1.5rem;
}

.preset-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.preset-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.preset-btn.active .preset-desc {
    color: rgba(255, 255, 255, 0.8);
}

/* Custom Settings */
.custom-settings {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

/* Range Input */
.form-range {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--dc-blue);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--dc-blue);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* Users Grid */
.users-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* Form Help Text */
.form-help {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Agent Form Responsive */
@media (max-width: 1024px) {
    .behavior-presets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .form-label-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .prompt-selector {
        width: 100%;
    }

    .prompt-selector .form-select {
        flex: 1;
        max-width: none;
    }

    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .users-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .subjects-controls {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .behavior-presets {
        grid-template-columns: 1fr;
    }

    .subjects-grid {
        grid-template-columns: 1fr;
    }

    .users-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ========================================
   PROMPT DETAIL PAGE STYLES
   ======================================== */

/* Header row with visibility badge and actions */
.prompt-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

/* Description text */
.prompt-description {
    font-size: 0.9375rem;
    color: var(--dc-dark-blue);
    line-height: 1.6;
    margin: 0;
}

/* Prompt content wrapper and box */
.prompt-content-wrapper {
    position: relative;
    background: #1e293b;
    border-radius: 8px;
    overflow: hidden;
}

.prompt-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.prompt-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e5e7eb;
}

.prompt-copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.prompt-copy-btn i {
    font-size: 0.6875rem;
}

.prompt-content-box {
    background: #1e293b;
    padding: 16px;
    padding-top: 40px;
    font-family: 'Roboto Mono', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #e2e8f0;
    max-height: 400px;
    overflow-y: auto;
}

/* Shared users list */
.shared-users-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: #1e40af;
}

.user-badge i {
    font-size: 0.75rem;
}

/* Copy notification */
.copy-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--dc-dark-blue);
    color: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    font-size: 0.875rem;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1100;
}

.copy-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.copy-notification i {
    color: #22c55e;
    font-size: 1rem;
}

/* ========================================
   DOCUMENT LIST PAGE STYLES
   ======================================== */

/* Filter actions button alignment */
.filter-item.filter-actions {
    display: flex;
    flex-direction: column;
}

.filter-item.filter-actions .btn {
    height: 44px;
}

/* Documents Table Container */
.documents-table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

/* Documents Table */
.documents-table {
    width: 100%;
    border-collapse: collapse;
}

.documents-table thead {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.documents-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.documents-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.documents-table tbody tr:last-child td {
    border-bottom: none;
}

.documents-table tbody tr:hover {
    background: #f9fafb;
}

/* Document Title Cell */
.document-title-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.document-title-cell > i {
    color: var(--dc-blue);
    font-size: 1.25rem;
}

.document-title-cell strong {
    display: block;
    color: var(--dc-dark-blue);
    font-size: 0.9375rem;
}

.document-source {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 2px;
}

.document-source i {
    margin-right: 4px;
}

/* Subject Badge */
.subject-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
}

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

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

.status-pending {
    background: #f3f4f6;
    color: #6b7280;
}

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

/* Chunks Count */
.chunks-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 4px 8px;
    background: var(--dc-blue);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
}

/* Date Cell */
.date-cell {
    font-size: 0.8125rem;
    color: #6b7280;
}

.date-cell small {
    color: #9ca3af;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 4px;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

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

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: var(--dc-dark-blue);
    text-decoration: none;
    transition: all 0.15s ease;
}

.pagination-btn:hover {
    background: #f3f4f6;
    border-color: var(--dc-blue);
    color: var(--dc-blue);
}

.pagination-info {
    padding: 8px 16px;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Document List Responsive */
@media (max-width: 1024px) {
    .documents-table th,
    .documents-table td {
        padding: 12px 16px;
    }

    .documents-table th:nth-child(4),
    .documents-table td:nth-child(4) {
        display: none;
    }
}

@media (max-width: 768px) {
    .documents-table-container {
        overflow-x: auto;
    }

    .documents-table {
        min-width: 600px;
    }

    .documents-table th:nth-child(5),
    .documents-table td:nth-child(5) {
        display: none;
    }
}

/* ============================================
   Document Detail Styles
   ============================================ */

/* Header badges container */
.header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* Chunks Section */
.chunks-section {
    margin-top: 24px;
}

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

.chunk-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.chunk-item:hover {
    border-color: #d1d5db;
}

.chunk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.chunk-header:hover {
    background: #f9fafb;
}

.chunk-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chunk-title strong {
    font-size: 0.9375rem;
    color: var(--dc-dark-blue);
}

.chunk-section {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 400;
}

.chunk-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chunk-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.chunk-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.chunk-badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.chunk-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.chunk-chevron {
    color: #9ca3af;
    transition: transform 0.2s ease;
    margin-left: 8px;
}

.chunk-item.is-open .chunk-chevron {
    transform: rotate(180deg);
}

.chunk-content {
    display: none;
    padding: 0 20px 20px;
    border-top: 1px solid #e5e7eb;
}

.chunk-item.is-open .chunk-content {
    display: block;
}

.chunk-content-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    padding-top: 16px;
}

@media (max-width: 768px) {
    .chunk-content-grid {
        grid-template-columns: 1fr;
    }
}

.chunk-text,
.chunk-meta {
    display: flex;
    flex-direction: column;
}

.chunk-text-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.chunk-meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.chunk-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chunk-meta-label {
    font-size: 0.8125rem;
    color: #6b7280;
}

.chunk-meta-value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dc-dark-blue);
}

.chunk-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chunk-links-list li {
    font-size: 0.8125rem;
}

.chunk-links-list a {
    color: var(--dc-blue);
    text-decoration: none;
}

.chunk-links-list a:hover {
    text-decoration: underline;
}

/* ============================================
   Document Upload Styles
   ============================================ */

/* Upload Method Grid */
.upload-method-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 640px) {
    .upload-method-grid {
        grid-template-columns: 1fr;
    }
}

.upload-method-card {
    display: block;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    background: white;
}

.upload-method-card:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.upload-method-card.is-selected {
    border-color: var(--dc-blue);
    background: rgba(25, 62, 130, 0.04);
}

.upload-method-card input[type="radio"] {
    display: none;
}

.upload-method-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.upload-method-content i {
    font-size: 2rem;
    color: var(--dc-blue);
}

.upload-method-content strong {
    font-size: 1rem;
    color: var(--dc-dark-blue);
}

.upload-method-content span {
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Upload Info Grid */
.upload-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 640px) {
    .upload-info-grid {
        grid-template-columns: 1fr;
    }
}

.upload-info-section strong {
    display: block;
    font-size: 0.875rem;
    color: var(--dc-dark-blue);
    margin-bottom: 12px;
}

.upload-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-info-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: #374151;
}

.upload-info-list li i {
    width: 16px;
    text-align: center;
}

.upload-info-list li i.text-success {
    color: #059669;
}

.upload-info-list li i.fas:not(.text-success) {
    color: var(--dc-blue);
}

/* ============================================
   User Profile Styles
   ============================================ */

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--dc-blue), var(--dc-dark-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-avatar i {
    font-size: 2rem;
    color: white;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin: 0;
}

.profile-email {
    font-size: 0.9375rem;
    color: #6b7280;
}

.profile-info .status-badge {
    align-self: flex-start;
    margin-top: 4px;
}

@media (max-width: 480px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-info {
        align-items: center;
    }

    .profile-info .status-badge {
        align-self: center;
    }
}

/* ============================================
   Usage Overview Styles
   ============================================ */

/* Controls Card */
.usage-controls-card {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.usage-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Period Selector */
.period-selector {
    display: flex;
    gap: 8px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 8px;
}

.period-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s ease;
}

.period-btn:hover {
    background: white;
    color: var(--dc-blue);
    text-decoration: none;
}

.period-btn.active {
    background: var(--dc-blue);
    color: white;
}

.period-btn i {
    font-size: 0.8125rem;
}

/* Date Navigation */
.date-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-display {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    min-width: 160px;
    text-align: center;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-btn:hover:not(:disabled) {
    background: #f3f4f6;
    color: var(--dc-blue);
    text-decoration: none;
}

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

/* Current Period Display */
.current-period-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--dc-blue), var(--dc-dark-blue));
    border-radius: 10px;
    color: white;
}

.current-period-display i {
    font-size: 1.25rem;
    opacity: 0.9;
}

.current-period-display strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
}

.current-period-display span {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Usage Tabs */
.usage-tabs {
    display: flex;
    gap: 8px;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.usage-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.usage-tab:hover {
    background: #f3f4f6;
    color: var(--dc-blue);
}

.usage-tab.active {
    background: rgba(25, 62, 130, 0.1);
    color: var(--dc-blue);
}

.usage-tab i {
    font-size: 1rem;
}

/* Usage Content Panes */
.usage-content {
    position: relative;
}

.usage-pane {
    display: none;
}

.usage-pane.active {
    display: block;
}

/* Usage Table */
.usage-table th,
.usage-table td {
    vertical-align: middle;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--dc-blue), var(--dc-dark-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar-sm i {
    font-size: 0.875rem;
    color: white;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--dc-blue);
    background: rgba(25, 62, 130, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.admin-badge i {
    font-size: 0.625rem;
}

.spend-value {
    font-weight: 600;
    color: var(--dc-dark-blue);
}

/* Usage Progress Bar */
.usage-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    min-width: 80px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar-fill.normal {
    background: linear-gradient(90deg, var(--dc-blue), var(--dc-light-blue));
}

.progress-bar-fill.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.progress-bar-fill.danger {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.progress-text {
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: 45px;
}

.text-warning {
    color: #f59e0b !important;
}

.text-danger {
    color: #ef4444 !important;
}

/* Usage Summary Grid */
.usage-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 24px 0;
}

@media (max-width: 1024px) {
    .usage-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .usage-summary-grid {
        grid-template-columns: 1fr;
    }
}

.usage-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.usage-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(25, 62, 130, 0.1), rgba(25, 62, 130, 0.2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.usage-stat-card .stat-icon i {
    font-size: 1.25rem;
    color: var(--dc-blue);
}

.usage-stat-card .stat-content {
    flex: 1;
}

.usage-stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dc-dark-blue);
    line-height: 1.2;
}

.usage-stat-card .stat-label {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 2px;
}

/* Info Items Row */
.info-items-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .info-items-row {
        grid-template-columns: 1fr;
    }
}

.info-block {
    display: flex;
    gap: 12px;
}

.info-block > i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dc-blue);
    flex-shrink: 0;
}

.info-block strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin-bottom: 4px;
}

.info-block p {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Chart View */
.chart-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.chart-controls h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-controls h3 i {
    color: var(--dc-blue);
}

.chart-filters {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.chart-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-filter label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    white-space: nowrap;
}

.chart-filter select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    min-width: 200px;
    background: white;
}

.chart-filter select:focus {
    outline: none;
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(25, 62, 130, 0.1);
}

.chart-filter input[type="range"] {
    width: 120px;
    accent-color: var(--dc-blue);
}

.periods-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dc-blue);
    min-width: 24px;
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
}

.chart-wrapper {
    position: relative;
    height: 350px;
    margin-bottom: 24px;
}

/* Chart Loading */
.chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 40px;
}

.chart-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--dc-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.chart-loading p {
    margin-top: 16px;
    font-size: 0.9375rem;
    color: #6b7280;
}

/* Chart Error */
.chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 40px;
    text-align: center;
}

.chart-error i {
    font-size: 3rem;
    color: #f59e0b;
    margin-bottom: 16px;
}

.chart-error h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin: 0 0 8px 0;
}

.chart-error p {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
}

/* Chart Summary Grid */
.chart-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
    .chart-summary-grid {
        grid-template-columns: 1fr;
    }
}

.chart-summary-card {
    text-align: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
}

.chart-summary-card .summary-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, rgba(25, 62, 130, 0.1), rgba(25, 62, 130, 0.2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-summary-card .summary-icon i {
    font-size: 1rem;
    color: var(--dc-blue);
}

.chart-summary-card h6 {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 8px 0;
}

.chart-summary-card .summary-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--dc-dark-blue);
}

.chart-summary-card small {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .usage-controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .period-selector {
        justify-content: center;
    }

    .date-navigation {
        justify-content: center;
        flex-wrap: wrap;
    }

    .chart-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .chart-filters {
        justify-content: center;
    }
}

/* ============================================
   Users Overview Styles
   ============================================ */

/* Role Badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.role-badge i {
    font-size: 0.6875rem;
}

.role-superuser {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.role-staff {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.role-user {
    background: #e5e7eb;
    color: #4b5563;
}

/* API Key Status */
.api-key-yes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--dc-blue);
    font-weight: 500;
}

.api-key-yes i {
    font-size: 0.875rem;
}

.api-key-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Delete User Info in Modal */
.delete-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.delete-user-info strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--dc-dark-blue);
}

.delete-user-info span {
    font-size: 0.8125rem;
    color: #6b7280;
}

/* Action Button Variants */
.btn-action-danger {
    color: #ef4444;
    border-color: #fecaca;
}

.btn-action-danger:hover {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

/* ============================================
   Info List Styles (Vertical)
   ============================================ */

.info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-list-item {
    display: flex;
    gap: 12px;
}

.info-list-item > i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dc-blue);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-list-item strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin-bottom: 4px;
}

.info-list-item p {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   Custom Checkbox Styles
   ============================================ */

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.checkbox-container:hover {
    border-color: var(--dc-blue);
    background: #f3f4f6;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    min-width: 20px;
    background-color: white;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.checkbox-container:hover .checkmark {
    border-color: var(--dc-blue);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--dc-blue);
    border-color: var(--dc-blue);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checkbox-label strong {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
}

.checkbox-description {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

/* ============================================
   Toggle Switch Styles
   ============================================ */

.toggle-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.toggle-container:hover {
    border-color: var(--dc-blue);
    background: #f3f4f6;
}

.toggle-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    min-width: 44px;
    background-color: #d1d5db;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-top: 2px;
}

.toggle-switch:after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-container input:checked ~ .toggle-switch {
    background-color: var(--dc-blue);
}

.toggle-container input:checked ~ .toggle-switch:after {
    left: 22px;
}

.toggle-container:hover .toggle-switch {
    background-color: #9ca3af;
}

.toggle-container input:checked:hover ~ .toggle-switch {
    background-color: var(--dc-dark-blue);
}

.toggle-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-label strong {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
}

.toggle-description {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.4;
}

/* Password Fields Container */
.password-fields {
    transition: all 0.3s ease;
}

/* ============================================
   Chat Interface Styles
   ============================================ */

/* Main Layout */
.chat-layout {
    display: flex;
    height: calc(100vh - 180px);
    background: var(--surface, #ffffff);
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Chat Header */
.chat-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    gap: 16px;
    flex-shrink: 0;
}

.chat-title-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.chat-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-title-input {
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid var(--dc-blue);
    padding: 4px 0;
    display: none;
    background: transparent;
    width: 200px;
    color: var(--dc-dark-blue);
}

.chat-title-input:focus {
    outline: none;
}

.chat-title-edit {
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.6875rem;
    opacity: 0;
    transition: opacity 0.15s ease;
    padding: 4px;
}

.chat-title-group:hover .chat-title-edit {
    opacity: 1;
}

.chat-title-edit:hover {
    color: var(--dc-blue);
}

.chat-title-actions {
    display: flex;
    gap: 4px;
}

.chat-header-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.chat-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    font-size: 0.875rem;
}

.chat-icon-btn:hover {
    background: #f3f4f6;
    color: var(--dc-dark-blue);
}

.chat-icon-btn.active {
    color: #f59e0b;
}

.chat-icon-btn.danger:hover {
    color: #dc2626;
}

/* Documents Bar */
.chat-documents-bar {
    padding: 10px 24px;
    background: rgba(223, 202, 156, 0.1);
    border-bottom: 1px solid rgba(223, 202, 156, 0.2);
    flex-shrink: 0;
}

.documents-bar-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.documents-bar-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: #6b7280;
    flex-shrink: 0;
}

.documents-bar-label i {
    color: var(--dc-beige);
}

.documents-bar-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(223, 202, 156, 0.2);
    border: 1px solid rgba(223, 202, 156, 0.3);
    border-radius: 4px;
    font-size: 0.75rem;
    color: #6b7280;
}

.doc-chip i {
    color: var(--dc-beige);
}

.doc-chip small {
    opacity: 0.7;
}

.doc-chip-remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #9ca3af;
    font-size: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-chip-remove:hover {
    color: #dc2626;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px 24px;
}

.chat-messages-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-message {
    max-width: 85%;
    min-width: 0;
    overflow: hidden;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.agent {
    align-self: flex-start;
}

.message-meta {
    font-size: 0.6875rem;
    color: #9ca3af;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-message.user .message-meta {
    justify-content: flex-end;
}

.message-author {
    font-weight: 500;
}

.message-dot {
    opacity: 0.5;
}

.message-bubble {
    border-radius: 12px;
    padding: 14px 18px;
    overflow: hidden;
    max-width: 100%;
    min-width: 0;
}

.chat-message.user .message-bubble {
    background: var(--dc-blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.agent .message-bubble {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.message-content {
    font-size: 0.9375rem;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
}

.message-content p {
    margin: 0 0 10px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content > *:first-child {
    margin-top: 0 !important;
}

.message-content > *:last-child {
    margin-bottom: 0 !important;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 16px 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
}

.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child,
.message-content h4:first-child,
.message-content h5:first-child,
.message-content h6:first-child {
    margin-top: 0;
}

.message-content ul,
.message-content ol {
    margin: 0 0 10px 0;
    padding-left: 20px;
}

.message-content strong {
    font-weight: 600;
}

.message-content code {
    background: rgba(0,0,0,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-family: monospace;
}

.chat-message.user .message-content code {
    background: rgba(255,255,255,0.2);
}

.message-content pre {
    position: relative;
    background: var(--dc-dark-blue);
    color: #e5e7eb;
    padding: 14px;
    padding-top: 36px;
    border-radius: 8px;
    margin: 10px 0;
    overflow-x: auto;
    max-width: 100%;
    font-family: monospace;
    font-size: 0.8125rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-content pre code {
    background: transparent;
    padding: 0;
}

.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    padding: 4px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e5e7eb;
}

.code-copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.code-copy-btn i {
    font-size: 0.6875rem;
}

/* Attached Documents in Messages */
.attached-documents {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(223, 202, 156, 0.2);
    border: 1px solid rgba(223, 202, 156, 0.3);
    border-radius: 4px;
    font-size: 0.75rem;
    color: #6b7280;
}

.chat-message.user .doc-badge {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.9);
}

.doc-badge i {
    color: var(--dc-beige);
}

.chat-message.user .doc-badge i {
    color: rgba(255,255,255,0.7);
}

/* Sources */
.sources-row {
    margin-top: 12px;
    overflow: hidden;
    max-width: 100%;
}

.sources-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sources-trigger:hover {
    border-color: var(--dc-blue);
    color: var(--dc-blue);
}

.sources-trigger i {
    font-size: 0.6875rem;
}

.sources-trigger .arrow {
    font-size: 0.5rem;
    transition: transform 0.2s ease;
}

.sources-trigger.open .arrow {
    transform: rotate(180deg);
}

.sources-expanded {
    display: none;
    margin-top: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.sources-expanded.open {
    display: block;
}

.source-item {
    padding: 10px;
    background: #f8fafc;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    overflow: hidden;
    max-width: 100%;
}

.source-item:last-child {
    margin-bottom: 0;
}

.source-item:hover {
    background: rgba(25, 62, 130, 0.06);
}

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

.source-title {
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #374151;
}

.source-title i {
    color: var(--dc-beige);
}

.source-chevron {
    font-size: 0.6rem;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.source-chevron.rotated {
    transform: rotate(180deg);
}

.source-body {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.8125rem;
    color: #4b5563;
    line-height: 1.6;
    overflow-x: auto;
    max-width: 100%;
}

.source-body.open {
    display: block;
}

.source-body pre,
.source-body code {
    overflow-x: auto;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.source-body pre {
    position: relative;
    background: var(--dc-dark-blue);
    color: #e5e7eb;
    padding: 14px;
    padding-top: 36px;
    border-radius: 8px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 0.8125rem;
}

.source-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.source-link {
    margin-top: 8px;
}

.source-link a {
    color: var(--dc-blue);
    text-decoration: none;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.source-link a:hover {
    text-decoration: underline;
}

/* Typing Indicator */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

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

.typing-dots span {
    width: 5px;
    height: 5px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

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

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

/* Empty State */
.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #9ca3af;
}

.chat-empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--dc-beige);
}

.chat-empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin-bottom: 8px;
}

.chat-empty-state p {
    font-size: 0.875rem;
}

/* Input Area - ChatGPT Style */
.chat-input-area {
    padding: 16px 24px 24px;
    background: white;
    flex-shrink: 0;
}

.pending-files {
    margin-bottom: 12px;
}

.pending-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pending-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(223, 202, 156, 0.2);
    border: 1px solid rgba(223, 202, 156, 0.3);
    border-radius: 4px;
    font-size: 0.75rem;
}

.pending-chip i {
    color: var(--dc-beige);
}

.pending-chip small {
    color: #9ca3af;
}

.pending-remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #9ca3af;
    font-size: 0.625rem;
}

.pending-remove:hover {
    color: #dc2626;
}

/* ChatGPT-style input wrapper */
.chat-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background: #f4f4f4;
    border-radius: 26px;
    padding: 8px;
    min-height: 52px;
    transition: all 0.15s ease;
}

.chat-input-wrapper:focus-within {
    background: #ececec;
}

/* Default single-line: + textarea send in one row */
.chat-input-wrapper:not(.expanded) .chat-textarea {
    order: 2;
}

.chat-input-wrapper:not(.expanded) .chat-attach-btn {
    order: 1;
}

.chat-input-wrapper:not(.expanded) .chat-input-actions {
    order: 3;
}

/* Expanded mode: textarea on top, buttons on bottom */
.chat-input-wrapper.expanded {
    align-items: flex-start;
}

.chat-input-wrapper.expanded .chat-textarea {
    order: 1;
    width: 100%;
    flex: 1 1 100%;
    padding: 4px 8px 12px 8px;
    margin-bottom: 4px;
}

.chat-input-wrapper.expanded .chat-attach-btn {
    order: 2;
}

.chat-input-wrapper.expanded .chat-input-actions {
    order: 3;
    margin-left: auto;
}

/* Input buttons */
.chat-input-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.chat-attach-btn {
    background: transparent;
    color: #6b7280;
}

.chat-attach-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}

.chat-send-btn {
    background: #0f0f0f;
    color: white;
}

.chat-send-btn:hover {
    background: #2d2d2d;
}

.chat-send-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Textarea */
.chat-textarea {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.9375rem;
    resize: none;
    min-height: 36px;
    max-height: 200px;
    line-height: 20px;
    overflow-y: hidden;
    box-sizing: border-box;
}

.chat-textarea:focus {
    outline: none;
}

.chat-textarea::placeholder {
    color: #9ca3af;
}

/* Input actions container */
.chat-input-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Sidebar */
.chat-sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    background: white;
    border-left: 1px solid #e5e7eb;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

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

.sidebar-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* Agent Info in Sidebar */
.agent-info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.agent-avatar-box {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--dc-blue), var(--dc-light-blue));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

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

.agent-details-box h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    margin: 0 0 4px 0;
}

.agent-details-box p {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Documents in Sidebar */
.sidebar-doc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
}

.sidebar-doc-item > i {
    color: var(--dc-blue);
    flex-shrink: 0;
}

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

.sidebar-doc-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dc-dark-blue);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-doc-size {
    font-size: 0.6875rem;
    color: #9ca3af;
}

.sidebar-doc-remove {
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
}

.sidebar-doc-remove:hover {
    color: #dc2626;
}

.sidebar-doc-empty {
    font-size: 0.8125rem;
    color: #9ca3af;
    padding: 12px;
    text-align: center;
}

.add-doc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 1px dashed #e5e7eb;
    border-radius: 6px;
    color: #9ca3af;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s ease;
    background: transparent;
    width: 100%;
}

.add-doc-btn:hover {
    border-color: var(--dc-blue);
    color: var(--dc-blue);
    background: rgba(25, 62, 130, 0.04);
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

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

.toast-error {
    border-left: 4px solid #dc2626;
}

.toast-error i {
    color: #dc2626;
}

.toast-success {
    border-left: 4px solid #059669;
}

.toast-success i {
    color: #059669;
}

.toast span {
    flex: 1;
    font-size: 0.875rem;
    color: var(--dc-dark-blue);
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
}

.toast-close:hover {
    color: var(--dc-dark-blue);
}

/* Responsive Chat */
@media (max-width: 768px) {
    .chat-layout {
        flex-direction: column;
        height: calc(100vh - 140px);
    }

    .chat-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        max-height: 200px;
    }

    .chat-message {
        max-width: 95%;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-messages {
        padding: 20px 16px;
    }

    .chat-input-area {
        padding: 16px;
    }
}

/* ============================================
   DataTables Custom Styling
   ============================================ */

/* Container for DataTables controls */
.datatable-container {
    overflow: visible;
}

/* Header area with search and length controls */
.datatable-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 12px;
}

.datatable-search {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.datatable-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.datatable-search input:focus {
    outline: none;
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(25, 62, 130, 0.1);
}

.datatable-search input::placeholder {
    color: #9ca3af;
}

.datatable-length {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #6b7280;
}

.datatable-length select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.datatable-length select:focus {
    outline: none;
    border-color: var(--dc-blue);
}

/* Agent filter dropdown */
.datatable-filter-agent {
    display: flex;
    align-items: center;
}

.datatable-agent-filter {
    display: flex;
    align-items: center;
}

.datatable-filter-select {
    padding: 10px 36px 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--dc-dark-blue);
    min-width: 160px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.datatable-filter-select:focus {
    outline: none;
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(25, 62, 130, 0.1);
}

/* Filter dropdowns in header */
.datatable-filter-agent,
.datatable-filter-subject,
.datatable-filter-status {
    display: flex;
    align-items: center;
}

/* Footer area with info and pagination */
.datatable-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 12px;
}

.datatable-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.datatable-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* DataTables 2.x paging structure */
.datatable-pagination .dt-paging {
    display: flex;
    align-items: center;
    gap: 4px;
}

.datatable-pagination .dt-paging nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Pagination buttons */
.datatable-pagination button.dt-paging-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: var(--dc-dark-blue);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.datatable-pagination button.dt-paging-button:hover:not(.disabled):not(.current) {
    background: #f3f4f6;
    border-color: var(--dc-blue);
    color: var(--dc-blue);
}

.datatable-pagination button.dt-paging-button.current {
    background: var(--dc-blue);
    border-color: var(--dc-blue);
    color: white;
}

.datatable-pagination button.dt-paging-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Additional selectors for DataTables 2.x compatibility */
.dt-paging {
    display: flex !important;
    align-items: center;
    gap: 4px;
}

.dt-paging nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 4px;
}

.dt-paging button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: var(--dc-dark-blue);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dt-paging button:hover:not(.disabled):not(.current) {
    background: #f3f4f6;
    border-color: var(--dc-blue);
    color: var(--dc-blue);
}

.dt-paging button.current {
    background: var(--dc-blue);
    border-color: var(--dc-blue);
    color: white;
}

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

/* Sorting indicators on table headers */
.documents-table thead th {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.documents-table thead th.dt-orderable-asc::after,
.documents-table thead th.dt-orderable-desc::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    opacity: 0.3;
}

.documents-table thead th.dt-orderable-asc::after {
    border-bottom: 5px solid currentColor;
}

.documents-table thead th.dt-orderable-desc::after {
    border-top: 5px solid currentColor;
}

.documents-table thead th.dt-ordering-asc::after,
.documents-table thead th.dt-ordering-desc::after {
    opacity: 1;
    color: var(--dc-blue);
}

/* Hide default DataTables sorting icons */
.documents-table thead th.dt-orderable-asc .dt-column-order,
.documents-table thead th.dt-orderable-desc .dt-column-order {
    display: none;
}

/* Actions column - no pointer cursor */
.documents-table thead th:last-child {
    cursor: default;
}

.documents-table thead th:last-child::after {
    display: none;
}

/* Ensure proper padding for sortable headers */
.documents-table thead th.dt-orderable-asc,
.documents-table thead th.dt-orderable-desc {
    padding-right: 28px;
}

/* Empty state within DataTables */
.dataTables_empty {
    text-align: center;
    padding: 48px 24px !important;
    color: #6b7280;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .datatable-header,
    .datatable-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .datatable-search {
        max-width: none;
    }

    .datatable-pagination {
        justify-content: center;
    }

    .datatable-info {
        text-align: center;
    }
}

/* ============================================
   RAG Analytics Dashboard Styles
   ============================================ */


/* RAG Analytics Specific Styles */
.retrieval-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.retrieval-count strong {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dc-dark-blue);
}

.retrieval-count .text-muted {
    font-size: 0.75rem;
    color: #9ca3af;
}

.chunk-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.chunk-stats strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
}

.chunk-stats .text-muted {
    font-size: 0.75rem;
    color: #9ca3af;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dc-blue), var(--dc-light-blue));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dc-dark-blue);
    min-width: 35px;
    text-align: right;
}

.rank-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--dc-dark-blue);
}

.rank-badge i.fas.fa-medal {
    font-size: 1rem;
}

.document-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.document-cell strong {
    font-size: 0.9375rem;
    color: var(--dc-dark-blue);
}

.document-cell .text-muted {
    font-size: 0.75rem;
    color: #9ca3af;
}

.chunk-preview {
    max-width: 350px;
    overflow: visible;
    font-size: 0.875rem;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chunk-preview-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    display: inline-block;
}

.chunk-toggle-btn {
    min-width: 80px;
    flex-shrink: 0;
}

.btn-action-primary {
    color: var(--dc-blue);
    border: 1px solid transparent;
}

.btn-action-primary:hover {
    background: rgba(25, 62, 130, 0.1);
    color: var(--dc-dark-blue);
}

/* ============================================
   RAG Analytics Table Styling
   ============================================ */

/* Table styling improvements for RAG Analytics */
.documents-table-container .documents-table {
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0;
}

.documents-table-container .documents-table th {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: var(--dc-dark-blue);
    padding: 12px 16px;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.documents-table-container .documents-table td {
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 16px;
    vertical-align: middle;
}

.documents-table-container .documents-table tbody tr:hover {
    background: #f8fafc;
}

.documents-table-container .documents-table tbody tr:last-child td {
    border-bottom: none;
}

/* Chunk content toggle styling */
.chunk-preview {
    position: relative;
}

.chunk-content-container {
    flex: 1;
    min-width: 0;
}

.chunk-full-text {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.chunk-text-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.btn-link {
    background: none;
    border: none;
    color: var(--dc-blue);
    cursor: pointer;
    font-size: 0.8125rem;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.btn-link:hover {
    background: rgba(25, 62, 130, 0.1);
    color: var(--dc-dark-blue);
    text-decoration: none;
}

.btn-link i {
    font-size: 0.75rem;
}

/* Chunk info styling */
.chunk-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chunk-info strong {
    font-size: 0.875rem;
    color: var(--dc-dark-blue);
}

.chunk-section {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}

.chunk-info .text-muted {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Subject filter bar styling */
.subject-filter-bar {
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 24px;
}

.filter-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-content i {
    color: var(--dc-blue);
    font-size: 0.875rem;
}

.filter-content label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dc-dark-blue);
    margin: 0;
    white-space: nowrap;
}

.filter-content .form-select {
    min-width: 200px;
    max-width: 300px;
}

.filter-content .btn {
    margin-left: 8px;
}

@media (max-width: 768px) {
    .filter-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filter-content .form-select {
        width: 100%;
        max-width: none;
    }
}

/* ============================================
   Custom Table Controls Styling
   ============================================ */

/* Table controls header */
.table-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 12px;
}

.table-length-control,
.table-search-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-length-control label,
.table-search-control label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dc-dark-blue);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.items-per-page-select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 28px 6px 10px;
    font-size: 0.875rem;
    background: white url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%234b5563' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 8px center;
    background-size: 12px 8px;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 70px;
}

.table-search-input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 200px;
}

.items-per-page-select:focus,
.table-search-input:focus {
    outline: none;
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(25, 62, 130, 0.15);
}

.table-search-input::placeholder {
    color: #9ca3af;
}

/* Table controls footer */
.table-controls-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 12px;
}

.table-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    margin: 0 2px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: var(--dc-dark-blue);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
}

.pagination-btn:hover:not(.disabled) {
    background: #f3f4f6;
    border-color: var(--dc-blue);
    color: var(--dc-blue);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-btn.current {
    background: var(--dc-blue);
    border-color: var(--dc-blue);
    color: white;
    box-shadow: 0 2px 4px rgba(25, 62, 130, 0.3);
}

.pagination-btn.disabled {
    color: #9ca3af;
    background: #f9fafb;
    border-color: #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-btn.disabled:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #9ca3af;
    transform: none;
    box-shadow: none;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Responsive table controls */
@media (max-width: 768px) {
    .table-controls-header,
    .table-controls-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .table-length-control label,
    .table-search-control label {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }
    
    .table-search-input {
        width: 100%;
        max-width: none;
        min-width: 0;
    }
    
    .table-pagination {
        justify-content: center;
    }
    
    .table-info {
        text-align: center;
    }
    
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.8125rem;
    }
}

/* ============================================
   Dashboard Section Title Styling
   ============================================ */

.dashboard-section-title {
    padding: 8px 0 6px 0;
    margin: 0;
    line-height: 1.2;
}


/* RAG Analytics table column widths */
.rag-analytics-page .documents-table th:nth-child(3),
.rag-analytics-page .documents-table td:nth-child(3) {
    width: 400px;
    min-width: 400px;
}