/* =====================================================
   CREDBRAIN-AI WORK QUEUE
===================================================== */

.nav-count {
    margin-left: auto;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.1);
    color: #dbe8fb;
    font-size: 10px;
    font-weight: 800;
}

.work-queue-view {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px;
    background:
        radial-gradient(circle at 30% 0%, rgba(53, 111, 231, 0.07), transparent 30%),
        #f5f8fc;
}

.work-queue-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.work-queue-heading-left {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.back-to-chat-button,
.refresh-queue-button,
.clear-filter-button,
.open-queue-chat-button {
    border: 1px solid #d8e2ef;
    background: #ffffff;
    color: #36516f;
    cursor: pointer;
    transition: 0.18s ease;
}

.back-to-chat-button:hover,
.refresh-queue-button:hover,
.clear-filter-button:hover,
.open-queue-chat-button:hover {
    border-color: #9fbae2;
    color: #1e5fcd;
    transform: translateY(-1px);
}

.back-to-chat-button {
    min-height: 38px;
    padding: 0 13px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
}

.queue-eyebrow {
    margin-bottom: 5px;
    color: #2367e8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.work-queue-heading h3 {
    color: #17243a;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.045em;
}

.work-queue-heading-left > div > p:last-child {
    max-width: 620px;
    margin-top: 7px;
    color: #718097;
    font-size: 12px;
    line-height: 1.55;
}

.work-queue-heading-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.queue-updated-at {
    color: #8997aa;
    font-size: 10px;
    white-space: nowrap;
}

.refresh-queue-button {
    min-height: 39px;
    padding: 0 14px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 750;
}

.refresh-queue-button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.refresh-queue-button.is-loading > span:first-child {
    animation: queue-spin 0.8s linear infinite;
}

.queue-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(145px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.queue-summary-card {
    min-height: 112px;
    padding: 16px;
    border: 1px solid #dfe7f0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 25px rgba(15, 32, 56, 0.04);
    display: flex;
    align-items: center;
    gap: 13px;
}

.queue-summary-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: #e9f1ff;
    color: #2367e8;
    font-size: 16px;
    font-weight: 850;
}

.overdue-card .queue-summary-icon {
    background: #feecec;
    color: #d84949;
}

.due-today-card .queue-summary-icon {
    background: #fff3d9;
    color: #a96609;
}

.unscheduled-card .queue-summary-icon {
    background: #f1ecff;
    color: #6a49bd;
}

.upcoming-card .queue-summary-icon {
    background: #e6f7ee;
    color: #21845a;
}

.queue-summary-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.queue-summary-copy > span {
    color: #718097;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.queue-summary-copy strong {
    color: #17243a;
    font-size: 26px;
    line-height: 1.1;
}

.queue-summary-copy small {
    color: #909daf;
    font-size: 8px;
    line-height: 1.4;
}

.queue-toolbar {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid #dfe7f0;
    border-radius: 15px;
    background: #ffffff;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.queue-toolbar-left {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(240px, 1.35fr) minmax(170px, 0.8fr) minmax(170px, 0.8fr);
    gap: 12px;
}

.queue-filter-field {
    display: grid;
    gap: 6px;
}

.queue-filter-field > span {
    color: #718097;
    font-size: 9px;
    font-weight: 750;
}

.queue-filter-field input,
.queue-filter-field select {
    width: 100%;
    height: 39px;
    padding: 0 11px;
    border: 1px solid #d8e2ef;
    border-radius: 10px;
    outline: none;
    background: #f9fbfd;
    color: #25334a;
    font-size: 11px;
}

.queue-filter-field input:focus,
.queue-filter-field select:focus {
    border-color: #6f9eea;
    box-shadow: 0 0 0 3px rgba(35, 103, 232, 0.1);
    background: #ffffff;
}

.queue-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.queue-item-count {
    color: #7c8a9d;
    font-size: 10px;
    white-space: nowrap;
}

.clear-filter-button {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.queue-table-card {
    min-height: 260px;
    border: 1px solid #dfe7f0;
    border-radius: 17px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 32, 56, 0.045);
}

.queue-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.queue-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
}

.queue-table thead {
    background: #f7f9fc;
}

.queue-table th {
    padding: 13px 14px;
    border-bottom: 1px solid #dfe7f0;
    color: #7c899c;
    text-align: left;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.queue-table td {
    padding: 14px;
    border-bottom: 1px solid #edf1f6;
    color: #26354c;
    vertical-align: middle;
    font-size: 10px;
}

.queue-table tbody tr:last-child td {
    border-bottom: 0;
}

.queue-table tbody tr:hover {
    background: #fafcff;
}

.queue-actions-heading,
.queue-row-actions {
    text-align: right !important;
}

.queue-provider-cell,
.queue-payer-cell,
.queue-follow-up-cell,
.queue-action-copy {
    display: grid;
    gap: 4px;
}

.queue-provider-cell strong,
.queue-payer-cell strong,
.queue-follow-up-cell strong,
.queue-action-copy strong {
    color: #26354c;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
}

.queue-provider-cell small,
.queue-payer-cell small,
.queue-follow-up-cell small,
.queue-action-copy small {
    color: #8997aa;
    font-size: 8px;
    line-height: 1.4;
}

.queue-action-copy {
    max-width: 245px;
}

.queue-attention-badge,
.queue-record-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
    white-space: nowrap;
}

