/**
 * Clark Chatbot Stylesheet
 * Pro Funding Options
 * Modern white and blue design
 */

/* ===== CSS Variables ===== */
:root {
    --color-primary: #2563EB;
    --color-primary-hover: #1d4ed8;
    --color-secondary: #6b7280;
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-success: #16a34a;
    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-gray-800);
    background-color: var(--color-gray-50);
}

/* ===== Button Styles ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

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

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

.btn-secondary {
    background-color: var(--color-gray-200);
    color: var(--color-gray-700);
}

.btn-secondary:hover {
    background-color: var(--color-gray-300);
}

.btn-danger {
    background-color: var(--color-danger);
    color: var(--color-white);
}

.btn-danger:hover {
    background-color: var(--color-danger-hover);
}

.btn-success {
    background-color: #16a34a;
    color: var(--color-white);
}

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

.btn-block {
    width: 100%;
}

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

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

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--color-gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    background-color: var(--color-white);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ===== Alert Styles ===== */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    font-size: 14px;
}

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

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

/* ===== Login Page ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-primary) 0%, #1d4ed8 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--color-gray-700);
}

.login-form .btn {
    margin-top: 10px;
}

/* ===== Admin Panel ===== */
.admin-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--color-gray-50);
}

.admin-sidebar {
    width: 250px;
    background-color: var(--color-white);
    border-right: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
}

.admin-logo {
    padding: 24px;
    border-bottom: 1px solid var(--color-gray-200);
}

.admin-logo h2 {
    font-size: 24px;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.admin-logo p {
    font-size: 12px;
    color: var(--color-gray-700);
}

.admin-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--color-gray-700);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: var(--color-gray-50);
    color: var(--color-primary);
}

.nav-item.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
    border-right: 3px solid var(--color-primary);
}

.nav-icon {
    font-size: 18px;
}

.admin-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

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

.admin-header h1 {
    font-size: 28px;
    color: var(--color-gray-900);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ===== Card Styles ===== */
.card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-gray-200);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-gray-900);
}

.card-body {
    padding: 24px;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--color-gray-700);
}

/* ===== Table Styles ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--color-gray-50);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--color-gray-700);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px;
    border-top: 1px solid var(--color-gray-200);
}

.data-table td.actions {
    display: flex;
    gap: 8px;
}

/* ===== Badge Styles ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
}

.badge-admin {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
}

.badge-user {
    background-color: var(--color-gray-200);
    color: var(--color-gray-700);
}

/* ===== Chat Interface ===== */
.chat-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.chat-sidebar {
    width: 300px;
    background-color: var(--color-white);
    border-right: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-gray-200);
}

.logo {
    text-align: center;
    margin-bottom: 16px;
}

.logo h2 {
    font-size: 24px;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.logo p {
    font-size: 12px;
    color: var(--color-gray-700);
}

.threads-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.thread-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.thread-item:hover {
    background-color: var(--color-gray-50);
}

.thread-item.active {
    background-color: rgba(37, 99, 235, 0.1);
    border-color: var(--color-primary);
}

.thread-title {
    font-weight: 500;
    color: var(--color-gray-900);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-date {
    font-size: 12px;
    color: var(--color-gray-700);
}

.no-threads {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-gray-700);
}

.no-threads p {
    margin-bottom: 8px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--color-gray-200);
}

.user-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.user-name {
    font-weight: 600;
    color: var(--color-gray-900);
}

.user-role {
    font-size: 12px;
    color: var(--color-gray-700);
}

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

/* ===== Chat Main Area ===== */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--color-white);
}

.chat-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-gray-900);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.message-avatar {
    flex-shrink: 0;
}

.avatar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-gray-100);
    font-size: 20px;
}

.message-user .avatar-icon {
    background-color: var(--color-gray-200);
}

.message-assistant .avatar-icon {
    background-color: rgba(37, 99, 235, 0.1);
}

