/* =====================================================================
   ai-agent.css  (REWRITTEN — modern UI pass)
   ---------------------------------------------------------------
   Styling for the AI Agent side-drawer widget ("srai-" prefix,
   kept fully separate from the existing "srchat-" classes so
   nothing collides with the existing group-chat widget's CSS).

   Design goals for this pass:
     - Smooth, physical-feeling panel slide (cubic-bezier easing)
     - Message bubbles fade+slide in as they appear
     - Animated "typing" indicator (three bouncing dots)
     - Avatar bubbles for the bot, gradient header
     - Chips get a staggered fade-in + tactile hover/press feedback
   ===================================================================== */

:root {
    --srai-primary: #5e6ad2;
    --srai-primary-dark: #4a54b8;
    --srai-primary-light: #eef0fd;
}

/* ---------------------------------------------------------------
   Topbar FAB — subtle pulse so the icon reads as "new/interactive"
   --------------------------------------------------------------- */
.srai-fab {
    position: relative;
}

.srai-fab i {
    transition: transform 0.2s ease;
}

.srai-fab:hover i {
    transform: scale(1.12) rotate(-6deg);
}

/* ---------------------------------------------------------------
   Slide-in side panel
   --------------------------------------------------------------- */
.srai-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 400px;
    max-width: 92vw;
    background: #fbfbfd;
    box-shadow: -8px 0 32px rgba(20, 20, 43, 0.16);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.srai-panel.srai-open {
    transform: translateX(0);
}

.srai-panel.srai-hidden {
    transform: translateX(100%);
}

.srai-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 30, 0.28);
    backdrop-filter: blur(1px);
    z-index: 1090;
    transition: opacity 0.25s ease;
}

.srai-backdrop.srai-hidden {
    display: none;
}

/* ---------------------------------------------------------------
   Header — gradient, sits above everything
   --------------------------------------------------------------- */
.srai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 14px 16px 18px;
    background: linear-gradient(135deg, var(--srai-primary) 0%, #7c6fe0 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(94, 106, 210, 0.28);
}

.srai-header .srai-title {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    letter-spacing: 0.01em;
}

.srai-title-icon {
    width: 39px;
    height: 39px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.srai-header-actions {
    display: flex;
    gap: 4px;
}

.srai-header-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.srai-header-btn i {
    color: #fff;
}

.srai-header-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.06);
}

.srai-header-btn:active {
    transform: scale(0.94);
}

/* ---------------------------------------------------------------
   Message list
   --------------------------------------------------------------- */
.srai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background:
        radial-gradient(circle at 15% 0%, rgba(94, 106, 210, 0.05), transparent 40%),
        #f7f7fb;
}

.srai-messages::-webkit-scrollbar {
    width: 6px;
}

.srai-messages::-webkit-scrollbar-thumb {
    background: #d7dae3;
    border-radius: 6px;
}

/* Row = avatar (bot only) + bubble, animates in on append */
.srai-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 100%;
    animation: srai-msg-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.srai-row-user {
    justify-content: flex-end;
}

.srai-row-bot {
    justify-content: flex-start;
}

@keyframes srai-msg-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.srai-avatar {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.srai-avatar-bot {
    background: linear-gradient(135deg, var(--srai-primary), #8b7ff0);
    color: #fff;
    box-shadow: 0 2px 6px rgba(94, 106, 210, 0.35);
}

.srai-msg {
    max-width: 78%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 0.875rem;
    line-height: 1.45;
    word-wrap: break-word;
}

.srai-msg-bot {
    background: #fff;
    border: 1px solid #eef0f4;
    color: #1e1e2d;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(20, 20, 43, 0.04);
}

.srai-msg-user {
    background: linear-gradient(135deg, var(--srai-primary), var(--srai-primary-dark));
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(94, 106, 210, 0.28);
}

.srai-msg-bot b {
    color: var(--srai-primary-dark);
}

/* ---------------------------------------------------------------
   Typing indicator — three bouncing dots
   --------------------------------------------------------------- */
.srai-typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
}

.srai-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b7bad0;
    animation: srai-bounce 1.1s infinite ease-in-out both;
}