.queue-badge-overdue {
    background: #feeaea;
    color: #b93636;
}

.queue-badge-due-today {
    background: #fff1d5;
    color: #986005;
}

.queue-badge-unscheduled {
    background: #f0ebff;
    color: #6747b1;
}

.queue-badge-upcoming {
    background: #e6f6ed;
    color: #23744e;
}

.queue-record-status {
    background: #e9f1ff;
    color: #315f9d;
}

.open-queue-chat-button {
    min-height: 32px;
    padding: 0 11px;
    border-radius: 9px;
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
}

.queue-state-message {
    min-height: 260px;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #7b899c;
    text-align: center;
    font-size: 11px;
}

.queue-error-state {
    color: #a23e3e;
    background: #fff9f9;
}

.queue-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #dce6f4;
    border-top-color: #2367e8;
    border-radius: 50%;
    animation: queue-spin 0.8s linear infinite;
}

@keyframes queue-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dark appearance */

body.dark-mode .work-queue-view {
    background: #0f1a2b;
}

body.dark-mode .work-queue-heading h3,
body.dark-mode .queue-summary-copy strong,
body.dark-mode .queue-provider-cell strong,
body.dark-mode .queue-payer-cell strong,
body.dark-mode .queue-follow-up-cell strong,
body.dark-mode .queue-action-copy strong {
    color: #edf4ff;
}

body.dark-mode .queue-summary-card,
body.dark-mode .queue-toolbar,
body.dark-mode .queue-table-card,
body.dark-mode .back-to-chat-button,
body.dark-mode .refresh-queue-button,
body.dark-mode .clear-filter-button,
body.dark-mode .open-queue-chat-button {
    border-color: #263850;
    background: #162339;
    color: #c8d6ea;
}

body.dark-mode .queue-filter-field input,
body.dark-mode .queue-filter-field select,
body.dark-mode .queue-table thead {
    border-color: #2b3c55;
    background: #111e31;
    color: #d8e3f3;
}

body.dark-mode .queue-table th,
body.dark-mode .queue-table td {
    border-color: #25364d;
}

body.dark-mode .queue-table tbody tr:hover {
    background: #192943;
}

body.dark-mode .queue-record-status {
    background: #203a61;
    color: #a9c8fb;
}

/* Responsive */

@media (max-width: 1280px) {
    .queue-summary-grid {
        grid-template-columns: repeat(3, minmax(155px, 1fr));
    }
}

@media (max-width: 900px) {
    .work-queue-view {
        padding: 18px;
    }

    .work-queue-heading,
    .queue-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .work-queue-heading-actions,
    .queue-toolbar-right {
        justify-content: space-between;
    }

    .queue-toolbar-left {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .work-queue-view {
        padding: 14px;
    }

    .work-queue-heading-left {
        flex-direction: column;
    }

    .work-queue-heading h3 {
        font-size: 24px;
    }

    .queue-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .queue-summary-card {
        min-height: 102px;
        padding: 13px;
    }

    .work-queue-heading-actions {
        align-items: stretch;
        flex-direction: column;
    }
}


/* =====================================================
   CREDBRAIN-AI V1 — PREMIUM WORK QUEUE LIGHT THEME
   ===================================================== */

body:not(.dark-mode) .work-queue-view {
    background:
        radial-gradient(circle at 72% 0%, rgba(42, 103, 216, .055), transparent 28%),
        #e9edf3;
}

body:not(.dark-mode) .work-queue-heading h3,
body:not(.dark-mode) .queue-summary-copy strong {
    color: #111d35;
}

body:not(.dark-mode) .queue-summary-card,
body:not(.dark-mode) .queue-toolbar,
body:not(.dark-mode) .queue-table-card {
    border-color: #dce3ea;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(16, 33, 58, .04);
}

body:not(.dark-mode) .queue-filter-field input,
body:not(.dark-mode) .queue-filter-field select {
    border-color: #dbe2e9;
    background: #f5f7fa;
}

body:not(.dark-mode) .queue-table thead {
    background: #f2f5f8;
}

body:not(.dark-mode) .queue-table th {
    color: #64748b;
    border-bottom-color: #dde4eb;
}

body:not(.dark-mode) .queue-table td {
    color: #26354b;
    border-bottom-color: #e8edf2;
}

body:not(.dark-mode) .queue-table tbody tr:hover {
    background: #f7faff;
}

body:not(.dark-mode) .open-queue-chat-button {
    border-color: #d7e0e9;
    color: #175cb8;
    background: #f3f7fc;
}