.message-content {
    flex: 1;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.message-author {
    font-weight: 600;
    color: var(--color-gray-900);
}

.message-time {
    font-size: 12px;
    color: var(--color-gray-700);
}

.message-text {
    color: var(--color-gray-800);
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ===== Rich Content Formatting ===== */

/* Headers */
.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4,
.message-text h5,
.message-text h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-gray-900);
}

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

.message-text h1 {
    font-size: 24px;
    border-bottom: 2px solid var(--color-gray-200);
    padding-bottom: 0.5em;
}

.message-text h2 {
    font-size: 20px;
    border-bottom: 1px solid var(--color-gray-200);
    padding-bottom: 0.4em;
}

.message-text h3 {
    font-size: 18px;
}

.message-text h4 {
    font-size: 16px;
}

.message-text h5 {
    font-size: 14px;
}

.message-text h6 {
    font-size: 13px;
    color: var(--color-gray-700);
}

/* Paragraphs */
.message-text p {
    margin-bottom: 1em;
}

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

/* Lists */
.message-text ul,
.message-text ol {
    margin: 1em 0;
    padding-left: 2em;
}

.message-text ul {
    list-style-type: disc;
}

.message-text ol {
    list-style-type: decimal;
}

.message-text li {
    margin: 0.5em 0;
    line-height: 1.6;
}

.message-text li > ul,
.message-text li > ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Nested lists */
.message-text ul ul {
    list-style-type: circle;
}

.message-text ul ul ul {
    list-style-type: square;
}

/* Tables */
.message-text table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
    background-color: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: block;
    overflow-x: auto;
}

.message-text table tbody,
.message-text table thead {
    display: table;
    width: 100%;
}

.message-text table thead {
    background-color: var(--color-gray-50);
}

.message-text table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--color-gray-900);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-gray-300);
}

.message-text table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-gray-200);
    color: var(--color-gray-800);
}

.message-text table tr:last-child td {
    border-bottom: none;
}

.message-text table tbody tr:hover {
    background-color: var(--color-gray-50);
}

/* Striped tables */
.message-text table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.01);
}

/* Code Blocks */
.message-text pre {
    background-color: #2d2d2d;
    border-radius: var(--radius);
    padding: 16px;
    margin: 1em 0;
    overflow-x: auto;
    border: 1px solid var(--color-gray-700);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.message-text pre:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #f8f8f2;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

.code-copy-btn:active {
    background-color: rgba(255, 255, 255, 0.3);
}

.message-text pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    color: #f8f8f2;
    font-size: 13px;
    line-height: 1.5;
    display: block;
}

/* Inline Code */
.message-text code {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 500;
}

.message-text pre code {
    font-weight: normal;
}

/* Blockquotes */
.message-text blockquote {
    border-left: 4px solid var(--color-primary);
    margin: 1.5em 0;
    padding: 12px 20px;
    background-color: rgba(37, 99, 235, 0.05);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--color-gray-700);
}

.message-text blockquote p {
    margin: 0;
}

.message-text blockquote > *:first-child {
    margin-top: 0;
}

.message-text blockquote > *:last-child {
    margin-bottom: 0;
}

/* Horizontal Rule */
.message-text hr {
    border: none;
    border-top: 2px solid var(--color-gray-200);
    margin: 2em 0;
}

/* Links */
.message-text a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.message-text a:hover {
    border-bottom-color: var(--color-primary);
}

/* Strong and Em */
.message-text strong {
    font-weight: 600;
    color: var(--color-gray-900);
}

.message-text em {
    font-style: italic;
}

/* Images */
.message-text img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1em 0;
    box-shadow: var(--shadow-sm);
}

/* Task Lists */
.message-text input[type="checkbox"] {
    margin-right: 8px;
}

.message-text .task-list-item {
    list-style-type: none;
    margin-left: -2em;
    padding-left: 2em;
}

/* Definition Lists */
.message-text dl {
    margin: 1em 0;
}