.srai-dot:nth-child(1) {
    animation-delay: -0.24s;
}

.srai-dot:nth-child(2) {
    animation-delay: -0.12s;
}

.srai-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes srai-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---------------------------------------------------------------
   Suggestion / follow-up chips
   --------------------------------------------------------------- */
.srai-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px;
    background: #f7f7fb;
}



@keyframes srai-chip-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.srai-chip:hover {
    background: var(--srai-primary-light);
    border-color: var(--srai-primary);
    color: var(--srai-primary-dark);
    box-shadow: 0 2px 8px rgba(94, 106, 210, 0.15);
}

.srai-chip:active {
    transform: scale(0.96);
}

.srai-chip-memory {
    border-color: var(--srai-primary);
    background: var(--srai-primary-light);
    color: var(--srai-primary-dark);
    font-weight: 500;
}

.srai-chip-confirm {
    border-color: #17c653;
    color: #17c653;
}

.srai-chip-confirm:hover {
    background: #eafff3;
}

.srai-chip-cancel {
    border-color: #f1416c;
    color: #f1416c;
}

.srai-chip-cancel:hover {
    background: #fff0f4;
}

/* ---------------------------------------------------------------
   Composer
   --------------------------------------------------------------- */
.srai-composer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eef0f4;
    background: #fff;
}

.srai-composer input {
    flex: 1;
    border-radius: 10px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.srai-composer input:focus {
    box-shadow: 0 0 0 3px var(--srai-primary-light);
    border-color: var(--srai-primary);
}

.srai-send-btn {
    background: linear-gradient(135deg, var(--srai-primary), var(--srai-primary-dark));
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.srai-send-btn:hover {
    box-shadow: 0 3px 10px rgba(94, 106, 210, 0.35);
    transform: translateY(-1px);
}

.srai-send-btn:active {
    transform: translateY(0) scale(0.95);
}

/* =====================================================================
   Ticket details CARD (rich AI reply) — added for TICKET_STATUS_BY_ID
   ===================================================================== */

.srai-card {
    max-width: 88%;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(20, 20, 43, 0.06);
    padding: 14px 16px 16px;
    font-size: 0.83rem;
}

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

.srai-card-ticket-id {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e1e2d;
    letter-spacing: 0.02em;
}

.srai-card-subject {
    color: #5c5f6a;
    margin-bottom: 12px;
    font-size: 0.82rem;
}

/* Status badge — colored by status name via dynamic class */
.srai-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: #eef0f4;
    color: #5c5f6a;
}

.srai-badge-open {
    background: #e8f0ff;
    color: #3467e0;
}

.srai-badge-assigned {
    background: #eef0fd;
    color: var(--srai-primary-dark);
}

.srai-badge-in_progress {
    background: #fff6de;
    color: #b6810a;
}

.srai-badge-pause {
    background: #f1f2f6;
    color: #6b6f7d;
}

.srai-badge-resolved {
    background: #e8fbf0;
    color: #17c653;
}

.srai-badge-closed {
    background: #eef2f6;
    color: #556;
}

.srai-badge-cancelled {
    background: #fdecec;
    color: #d13438;
}

.srai-badge-declined {
    background: #fdecec;
    color: #d13438;
}

.srai-badge-reassigned {
    background: #fff0e0;
    color: #d17a00;
}

.srai-badge-reassign_request {
    background: #fff0e0;
    color: #d17a00;
}

.srai-badge-overdue {
    background: #fdecec;
    color: #d13438;
}

/* Meta grid — 2 columns of label/value pairs */
.srai-card-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    padding: 12px 0;
    border-top: 1px dashed #eef0f4;
    border-bottom: 1px dashed #eef0f4;
    margin-bottom: 12px;
}

.srai-card-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.srai-card-meta-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9599a6;
}

.srai-card-meta-value {
    font-size: 0.82rem;
    color: #1e1e2d;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.srai-card-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9599a6;
    font-weight: 700;
    margin: 4px 0 8px;
}

/* Timeline */
.srai-card-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 2px;
}