.message-text dt {
    font-weight: 600;
    color: var(--color-gray-900);
    margin-top: 1em;
}

.message-text dt:first-child {
    margin-top: 0;
}

.message-text dd {
    margin-left: 2em;
    margin-top: 0.5em;
    color: var(--color-gray-700);
}

/* Keyboard Keys */
.message-text kbd {
    background-color: var(--color-gray-100);
    border: 1px solid var(--color-gray-300);
    border-radius: 3px;
    box-shadow: 0 1px 0 var(--color-gray-300);
    color: var(--color-gray-900);
    font-size: 12px;
    padding: 2px 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Mark/Highlight */
.message-text mark {
    background-color: #fff59d;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Abbreviations */
.message-text abbr {
    text-decoration: underline dotted;
    cursor: help;
}

/* Small text */
.message-text small {
    font-size: 85%;
    color: var(--color-gray-700);
}

/* Subscript and Superscript */
.message-text sub,
.message-text sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.message-text sup {
    top: -0.5em;
}

.message-text sub {
    bottom: -0.25em;
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-gray-700);
}

.welcome-message h2 {
    font-size: 24px;
    color: var(--color-gray-900);
    margin-bottom: 16px;
}

.welcome-message p {
    margin-bottom: 8px;
    font-size: 16px;
}

.chat-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    text-align: center;
    padding: 40px;
}

.empty-state h2 {
    font-size: 32px;
    color: var(--color-gray-900);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
    color: var(--color-gray-700);
    margin-bottom: 8px;
}

.chat-input-container {
    padding: 20px 30px;
    border-top: 1px solid var(--color-gray-200);
    background-color: var(--color-white);
}

.chat-input-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.btn-icon {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 20px;
    flex-shrink: 0;
}

.chat-input-form textarea {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    resize: none;
    min-height: 44px;
    max-height: 150px;
    transition: border-color 0.2s;
}

.chat-input-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chat-input-form .btn {
    min-width: 80px;
}

/* ===== Loader ===== */
.loader {
    border: 2px solid var(--color-white);
    border-top: 2px solid transparent;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Typing Indicator ===== */
.typing-indicator {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease-in;
}

.typing-indicator .message-content {
    background-color: var(--color-gray-100);
    padding: 12px 16px;
    border-radius: var(--radius);
}

.typing-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 24px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background-color: var(--color-gray-700);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

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

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background-color: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
}

.toast.toast-error {
    border-left: 4px solid var(--color-danger);
}

.toast.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast.toast-info {
    border-left: 4px solid var(--color-primary);
}

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

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--color-gray-700);
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-gray-700);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.toast-close:hover {
    background-color: var(--color-gray-100);
}

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

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

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

/* ===== Message Animations ===== */
.message {
    animation: fadeIn 0.3s ease-out;
}

/* ===== Error Message in Chat ===== */
.message-error {
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 8px;
}

.message-error-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.message-error-icon {
    color: var(--color-danger);
    font-size: 18px;
    flex-shrink: 0;
}

.message-error-text {
    flex: 1;
    color: #991b1b;
    font-size: 13px;
}

.message-retry {
    margin-top: 8px;
}

.btn-retry {
    font-size: 12px;
    padding: 6px 12px;
    background-color: var(--color-danger);
    color: var(--color-white);
}

.btn-retry:hover {
    background-color: var(--color-danger-hover);
}

/* ===== Input Disabled State ===== */
.chat-input-form textarea:disabled {
    background-color: var(--color-gray-100);
    cursor: not-allowed;
    opacity: 0.7;
}

.chat-input-form .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Status Indicator ===== */
.chat-status {
    padding: 8px 30px;
    background-color: rgba(37, 99, 235, 0.05);
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
    font-size: 12px;
    color: var(--color-primary);
    display: none;
    align-items: center;
    gap: 8px;
}

.chat-status.active {
    display: flex;
}

/* ===== OCR Status ===== */
.ocr-status {
    padding: 8px 12px;
    margin-top: 8px;
    background-color: rgba(37, 99, 235, 0.1);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--color-primary);
    display: none;
}

.ocr-status.show {
    display: block;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .chat-container {
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Toast notifications for mobile */
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
    
    /* Chat messages for mobile */
    .chat-messages {
        padding: 15px;
    }
    
    .message {
        margin-bottom: 16px;
    }
    
    .avatar-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .chat-input-container {
        padding: 15px;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .chat-header h3 {
        font-size: 16px;
    }
    
    .welcome-message {
        padding: 40px 15px;
    }
    
    .welcome-message h2 {
        font-size: 20px;
    }
    
    .welcome-message p {
        font-size: 14px;
    }
    
    /* Markdown content adjustments for mobile */
    .message-text h1 {
        font-size: 20px;
    }
    
    .message-text h2 {
        font-size: 18px;
    }
    
    .message-text h3 {
        font-size: 16px;
    }
    
    .message-text table {
        font-size: 12px;
    }
    
    .message-text table th,
    .message-text table td {
        padding: 8px 10px;
    }
    
    .message-text pre {
        padding: 12px;
        font-size: 12px;
    }
    
    .message-text code {
        font-size: 12px;
    }
}

/* ===== Scrollbar Styles ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-700);
}

/* ===== Document Clusters Sidebar ===== */
.clusters-sidebar {
    width: 350px;
    background-color: var(--color-white);
    border-left: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.clusters-sidebar.hidden {
    transform: translateX(350px);
}

.clusters-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clusters-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.clusters-search {
    padding: 10px 20px;
    border-bottom: 1px solid var(--color-gray-200);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.clusters-search .form-input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    font-size: 13px;
    border: 1px solid var(--color-gray-300);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.clusters-search .form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-clear-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--color-gray-500);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-clear-btn:hover {
    background: var(--color-gray-200);
    color: var(--color-gray-700);
}

.clusters-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.clusters-list .no-results-message {
    padding: 20px 10px;
}

.clusters-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-gray-700);
}

.cluster-item {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.cluster-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.cluster-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.cluster-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cluster-name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.cluster-description {
    font-size: 12px;
    color: var(--color-gray-700);
    margin-bottom: 8px;
}

.cluster-stats {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--color-gray-700);
}

.cluster-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cluster-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.cluster-actions .btn-danger,
.cluster-actions .btn-success {
    padding: 6px 10px;
    min-width: auto;
}

/* Cluster Processing Indicator */
.cluster-processing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #f59e0b;
    margin-top: 8px;
    padding: 6px 10px;
    background: #fef3c7;
    border-radius: 6px;
    border: 1px solid #fbbf24;
}

.cluster-processing-indicator .processing-spinner {
    display: inline-block;
    animation: spin 2s linear infinite;
}

.cluster-processing-indicator span:not(.processing-spinner) {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Cluster Progress Steps */
.progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #e5e7eb;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.progress-step.completed {
    background: #d1fae5;
    border-left-color: #16a34a;
}

.progress-step .step-icon {
    font-size: 16px;
    min-width: 20px;
    text-align: center;
}

.progress-step.active .step-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

.progress-step .step-text {
    font-size: 13px;
    color: #6b7280;
}

.progress-step.active .step-text {
    color: #f59e0b;
    font-weight: 500;
}

.progress-step.completed .step-text {
    color: #16a34a;
    font-weight: 500;
}

/* Upload Progress Items */
.upload-progress-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    transition: all 0.3s ease;
}

.upload-progress-item.processing {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.upload-progress-item.completed {
    background: #d1fae5;
    border-left-color: #16a34a;
}

.upload-progress-item.failed {
    background: #fee2e2;
    border-left-color: #dc2626;
}

.upload-progress-item .progress-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}

.upload-progress-item.processing .progress-icon {
    animation: pulse 1.5s ease-in-out infinite;
}