.srai-timeline-item {
    display: flex;
    gap: 10px;
    position: relative;
    padding-bottom: 14px;
}

.srai-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 12px;
    bottom: 0;
    width: 2px;
    background: #eef0f4;
}

.srai-timeline-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 3px;
    background: var(--srai-primary);
    box-shadow: 0 0 0 3px #fff;
    z-index: 1;
}

.srai-timeline-content {
    min-width: 0;
}

.srai-timeline-status {
    font-weight: 700;
    font-size: 0.76rem;
    color: #1e1e2d;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.srai-timeline-meta {
    font-size: 0.72rem;
    color: #9599a6;
    margin-top: 1px;
}

.srai-timeline-note {
    font-size: 0.78rem;
    color: #3f4254;
    margin-top: 3px;
    background: #f7f7fb;
    border-radius: 8px;
    padding: 6px 9px;
}

.srai-card-resolution-note {
    font-size: 0.8rem;
    color: #1e1e2d;
    background: #e8fbf0;
    border-radius: 10px;
    padding: 10px 12px;
    line-height: 1.4;
}

/* =====================================================================
   Job details CARD (rich AI reply) — added for DESCRIBE_JOB
   ===================================================================== */

.srai-card-badges {
    display: flex;
    gap: 6px;
}

.srai-card-description {
    color: #3f4254;
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #eef0f4;
}

/* Priority badges — distinct palette from status badges */
.srai-badge-priority-low {
    background: #eef2f6;
    color: #6b6f7d;
}

.srai-badge-priority-medium {
    background: #fff6de;
    color: #b6810a;
}

.srai-badge-priority-high {
    background: #ffe9de;
    color: #d9520c;
}

.srai-badge-priority-emergency,
.srai-badge-priority-critical {
    background: #fdecec;
    color: #d13438;
}

.srai-card-empty {
    font-size: 0.78rem;
    color: #9599a6;
    font-style: italic;
    margin-bottom: 10px;
}

/* Requester / technician contact rows */
.srai-card-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.srai-person-avatar {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--srai-primary-light);
    color: var(--srai-primary-dark);
}

.srai-person-avatar-tech {
    background: #e8fbf0;
    color: #17c653;
}

.srai-person-info {
    min-width: 0;
}

.srai-person-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e1e2d;
}

.srai-person-role {
    font-weight: 400;
    color: #9599a6;
    font-size: 0.76rem;
}

.srai-person-contact {
    font-size: 0.74rem;
    color: #9599a6;
    margin-top: 1px;
}

/* Subtask checklist */
.srai-subtask-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 6px;
}

.srai-subtask-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.srai-subtask-check {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border-radius: 5px;
    border: 1.5px solid #d7dae3;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.srai-subtask-done {
    background: #17c653;
    border-color: #17c653;
}

.srai-subtask-text {
    font-size: 0.8rem;
    color: #1e1e2d;
}

.srai-subtask-text-done {
    color: #9599a6;
    text-decoration: line-through;
}

/* =====================================================================
   Top Performers CARD — added for TOP_PERFORMERS
   ===================================================================== */

.srai-perf-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.srai-perf-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f4f4f8;
}

.srai-perf-row:last-child {
    border-bottom: none;
}

.srai-perf-rank {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: #eef0f4;
    color: #6b6f7d;
}

.srai-perf-rank-1 {
    background: #fff2cc;
    color: #b6810a;
}

.srai-perf-rank-2 {
    background: #e9edf3;
    color: #5c6270;
}

.srai-perf-rank-3 {
    background: #ffe4d1;
    color: #b5561f;
}

.srai-perf-stats {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.srai-perf-stat {
    font-size: 0.72rem;
    color: #6b6f7d;
    white-space: nowrap;
}

.srai-perf-stat-rate {
    font-weight: 700;
    color: #17c653;
}

/* =====================================================================
   Person Profile CARD — added for TECHNICIAN_SKILLSET
   ===================================================================== */

.srai-profile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 10px;
    border-bottom: 1px dashed #eef0f4;
}

.srai-person-avatar-lg {
    width: 42px;
    height: 42px;
    font-size: 1rem;
}

.srai-person-name-lg {
    font-size: 0.92rem;
}

.srai-exp-badge {
    margin-left: auto;
    flex: 0 0 auto;
    background: var(--srai-primary-light);
    color: var(--srai-primary-dark);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.srai-skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.srai-skill-chip {
    background: #f1f2f6;
    color: #3f4254;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}

/* =====================================================================
   Export progress CARD — added for EXPORT_TICKETS_PDF
   ===================================================================== */

.srai-export-card {
    transition: background 0.25s ease, border-color 0.25s ease;
}

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

.srai-export-icon {
    flex: 0 0 auto;
    color: var(--srai-primary);
    transition: color 0.25s ease;
}

.srai-export-title {
    font-size: 0.85rem;
}

.srai-export-desc {
    font-size: 0.74rem;
}

.srai-export-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #eef0f4;
    overflow: hidden;
}

.srai-export-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--srai-primary), #8b7ff0);
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.srai-export-card-done {
    background: #f3fcf7;
    border-color: #cdf3dd;
}

.srai-export-card-done .srai-export-icon {
    color: #17c653;
}

.srai-export-card-done .srai-export-progress-bar {
    background: #17c653;
}

.srai-export-card-error {
    background: #fff6f6;
    border-color: #fad2d5;
}

.srai-export-card-error .srai-export-icon {
    color: #f1416c;
}

.srai-export-card-error .srai-export-progress-track {
    display: none;
}

/* =====================================================================
   Ticket LIST card — added for TICKET_OPEN_LIST
   ===================================================================== */

.srai-tlist {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.srai-tlist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f4f4f8;
}

.srai-tlist-row:last-child {
    border-bottom: none;
}

.srai-tlist-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.srai-tlist-id {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--srai-primary-dark);
}

.srai-tlist-subject {
    font-size: 0.76rem;
    color: #6b6f7d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.srai-tlist-badges {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
}

/* =====================================================================
   Schedule card — added for TECHNICIAN_NEXT_SLOT (3-day view)
   ===================================================================== */

.srai-sched-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.srai-sched-day {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    background: #f7f7fb;
    border: 1px solid transparent;
}

.srai-sched-day-on {
    background: #f3fcf7;
    border-color: #d9f5e4;
}

.srai-sched-day-off {
    background: #f7f7fb;
}

.srai-sched-date {
    flex: 0 0 auto;
    width: 52px;
    text-align: center;
}

.srai-sched-dayname {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9599a6;
    font-weight: 700;
}

.srai-sched-datenum {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e1e2d;
}

.srai-sched-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.srai-sched-shift {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e1e2d;
    margin-top: 2px;
}

.srai-sched-time {
    font-size: 0.72rem;
    color: #6b6f7d;
}

.srai-badge-on {
    background: #e8fbf0;
    color: #17c653;
}

.srai-badge-off {
    background: #eef0f4;
    color: #6b6f7d;
}

/* =====================================================================
   Overdue list row — assignee line (added for TICKET_OVERDUE_COUNT)
   ===================================================================== */

.srai-tlist-assignee {
    font-size: 0.72rem;
    color: #9599a6;
    display: flex;
    align-items: center;
    margin-top: 1px;
}

/* =====================================================================
   Performance stats CARD — added for TECHNICIAN_PERFORMANCE
   ===================================================================== */

.srai-perf-tile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.srai-perf-tile {
    background: #f7f7fb;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.srai-perf-tile-good {
    background: #f3fcf7;
}

.srai-perf-tile-icon {
    color: var(--srai-primary);
    margin-bottom: 4px;
}

.srai-perf-tile-good .srai-perf-tile-icon {
    color: #17c653;
}

.srai-perf-tile-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1e1e2d;
}

.srai-perf-tile-label {
    font-size: 0.68rem;
    color: #9599a6;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 2px;
}

.srai-perf-extra {
    border-top: 1px dashed #eef0f4;
    padding-top: 10px;
    margin-top: 12px;
}