.upload-progress-item .progress-filename {
    flex: 1;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress-item .progress-status {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.upload-progress-item.processing .progress-status {
    color: #f59e0b;
}

.upload-progress-item.completed .progress-status {
    color: #16a34a;
}

.upload-progress-item.failed .progress-status {
    color: #dc2626;
}

.clusters-footer {
    padding: 15px;
    border-top: 1px solid var(--color-gray-200);
}

/* ===== Modal Styles ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-gray-700);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: var(--color-gray-100);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--color-gray-800);
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input[type="color"] {
    height: 44px;
    padding: 4px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-gray-700);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: var(--color-primary);
    background-color: rgba(37, 99, 235, 0.05);
}

.radio-label input[type="radio"] {
    margin: 0;
}

.radio-label span {
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

/* ===== Tabs ===== */
.cluster-tabs,
.analysis-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-gray-200);
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-gray-700);
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--color-primary);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

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

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

/* ===== Documents List ===== */
.documents-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.document-item {
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius);
    padding: 15px;
}

.document-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.document-icon {
    font-size: 20px;
}

.document-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.document-type {
    font-size: 12px;
    padding: 4px 8px;
    background-color: var(--color-gray-200);
    border-radius: var(--radius-sm);
}

.document-type.bank-statement {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
}

.document-info {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: var(--color-gray-700);
    margin-bottom: 10px;
}

.document-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.document-status.analyzed {
    background-color: rgba(22, 163, 74, 0.1);
    color: var(--color-success);
}

.document-status.pending {
    background-color: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.document-status.processing {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
}

.document-status.failed {
    background-color: rgba(220, 38, 38, 0.1);
    color: var(--color-danger);
}

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

/* ===== Notes List ===== */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-item {
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius);
    padding: 15px;
}

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

.note-title {
    font-weight: 600;
    font-size: 14px;
}

.note-date {
    font-size: 12px;
    color: var(--color-gray-700);
}

.note-content {
    font-size: 14px;
    color: var(--color-gray-800);
    white-space: pre-wrap;
    margin-bottom: 10px;
    line-height: 1.8;
}

/* AI Underwriting Note Formatting */
.note-content h1,
.note-content h2,
.note-content h3 {
    color: var(--color-primary);
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.note-content h1 {
    font-size: 20px;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 8px;
}

.note-content h2 {
    font-size: 18px;
    border-bottom: 1px solid var(--color-gray-200);
    padding-bottom: 6px;
}

.note-content h3 {
    font-size: 16px;
}

.note-content strong,
.note-content b {
    color: var(--color-gray-900);
    font-weight: 600;
}

.note-content ul,
.note-content ol {
    margin-left: 20px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.note-content li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.note-content p {
    margin-bottom: 12px;
}

.note-content code {
    background: var(--color-gray-100);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.note-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 15px;
    margin: 15px 0;
    color: var(--color-gray-700);
    font-style: italic;
}

/* Highlight sections in AI notes */
.note-content .section-header {
    background: var(--color-gray-100);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 10px;
}

/* AI Note specific styling */
.note-content.ai-note {
    background: linear-gradient(to bottom, #f0f9ff 0%, #ffffff 100%);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    padding: 20px;
}

.note-content.ai-note h3 {
    background: var(--color-gray-100);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--color-primary);
}

.note-content.ai-note h3:first-child {
    margin-top: 0;
}

/* Number formatting in AI notes */
.note-content.ai-note li {
    padding-left: 5px;
}

/* Spacing for AI note sections */
.note-content.ai-note > p:first-of-type {
    font-style: italic;
    color: var(--color-gray-700);
    border-bottom: 1px solid var(--color-gray-200);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

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

/* ===== Analysis View ===== */
.analysis-info {
    display: flex;
    gap: 20px;
    padding: 15px;
    background: var(--color-gray-50);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

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

.info-label {
    font-size: 12px;
    color: var(--color-gray-700);
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-gray-900);
}

.analysis-text {
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius);
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.analysis-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.field-item {
    display: flex;
    padding: 12px;
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius);
}

.field-label {
    font-weight: 600;
    min-width: 150px;
    color: var(--color-gray-700);
}

.field-value {
    flex: 1;
    color: var(--color-gray-900);
}

.analysis-tables {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.analysis-table {
    overflow-x: auto;
}

.analysis-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.analysis-table th,
.analysis-table td {
    padding: 10px;
    border: 1px solid var(--color-gray-300);
    text-align: left;
}

.analysis-table th {
    background-color: var(--color-gray-100);
    font-weight: 600;
}

/* ===== Loading States ===== */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-gray-700);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-gray-700);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

/* ===== Responsive Design for Clusters ===== */
@media (max-width: 1200px) {
    .clusters-sidebar {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .clusters-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        z-index: 999;
        transform: translateX(100%);
    }
    
    .clusters-sidebar.visible {
        transform: translateX(0);
    }
    
    .modal-content {
        max-width: 95%;
    }
    
    .modal-content.modal-large {
        max-width: 95%;
    }
}

/* ===== Utility Classes ===== */
.btn-icon {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 20px;
    flex-shrink: 0;
}

.text-muted {
    color: var(--color-gray-700);
}

.text-small {
    font-size: 12px;
}

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

.mb-10 {
    margin-bottom: 10px;
}

/* ===== Attached Clusters Display ===== */
.attached-clusters-display {
    padding: 10px 15px;
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-200);
    border-radius: var(--radius) var(--radius) 0 0;
}