/* =====================================================================
   Location employee CARDS — added for PEOPLE_AVAILABLE_BY_LOCATION
   ===================================================================== */

.srai-loc-people-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.srai-loc-person {
    background: #f7f7fb;
    border-radius: 12px;
    padding: 12px;
}

.srai-loc-person-header {
    padding-bottom: 0;
    margin-bottom: 6px;
    border-bottom: none;
}

.srai-loc-person-time {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--srai-primary-dark);
}

.srai-skill-chips-sm {
    margin-bottom: 0;
}

.srai-skill-chips-sm .srai-skill-chip {
    font-size: 0.68rem;
    padding: 3px 8px;
}

/* =====================================================================
   select2 swap-in (person/people picker) — added for technician-
   related operations and multi-assignee ticket assignment
   ===================================================================== */

.srai-select2-swap {
    flex: 1;
    min-width: 0;
}

.srai-composer .select2-container {
    flex: 1;
    min-width: 0;
}

.srai-composer .select2-selection {
    min-height: 34px !important;
    border-radius: 10px !important;
    border-color: #d7dae3 !important;
}

/* =====================================================================
   Bad Performers CARD — added for BAD_PERFORMERS
   ===================================================================== */

.srai-card-warn {
    border-color: #fad2d5;
    background: #fffafa;
}

.srai-perf-row-warn {
    align-items: center;
}

.srai-perf-warn-icon {
    flex: 0 0 auto;
    color: #f1416c;
}

.srai-perf-stat-warn {
    font-weight: 700;
    color: #f1416c;
}

/* =====================================================================
   Location employee card — job queue progress bar + plant chip
   (added for PEOPLE_AVAILABLE_BY_LOCATION richer fields)
   ===================================================================== */

.srai-loc-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.srai-loc-plant {
    font-size: 0.72rem;
    color: #6b6f7d;
    display: inline-flex;
    align-items: center;
}

.srai-queue-row {
    margin-top: 8px;
}

.srai-queue-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #9599a6;
    margin-bottom: 3px;
}

.srai-queue-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: #eef0f4;
    overflow: hidden;
}

.srai-queue-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--srai-primary), #8b7ff0);
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.srai-queue-bar-high {
    background: linear-gradient(90deg, #d17a00, #f0a63c);
}

.srai-queue-bar-full {
    background: linear-gradient(90deg, #d13438, #f1416c);
}

/* =====================================================================
   UI polish pass — scroll-to-bottom, typing label, card interactivity
   ===================================================================== */

/* Scroll-to-bottom floating button */
.srai-scroll-btn {
    position: absolute;
    bottom: 78px;
    right: 20px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--srai-primary);
    box-shadow: 0 3px 12px rgba(20, 20, 43, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: transform 0.15s ease, opacity 0.2s ease, box-shadow 0.15s ease;
}

.srai-scroll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(20, 20, 43, 0.22);
}

.srai-scroll-btn.srai-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
}

/* Typing indicator label */
.srai-typing-label {
    font-size: 0.72rem;
    color: #9599a6;
    font-style: italic;
    margin-right: 6px;
}

/* Topbar FAB — subtle "alive" pulse ring to invite engagement */
.srai-fab::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1.5px solid var(--srai-primary);
    opacity: 0;
    animation: srai-fab-pulse 2.6s ease-out infinite;
    pointer-events: none;
}

@keyframes srai-fab-pulse {
    0% {
        transform: scale(0.85);
        opacity: 0.55;
    }

    70% {
        transform: scale(1.35);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}

/* Cards get a subtle hover-lift — makes the whole widget feel more
   interactive/alive rather than static text dumps. */
.srai-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.srai-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(20, 20, 43, 0.09);
}

/* Thin gradient accent line along the top of every card — small
   branding touch that ties every reply back to the assistant. */
.srai-card {
    position: relative;
    overflow: hidden;
}

.srai-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--srai-primary), #8b7ff0, var(--srai-primary));
    background-size: 200% 100%;
    animation: srai-card-shimmer 3s linear infinite;
}

@keyframes srai-card-shimmer {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 200% 0%;
    }
}