.attached-clusters-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 8px;
}

.attached-clusters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attached-cluster-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--color-gray-300);
    border-radius: 20px;
    font-size: 13px;
    color: var(--color-gray-800);
    transition: all 0.2s;
}

.attached-cluster-tag:hover {
    border-color: var(--color-primary);
    background: var(--color-gray-50);
}

.attached-cluster-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.attached-cluster-name {
    font-weight: 500;
}

.attached-cluster-remove {
    background: none;
    border: none;
    color: var(--color-gray-500);
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s;
}

.attached-cluster-remove:hover {
    color: var(--color-danger);
}

/* ===== Attach Cluster Modal ===== */
.attach-cluster-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.attach-cluster-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: white;
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.attach-cluster-item:hover {
    border-color: var(--color-primary);
    background: var(--color-gray-50);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.attach-cluster-item.attached {
    border-color: var(--color-success);
    background: #f0fdf4;
}

.attach-cluster-item.selected {
    border-color: var(--color-primary);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.attach-cluster-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.attach-cluster-color-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.attach-cluster-details {
    flex: 1;
}

.attach-cluster-name {
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 4px;
}

.attach-cluster-description {
    font-size: 12px;
    color: var(--color-gray-600);
    margin-bottom: 4px;
}

.attach-cluster-stats {
    display: flex;
    gap: 15px;
    font-size: 11px;
    color: var(--color-gray-500);
}

.attach-cluster-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.attach-cluster-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--color-success);
    color: white;
}

.modal-description {
    font-size: 14px;
    color: var(--color-gray-600);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ===== Content Filter Section ===== */
.content-filter-section {
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 20px;
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-gray-900);
    margin-bottom: 12px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.filter-checkbox:hover {
    border-color: var(--color-primary);
    background: var(--color-gray-50);
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.filter-icon {
    font-size: 18px;
}

.filter-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-gray-800);
}

.filter-hint {
    font-size: 12px;
    color: var(--color-gray-600);
    margin: 0;
    padding: 8px 10px;
    background: white;
    border-radius: var(--radius-sm);
}

/* ===== Document Status Animations ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

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

.document-status.processing {
    color: var(--color-primary);
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
}

.document-status.completed {
    color: var(--color-success);
    font-weight: 600;
}

.document-status.failed {
    color: var(--color-danger);
    font-weight: 600;
}

.document-status.pending {
    color: var(--color-gray-600);
}

