/* ============================================================================
   CHAT SUPPORT — Suport Clienți (consolă operatori)
   Integrat în light-theme-ul platformei AiMindloop (vezi css/light-theme.css).
   Toate clasele sunt prefixate cs- (vezi BADGE GUIDELINES din light-theme.css).

   Autor: AI MINDLOOP SRL
   ============================================================================ */

/* ─── Topbar: taburi + prezență ──────────────────────────────────────────── */

.cs-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    /* Chenar de „toolbar": bara de taburi + prezența citesc ca o zonă distinctă */
    padding: 10px 12px;
    background: var(--gray-50);
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--shadow-sm);
}

.cs-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cs-tab {
    padding: 8px 16px;
    min-height: 40px;
    border-radius: var(--border-radius-sm, 8px);
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-600);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background var(--transition-fast), color var(--transition-fast),
                border-color var(--transition-fast);
}
.cs-tab:hover {
    background: var(--tk-teal-50, #ecfeff);
    color: var(--tk-teal-700, #0e7490);
}
.cs-tab.active {
    background: var(--tk-teal-600, #0891b2);
    color: #fff;
    border-color: var(--tk-teal-600, #0891b2);
    /* tabul activ „iese în față" față de bara gri a toolbar-ului */
    box-shadow: 0 1px 3px rgba(8, 145, 178, 0.35);
}

.cs-presence {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13px;
    color: var(--gray-700);
}
.cs-presence-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-400);
    flex-shrink: 0;
}
.cs-presence-dot.online { background: var(--success); }
.cs-presence-dot.away { background: var(--warning); }
/* Outbound (taskul #330): bulină portocalie, distinctă. */
.cs-presence-dot.outbound { background: #f97316; }
.cs-presence select {
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    outline: none;
}

/* Pastila cu numărul de tichete necitite pe tabul „Tichete". */
.cs-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--danger, #dc2626);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
}
.cs-tab.active .cs-tab-badge {
    background: #fff;
    color: var(--tk-teal-700, #0e7490);
}

/* Pastila din meniul lateral „Suport Clienți" (best-effort). */
.cs-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 8px;
    border-radius: 999px;
    background: var(--danger, #dc2626);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

/* Comutatoare mici pentru sunet / notificări desktop, lângă prezență. */
.cs-cue-toggles {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cs-cue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    transition: background var(--transition-fast), border-color var(--transition-fast),
                box-shadow var(--transition-fast);
}
.cs-cue-btn:hover {
    background: var(--tk-teal-50, #ecfeff);
    border-color: var(--tk-teal-300, #67e8f9);
}
.cs-cue-btn[aria-pressed="true"] {
    background: var(--tk-teal-50, #ecfeff);
    border-color: var(--tk-teal-600, #0891b2);
    box-shadow: inset 0 0 0 1px var(--tk-teal-600, #0891b2);
}
.cs-cue-btn:focus-visible {
    outline: 2px solid var(--tk-teal-600, #0891b2);
    outline-offset: 2px;
}

/* ─── Layout inbox: listă + conversație ──────────────────────────────────── */

.cs-layout {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    gap: 16px;
    align-items: start;
}

.cs-list-panel,
.cs-conv-panel {
    background: #fff;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: calc(100vh - 220px);
    overflow: hidden;
}

/* ─── Detaliu tichet: layout 3 coloane (centru conversație + sidebar dreapta) ─
   Clasă NOUĂ pusă pe #csConvPanel DOAR când un tichet e deschis (renderConversation).
   NU modifică .cs-layout global (folosit de inbox). */
.cs-conv-panel.cs-conv-split {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 320px);
    /* OBLIGATORIU: fără rând explicit, rândul implicit e "auto" = max-content, deci
       firul de discuție se randa la înălțimea lui totală și era tăiat de
       overflow:hidden de pe panou (fără bară de scroll, deci restul discuției era
       invizibil). minmax(0, 1fr) leagă rândul de înălțimea panoului →
       .cs-conv-body redevine zona de scroll. */
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
}
/* Header-ul e flex-shrink:0 și creștea necontrolat: panourile „Context client",
   „Istoric client" și „Acțiuni" se încarcă async DUPĂ randare și împingeau firul
   afară. Plafonăm DOAR zona auxiliară, nu tot header-ul — titlul, badge-urile și
   cardul clientului (cu butonul „Sună" și link-ul de lead) rămân mereu vizibile,
   indiferent de înălțimea ecranului. */
.cs-conv-split .cs-conv-aux {
    /* ATENȚIE: aici NU merge procentaj. Părintele (.cs-conv-header) n-are înălțime
       definită, deci un % s-ar rezolva circular: browserul calculează întâi
       header-ul din conținutul NEplafonat, apoi plafonează copilul — header-ul
       rămâne mare (măsurat: 620px, cu firul redus la 28px). vh e o referință
       absolută. 20vh = 180px pe 900px înălțime; firul rămâne la ~316px. */
    /* Redesign 2026-10: fără plafon — secțiunile sunt acum un acordeon pe chip-uri,
       închis implicit; fiecare secțiune deschisă are max-height + scroll propriu
       (vezi .cs-aux-sec.cs-aux-open la finalul fișierului). */
    max-height: none;
    overflow: visible;
}
.cs-conv-split .cs-conv-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}
.cs-conv-split .cs-conv-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    border-left: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Paneluri sidebar (Acțiuni rapide / AI / SLA) — același limbaj vizual ca restul */
.cs-side-panel {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cs-side-hidden { display: none; }
.cs-side-title {
    font-weight: 700;
    font-size: 12.5px;
    color: var(--gray-700);
}
.cs-side-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cs-side-field-col {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}
.cs-side-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-400);
    flex-shrink: 0;
}
.cs-side-field .cs-select { flex: 1 1 auto; min-width: 0; max-width: 190px; }
.cs-side-field-col .cs-select { max-width: none; }
.cs-side-value { text-align: right; }
.cs-side-muted { color: var(--gray-400); }
.cs-side-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}
.cs-side-actions .cs-btn { flex: 1 1 auto; }
.cs-conv-split .cs-tags-row { margin: 0; }

/* Acțiuni AI (listă de butoane pline pe lățime) + panoul de rezultat */
.cs-ai-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cs-ai-action {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    border-radius: var(--border-radius-sm, 8px);
    padding: 8px 12px;
    min-height: 36px;
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}
.cs-ai-action:hover { background: var(--gray-50); border-color: var(--tk-teal-600, #0891b2); }
.cs-ai-action:disabled { opacity: 0.6; cursor: default; }
.cs-ai-suggest {
    background: var(--tk-teal-50, #ecfeff);
    border-color: var(--tk-teal-200, #a5f3fc);
    color: var(--tk-teal-800, #155e75);
    font-weight: 600;
}
.cs-ai-result {
    margin-top: 4px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    padding: 8px 10px;
    font-size: 12.5px;
}
.cs-ai-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--gray-700);
}
.cs-ai-result-tools { display: flex; gap: 4px; flex-shrink: 0; }
.cs-ai-result-body {
    margin-top: 6px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    color: var(--gray-800);
    line-height: 1.5;
    max-height: 240px;
    overflow-y: auto;
}

/* Istoric SLA */
.cs-sla-thr {
    font-size: 11px;
    color: var(--gray-400);
}
.cs-sla-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--gray-700);
}
.cs-sla-lbl { font-weight: 600; }
.cs-sla-row .cs-history-when { margin-left: auto; }
.cs-sla-over {
    color: var(--tk-red-700, #b91c1c);
    font-weight: 700;
}
.cs-sla-info { font-size: 12px; color: var(--gray-600); }
.cs-sla-ok { font-size: 12.5px; color: var(--tk-green-700, #15803d); font-weight: 600; }

/* ─── Filtre ─────────────────────────────────────────────────────────────── */

.cs-filters {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cs-input,
.cs-select,
.cs-textarea {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm, 8px);
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--gray-800);
    background: #fff;
    outline: none;
    box-sizing: border-box;
}
.cs-input:focus,
.cs-select:focus,
.cs-textarea:focus {
    border-color: var(--tk-teal-600, #0891b2);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}
.cs-filters .cs-select { flex: 1 1 30%; min-width: 0; }
.cs-filters .cs-input { flex: 1 1 100%; }

/* ─── Butoane ────────────────────────────────────────────────────────────── */

.cs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    border-radius: var(--border-radius-sm, 8px);
    padding: 8px 14px;
    min-height: 38px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
    transition: background var(--transition-fast), color var(--transition-fast),
                border-color var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
}
.cs-btn:hover { background: var(--gray-100); }
.cs-btn:active { transform: scale(0.98); }
.cs-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.cs-btn-primary {
    background: var(--tk-teal-600, #0891b2);
    border-color: var(--tk-teal-600, #0891b2);
    color: #fff;
}
.cs-btn-primary:hover { background: var(--tk-teal-700, #0e7490); }

.cs-btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.cs-btn-success:hover { filter: brightness(0.95); background: var(--success); }

.cs-btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}
.cs-btn-warning:hover { filter: brightness(0.95); background: var(--warning); }
.cs-btn-danger {
    background: var(--danger, #dc2626);
    border-color: var(--danger, #dc2626);
    color: #fff;
}
.cs-btn-danger:hover { filter: brightness(0.95); background: var(--danger, #dc2626); }

.cs-btn-sm { padding: 4px 10px; min-height: 32px; font-size: 12px; }

/* ─── Lista de tichete ───────────────────────────────────────────────────── */

.cs-ticket-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    /* fundal discret ca rândurile-card (albe) să se detașeze clar */
    background: var(--gray-50);
}

.cs-ticket-card {
    padding: 10px 12px;
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm, 8px);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast),
                box-shadow var(--transition-fast);
    background: #fff;
}
.cs-ticket-card:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}
.cs-ticket-card.active {
    background: var(--tk-teal-50, #ecfeff);
    border-color: var(--tk-teal-600, #0891b2);
    /* conversația selectată: chenar teal gros (border 2px + inel 2px) + umbră */
    box-shadow: inset 0 0 0 2px var(--tk-teal-600, #0891b2), var(--shadow-sm);
}
.cs-ticket-card.unread {
    border-left: 5px solid var(--tk-teal-600, #0891b2);
    background: var(--tk-teal-50, #ecfeff);
    box-shadow: inset 0 0 0 1px var(--tk-teal-100, #cffafe);
}

/* Punct de „mesaj nou necitit" în dreptul subiectului. */
.cs-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tk-teal-600, #0891b2);
    margin-right: 6px;
    flex-shrink: 0;
    vertical-align: middle;
    box-shadow: 0 0 0 3px var(--tk-teal-50, #ecfeff);
    animation: cs-dot-pulse 1.6s ease-in-out infinite;
}
@keyframes cs-dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.25); opacity: 0.7; }
}

/* Flash scurt când un rând trece NOU în starea „necitit" (seen→unread). */
.cs-ticket-card.cs-new-unread { animation: cs-unread-flash 1.4s ease-out 1; }
@keyframes cs-unread-flash {
    0%   { background: var(--tk-teal-200, #a5f3fc); box-shadow: 0 0 0 3px var(--tk-teal-200, #a5f3fc); }
    30%  { background: var(--tk-teal-100, #cffafe); }
    100% { background: var(--tk-teal-50, #ecfeff); box-shadow: inset 0 0 0 1px var(--tk-teal-100, #cffafe); }
}
@media (prefers-reduced-motion: reduce) {
    .cs-unread-dot { animation: none; }
    .cs-ticket-card.cs-new-unread { animation: none; }
}

.cs-ticket-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.cs-ticket-subject {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.cs-ticket-card.unread .cs-ticket-subject { color: var(--tk-teal-700, #0e7490); }
.cs-ticket-time {
    font-size: 11px;
    color: var(--gray-400);
    white-space: nowrap;
    flex-shrink: 0;
}
.cs-ticket-preview {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cs-ticket-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

/* ─── Badge-uri status / prioritate / sursă / rating ─────────────────────── */

.cs-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}
/* „Nou" e teal — aceeași semantică vizuală ca tk-st-pending din modulul Task-uri */
.cs-st-new     { background: var(--tk-teal-50, #ecfeff); color: var(--tk-teal-700, #0e7490); }
.cs-st-open    { background: var(--success-bg, #d1fae5); color: #047857; }
.cs-st-pending { background: var(--warning-bg, #fef3c7); color: #b45309; }
.cs-st-solved  { background: var(--gray-100); color: var(--gray-600); }
.cs-st-closed  { background: var(--gray-200); color: var(--gray-500); }

.cs-pr-low    { background: var(--gray-100); color: var(--gray-500); }
.cs-pr-normal { background: var(--gray-100); color: var(--gray-600); }
.cs-pr-high   { background: var(--warning-bg, #fef3c7); color: #b45309; }
.cs-pr-urgent { background: var(--error-bg, #fee2e2); color: #b91c1c; }

.cs-src { background: var(--gray-50); color: var(--gray-500); border: 1px solid var(--gray-200); }

.cs-assignee { background: var(--primary-50); color: var(--primary-700); }
.cs-assignee-ai { background: #f3e8ff; color: #7e22ce; }

.cs-rating-stars {
    color: #f59e0b;
    font-size: 12px;
    letter-spacing: 1px;
    white-space: nowrap;
}
.cs-rating-stars .cs-star-off { color: var(--gray-300); }
/* Nota numerică de lângă stele — vizibilă și când culorile sunt anulate
   (mod high contrast), pentru că diferențiază nota pe text, nu pe culoare. */
.cs-rating-num {
    font-size: 0.82em;
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    letter-spacing: 0;
    margin-left: 3px;
    vertical-align: baseline;
}

.cs-reopen-badge { background: var(--error-bg, #fee2e2); color: #b91c1c; }

/* ─── Paginare ───────────────────────────────────────────────────────────── */

.cs-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--gray-200);
    font-size: 12px;
    color: var(--gray-500);
}

/* ─── Panoul de conversație ──────────────────────────────────────────────── */

.cs-conv-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.cs-conv-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cs-conv-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    flex: 1;
    min-width: 0;
    margin: 0;
}
/* Toolbar coerent: stânga status+asignare, dreapta acțiuni; înălțimi egale */
.cs-conv-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    flex-wrap: wrap;
}
.cs-conv-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cs-conv-actions .cs-select {
    min-height: 38px;
    padding: 7px 10px;
}
.cs-back-btn { display: none; }

/* ─── Card client ────────────────────────────────────────────────────────── */

.cs-client-card {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    padding: 8px 12px;
    font-size: 12.5px;
    color: var(--gray-600);
}

/* Blocul client: metadata + etichete integrate în aceeași casetă
   (rândul „+ etichetă" nu mai plutește singur sub card) */
.cs-client-block {
    background: var(--gray-50);
    border: 2px solid var(--gray-300);
    border-radius: var(--border-radius-sm, 8px);
    padding: 8px 12px;
}
.cs-client-block .cs-client-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}
.cs-client-block .cs-tags-row { margin-top: 8px; }
.cs-client-block .cs-tags-row:empty { display: none; margin: 0; }
.cs-client-card strong { color: var(--gray-800); }
.cs-client-card a {
    color: var(--tk-teal-700, #0e7490);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.cs-client-card a:hover { text-decoration: underline; }

/* ─── Mesaje ─────────────────────────────────────────────────────────────── */

.cs-conv-body {
    flex: 1;
    /* fără asta, elementul flex nu se poate micșora sub înălțimea conținutului
       și scroll-ul nu se activează */
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* zona de mesaje citește ca un panou „adâncit" între header și composer */
    box-shadow: inset 0 7px 9px -9px rgba(17, 24, 39, 0.18),
                inset 0 -7px 9px -9px rgba(17, 24, 39, 0.18);
}

.cs-msg {
    /* plafon de lizibilitate: pe panouri late (~1200px) bula nu se mai
       întinde pe toată lățimea — max ~720px (~70 caractere pe rând) */
    max-width: min(78%, 720px);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cs-msg-bubble {
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.cs-msg-meta {
    font-size: 11px;
    color: var(--gray-400);
    padding: 0 4px;
}

.cs-msg.visitor { align-self: flex-start; }
.cs-msg.visitor .cs-msg-bubble {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 4px;
    color: var(--gray-800);
}

.cs-msg.operator { align-self: flex-end; }
.cs-msg.operator .cs-msg-meta { text-align: right; }
.cs-msg.operator .cs-msg-bubble {
    background: var(--tk-teal-600, #0891b2);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.cs-msg.ai { align-self: flex-end; }
.cs-msg.ai .cs-msg-meta { text-align: right; }
.cs-msg.ai .cs-msg-bubble {
    background: #f3e8ff;
    border: 1px solid #e9d5ff;
    color: #581c87;
    border-bottom-right-radius: 4px;
}

.cs-msg.system {
    align-self: center;
    max-width: 92%;
}
.cs-msg.system .cs-msg-bubble {
    background: transparent;
    border: none;
    color: var(--gray-500);
    font-size: 12px;
    text-align: center;
    padding: 2px 8px;
}

/* ─── Notă internă (vizibilă doar operatorilor) ──────────────────────────── */

.cs-msg.note {
    align-self: flex-end;
    max-width: 86%;
}
.cs-msg.note .cs-msg-meta { text-align: right; color: #b45309; }
.cs-msg.note .cs-msg-bubble {
    background: var(--warning-bg, #fef3c7);
    border: 1px dashed var(--warning, #f59e0b);
    color: #78350f;
    border-bottom-right-radius: 4px;
}

/* ─── Ștergere mesaj / notă (migrarea 388) ───────────────────────────────── */

/* Butonul „Șterge" apare la hover/focus pe mesajele care pot fi șterse;
   pe ecrane tactile (fără hover) rămâne vizibil, discret. */
.cs-msg-del {
    background: none;
    border: none;
    padding: 0 0 0 6px;
    margin: 0;
    font-size: 11px;
    color: var(--gray-400);
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
}
.cs-msg:hover .cs-msg-del,
.cs-msg-del:focus-visible { opacity: 1; }
.cs-msg-del:hover { color: var(--danger, #dc2626); text-decoration: underline; }
@media (hover: none) { .cs-msg-del { opacity: .8; } }
/* „👁 Vezi original" (doar manageri) rămâne vizibil pe mesajul șters */
.cs-msg-del.cs-msg-orig { opacity: .85; }
.cs-msg-del.cs-msg-orig:hover { color: var(--tk-teal-600, #0891b2); }

.cs-msg.cs-msg-deleted .cs-msg-bubble,
.cs-msg.note.cs-msg-deleted .cs-msg-bubble {
    background: transparent;
    border: 1px dashed var(--gray-300, #d1d5db);
    color: var(--gray-500, #6b7280);
    font-style: italic;
    font-size: 12.5px;
}

/* ─── Rezumat AI la escaladare ───────────────────────────────────────────── */

/* Avertisment: firul e trunchiat de plafonul serverului (nu e o discuție scurtă). */
.cs-trunc-note {
    align-self: center;
    max-width: 100%;
    background: var(--gray-100, #f3f4f6);
    border: 1px dashed var(--gray-300, #d1d5db);
    border-radius: var(--border-radius-sm, 8px);
    padding: 6px 10px;
    font-size: 12.5px;
    color: var(--gray-600, #4b5563);
    text-align: center;
}

.cs-escalation-card {
    background: #f3e8ff;
    border: 1px solid #e9d5ff;
    border-radius: var(--border-radius-sm, 8px);
    padding: 10px 12px;
    font-size: 13px;
    color: #581c87;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cs-escalation-title {
    font-weight: 700;
    font-size: 12.5px;
}

/* ─── Formular răspuns ───────────────────────────────────────────────────── */

/* Composer integrat: textarea sus + toolbar jos, în același chenar */
.cs-reply {
    position: relative;
    padding: 10px 12px;
    border-top: 1px solid var(--gray-200);
    background: #fff;
    flex-shrink: 0;
}
.cs-composer {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.cs-composer:focus-within {
    border-color: var(--tk-teal-600, #0891b2);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}
.cs-reply .cs-textarea {
    border: none;
    border-radius: 0;
    box-shadow: none;
    resize: none;
    width: 100%;
    padding: 10px 12px;
    max-height: 200px; /* ~8 rânduri, sincron cu auto-resize-ul din JS */
    overflow-y: auto;
    line-height: 1.4;
}
.cs-reply .cs-textarea:focus {
    border: none;
    box-shadow: none;
}
.cs-composer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px 8px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}
.cs-reply-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}
.cs-send-btn {
    flex-shrink: 0;
    padding: 8px 20px;
    margin-left: auto;
}
.cs-note-toggle {
    font-size: 11.5px;
    color: var(--gray-500);
    white-space: nowrap;
}
.cs-note-toggle input { width: 13px; height: 13px; }

/* Hint + selector „tasta de trimitere" sub compozitor */
.cs-sendkey-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 2px 0;
    font-size: 11.5px;
    color: var(--gray-500);
}
.cs-sendkey-hint { min-width: 0; }
.cs-sendkey-select {
    font-size: 11.5px;
    padding: 2px 4px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: #fff;
    color: var(--gray-600);
    max-width: 100%;
}

/* ─── Popup răspunsuri predefinite ───────────────────────────────────────── */

.cs-canned-pop {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(100% + 6px);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    box-shadow: var(--shadow-lg);
    max-height: 260px;
    overflow-y: auto;
    z-index: 50;
    padding: 6px;
}
.cs-canned-item {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.cs-canned-item:hover { background: var(--tk-teal-50, #ecfeff); }
.cs-canned-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--gray-800);
}
.cs-canned-preview {
    font-size: 11.5px;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cs-canned-empty {
    padding: 12px;
    font-size: 12.5px;
    color: var(--gray-400);
    text-align: center;
}
.cs-canned-admin-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    margin-bottom: 6px;
    background: var(--gray-50);
}

/* ─── Stare goală / notă ─────────────────────────────────────────────────── */

.cs-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--gray-500);
    font-size: 13.5px;
    font-weight: 500;
    text-align: center;
    padding: 30px;
    margin: 8px;
    border: 1px dashed var(--gray-300);
    border-radius: var(--border-radius, 12px);
    background: #fff;
}
.cs-empty-icon { font-size: 38px; opacity: 0.65; }

.cs-error-note {
    color: var(--error);
    font-size: 13px;
    padding: 12px;
    text-align: center;
}

/* ─── Rapoarte ───────────────────────────────────────────────────────────── */

.cs-report-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 16px;
}
.cs-report-card h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
}

.cs-period-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
/* varianta „card": bara principală de perioadă din Rapoarte, pe un rând compact */
.cs-period-bar.cs-period-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--shadow-sm);
    padding: 12px 14px;
}
.cs-period-bar label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gray-500);
}
.cs-quick-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.cs-quick { border-radius: 999px; }
.cs-quick.active {
    background: var(--tk-teal-600, #0891b2);
    border-color: var(--tk-teal-600, #0891b2);
    color: #fff;
}
.cs-quick.active:hover { background: var(--tk-teal-700, #0e7490); }

/* Grupuri de KPI: „Volum" / „Timpi" / „Calitate" */
.cs-stats-groups {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cs-stats-group-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--gray-500);
    margin-bottom: 6px;
}
.cs-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.cs-stat-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    padding: 10px 12px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.cs-stat-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}
.cs-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.cs-stat-ico {
    font-size: 14px;
    line-height: 1;
    opacity: 0.8;
    flex-shrink: 0;
}
.cs-stat-sub {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 600;
}
.cs-stat-label {
    font-size: 11.5px;
    color: var(--gray-500);
    margin-top: 2px;
}
/* KPI fără date: discret, nu un dash mare care pare bug */
.cs-stat-empty { opacity: 0.75; }
.cs-stat-nodata {
    font-size: 11.5px;
    font-weight: 500;
    font-style: italic;
    color: var(--gray-400);
}

.cs-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius-sm, 8px);
    border: 1px solid var(--gray-200);
    /* umbre de indicare a scroll-ului orizontal (pure CSS, background-attachment) */
    background:
        linear-gradient(90deg, #fff 40%, rgba(255,255,255,0)) left / 28px 100% no-repeat local,
        linear-gradient(270deg, #fff 40%, rgba(255,255,255,0)) right / 28px 100% no-repeat local,
        linear-gradient(90deg, rgba(17,24,39,0.10), rgba(17,24,39,0)) left / 12px 100% no-repeat scroll,
        linear-gradient(270deg, rgba(17,24,39,0.10), rgba(17,24,39,0)) right / 12px 100% no-repeat scroll,
        #fff;
}
.cs-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent; /* lasă umbrele de scroll să se vadă */
    font-size: 13px;
}
.cs-table th {
    padding: 9px 10px;
    text-align: left;
    font-size: 12px;
    color: var(--gray-600);
    text-transform: none;
    font-weight: 700;
    border-bottom: 2px solid var(--gray-200);
    background: transparent;
    white-space: nowrap;
}
.cs-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    white-space: nowrap;
}
.cs-table tbody tr { transition: background var(--transition-fast); }
.cs-table tbody tr:hover td { background: var(--tk-teal-50, #ecfeff); }
.cs-table tr:last-child td { border-bottom: none; }
.cs-table .cs-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ─── Setări ─────────────────────────────────────────────────────────────── */

.cs-settings-form {
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cs-form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cs-form-row > label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-600);
}
.cs-form-hint {
    font-size: 11.5px;
    color: var(--gray-400);
}
.cs-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--gray-700);
    cursor: pointer;
}
.cs-check input { width: 16px; height: 16px; cursor: pointer; }

/* ─── Modal tichet manual ────────────────────────────────────────────────── */

.cs-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cs-modal {
    background: #fff;
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}
.cs-modal h3 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
}
.cs-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .cs-layout { display: block; }
    .cs-list-panel { max-height: none; margin-bottom: 16px; }
    .cs-conv-panel { max-height: none; min-height: 70vh; }
    /* când o conversație e deschisă pe mobil, ascundem lista */
    .cs-layout.conv-open .cs-list-panel { display: none; }
    .cs-layout:not(.conv-open) .cs-conv-panel { display: none; }
    .cs-back-btn { display: inline-flex; }
    .cs-msg { max-width: 90%; }
    .cs-stats-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

    /* Detaliu tichet pe mobil: sidebarul curge SUB conversație (o coloană) */
    .cs-conv-panel.cs-conv-split { display: flex; flex-direction: column; }
    .cs-conv-split .cs-conv-aux { max-height: none; overflow-y: visible; }
    .cs-conv-split .cs-conv-main { flex: 1 1 auto; min-height: 58vh; overflow: hidden; }
    .cs-conv-split .cs-conv-sidebar {
        border-left: none;
        border-top: 1px solid var(--gray-200);
        overflow-y: visible;
    }
    .cs-side-field .cs-select { max-width: none; }
}

/* ============================================================================
   VAL 2 — Conectori API (panoul „Acțiuni” + administrare), chei widget,
   consum & facturare. Același limbaj vizual ca restul consolei (prefix cs-).
   ============================================================================ */

/* ─── Panoul „🔌 Acțiuni” din conversație ────────────────────────────────── */

/* Panou colapsabil (<details>) — discret când e închis */
.cs-conn-panel {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    padding: 0;
}
.cs-conn-panel > .cs-conn-chips,
.cs-conn-panel > .cs-conn-form {
    margin: 0 12px 10px;
}
.cs-conn-panel > .cs-conn-chips + .cs-conn-form { margin-top: 8px; }
.cs-conn-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
summary.cs-conn-title {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: color var(--transition-fast);
}
summary.cs-conn-title::-webkit-details-marker { display: none; }
summary.cs-conn-title:hover { color: var(--tk-teal-700, #0e7490); }
summary.cs-conn-title:focus-visible {
    outline: 2px solid var(--tk-teal-600, #0891b2);
    outline-offset: -2px;
    border-radius: var(--border-radius-sm, 8px);
}
.cs-conn-caret {
    font-size: 10px;
    transition: transform var(--transition-fast);
}
.cs-conn-panel[open] .cs-conn-caret { transform: rotate(90deg); }
.cs-conn-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cs-conn-chip {
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}
.cs-conn-chip:hover { background: var(--tk-teal-50, #ecfeff); color: var(--tk-teal-700, #0e7490); }
.cs-conn-chip.active {
    background: var(--tk-teal-600, #0891b2);
    border-color: var(--tk-teal-600, #0891b2);
    color: #fff;
}

.cs-conn-form {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cs-conn-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Rezultat conector: key-value + JSON brut ───────────────────────────── */

.cs-kv {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    overflow: hidden;
    background: #fff;
}
.cs-kv-row {
    display: flex;
    border-bottom: 1px solid var(--gray-100);
    font-size: 12.5px;
}
.cs-kv-row:last-child { border-bottom: none; }
.cs-kv-key {
    flex: 0 0 40%;
    max-width: 220px;
    padding: 6px 10px;
    background: var(--gray-50);
    color: var(--gray-500);
    font-weight: 600;
    word-break: break-word;
}
.cs-kv-val {
    flex: 1;
    padding: 6px 10px;
    color: var(--gray-800);
    word-break: break-word;
}

.cs-conn-pre {
    margin: 0;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    padding: 10px;
    font-size: 11.5px;
    line-height: 1.5;
    max-height: 240px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ─── Administrare conectori (Setări): caseta de test sub rând ───────────── */

.cs-conn-test-box {
    border: 1px dashed var(--gray-300);
    border-radius: var(--border-radius-sm, 8px);
    padding: 10px 12px;
    margin: -2px 0 8px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ─── Cod inline (chei publice, secrete) + caseta „secret o singură dată” ── */

.cs-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    background: var(--gray-100);
    border-radius: 4px;
    padding: 1px 6px;
    word-break: break-all;
}

.cs-secret-box {
    background: var(--warning-bg, #fef3c7);
    border: 1px solid var(--warning, #f59e0b);
    border-radius: var(--border-radius-sm, 8px);
    padding: 12px 14px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: #78350f;
}
.cs-secret-title { font-weight: 700; }
.cs-secret-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cs-secret-row .cs-code { background: #fff; }

/* ─── Consum & facturare ─────────────────────────────────────────────────── */

.cs-billing-total {
    background: var(--tk-teal-50, #ecfeff);
    border-color: var(--tk-teal-100, #cffafe);
}
.cs-billing-total .cs-stat-value { color: var(--tk-teal-700, #0e7490); }

/* ═══ VAL 3: tag-uri, SLA, WhatsApp, istoric client, program de lucru ═════ */

/* ─── Badge-uri noi ──────────────────────────────────────────────────────── */

.cs-sla-badge {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    font-weight: 700;
}
.cs-wa-badge {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* ─── Val 2: coada după așteptare, fragment de căutare, prioritate editabilă ─ */

/* „⏳ așteaptă de X” — culoarea față de pragul SLA de răspuns */
.cs-wait { font-weight: 600; }
.cs-wait-neutral { background: var(--gray-100, #f3f4f6); color: var(--gray-700, #374151); border: 1px solid var(--gray-200, #e5e7eb); }
.cs-wait-ok { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.cs-wait-warn { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.cs-wait-late { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; font-weight: 700; }

/* fragmentul din mesaje care a potrivit căutarea */
.cs-ticket-match {
    font-size: 12px;
    color: var(--gray-600, #4b5563);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
}
.cs-ticket-match mark { background: #fef08a; color: inherit; padding: 0 1px; border-radius: 2px; font-style: normal; }

/* selectul de prioritate din bara laterală — marginea stângă = culoarea priorității */
.cs-pr-select { border-left-width: 4px; }
.cs-pr-sel-low { border-left-color: var(--gray-300, #d1d5db); }
.cs-pr-sel-normal { border-left-color: var(--tk-teal-600, #0891b2); }
.cs-pr-sel-high { border-left-color: #f59e0b; }
.cs-pr-sel-urgent { border-left-color: #dc2626; }

/* ─── Tag-uri: chips + editor ────────────────────────────────────────────── */

.cs-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cs-tags-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.cs-tags-row:empty { display: none; margin: 0; }
.cs-tag-edit { padding-right: 4px; }
.cs-tag-x {
    border: none;
    background: transparent;
    color: var(--gray-400);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.cs-tag-x:hover { color: var(--danger, #dc2626); }
.cs-tag-add { display: inline-flex; }
.cs-tag-input {
    height: 24px;
    font-size: 11.5px;
    padding: 2px 8px;
    width: 110px;
    border-radius: 999px;
}

/* ─── ✨ Sugerează răspuns ───────────────────────────────────────────────── */

.cs-suggest-btn {
    background: #f3e8ff;
    border-color: #e9d5ff;
    color: #6b21a8;
    white-space: nowrap;
}
.cs-suggest-btn:hover:not(:disabled) { background: #ede0fe; }

/* ─── Linii de evenimente în cronologie (transfer, SLA, auto-close, taguri) */

.cs-event-line .cs-msg-bubble { font-style: italic; }
.cs-ev-sla_breach .cs-msg-bubble { color: #b91c1c; font-weight: 600; font-style: normal; }
.cs-ev-transferred .cs-msg-bubble { color: var(--gray-600); }

/* ─── 📋 Istoric client ──────────────────────────────────────────────────── */

.cs-history-panel {
    margin-top: 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    max-height: 220px;
    overflow-y: auto;
}
.cs-history-title {
    font-weight: 700;
    font-size: 12.5px;
    color: var(--gray-700);
}
.cs-history-sub {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-400);
}
.cs-history-line { color: var(--gray-600); }
.cs-history-link {
    color: var(--tk-teal-700, #0e7490);
    cursor: pointer;
    text-decoration: underline;
}
.cs-history-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 6px;
    border-radius: 6px;
    color: var(--gray-700);
    cursor: pointer;
    min-width: 0;
}
a.cs-history-item:hover { background: var(--gray-100); }
.cs-history-order { cursor: default; }
.cs-history-subj {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cs-history-total { font-weight: 600; white-space: nowrap; }
.cs-history-when {
    color: var(--gray-400);
    font-size: 11px;
    white-space: nowrap;
}

/* ─── Setări: subtitluri + editor program de lucru ───────────────────────── */

.cs-settings-subtitle {
    margin: 14px 0 2px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    font-size: 13.5px;
    color: var(--gray-800);
}
.cs-bh-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
}
.cs-bh-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cs-bh-day {
    width: 72px;
    flex-shrink: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-600);
}
.cs-bh-input { flex: 1; font-size: 12.5px; }

/* ═══ REDESIGN 2026-07 — limbaj vizual unificat cu modulul Task-uri ════════
   (scala --tk-teal-* e definită pe :root în css/tasks-modern.css; toate
   folosirile de aici au fallback hex, deci consola merge și fără acel fișier) */

/* ─── Focus vizibil pe elementele interactive (accesibilitate tastatură) ─── */

.cs-btn:focus-visible,
.cs-tab:focus-visible,
.cs-conn-chip:focus-visible,
.cs-tag-x:focus-visible,
.cs-suggest-btn:focus-visible {
    outline: 2px solid var(--tk-teal-600, #0891b2);
    outline-offset: 2px;
}
.cs-check input[type="checkbox"] { accent-color: var(--tk-teal-600, #0891b2); }

/* ─── Toggle „📌 Notă" ca chip cu stare activă (progresiv, via :has) ──────── */

.cs-note-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    min-height: 32px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast),
                color var(--transition-fast);
}
.cs-note-toggle:hover { border-color: var(--gray-300); }
.cs-note-toggle:has(input:checked) {
    background: var(--warning-bg, #fef3c7);
    border-color: var(--warning, #f59e0b);
    color: #92400e;
}
.cs-note-toggle input { accent-color: var(--warning, #f59e0b); }

/* ─── Skeleton shimmer: listă tichete + conversație ──────────────────────── */

.cs-skel-card {
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    margin-bottom: 8px;
    background: #fff;
}
.cs-skel-line {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg,
        var(--gray-100, #f3f4f6) 25%,
        var(--gray-200, #e5e7eb) 50%,
        var(--gray-100, #f3f4f6) 75%);
    background-size: 200% 100%;
    animation: cs-shimmer 1.4s ease infinite;
    margin-bottom: 8px;
}
.cs-skel-line:last-child { margin-bottom: 0; }
.cs-skel-chip { width: 120px; height: 16px; border-radius: 999px; }

.cs-skel-conv {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}
.cs-skel-bubble {
    height: 38px;
    border-radius: 14px;
    background: linear-gradient(90deg,
        var(--gray-100, #f3f4f6) 25%,
        var(--gray-200, #e5e7eb) 50%,
        var(--gray-100, #f3f4f6) 75%);
    background-size: 200% 100%;
    animation: cs-shimmer 1.4s ease infinite;
}
.cs-skel-bubble.left  { align-self: flex-start; border-bottom-left-radius: 4px; }
.cs-skel-bubble.right { align-self: flex-end; border-bottom-right-radius: 4px; }

@keyframes cs-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .cs-skel-line, .cs-skel-bubble { animation: none; }
}

/* ─── Mobil ≤900px: ținte de atingere ≥44px ──────────────────────────────── */

@media (max-width: 900px) {
    .cs-btn { min-height: 44px; }
    .cs-btn-sm { min-height: 40px; }
    .cs-tab { min-height: 44px; }
    .cs-select,
    .cs-input { min-height: 44px; }
    .cs-tag-input { min-height: 32px; height: auto; }
    .cs-note-toggle { min-height: 40px; }
    .cs-reply { align-items: flex-end; }
    .cs-reply .cs-textarea { min-height: 44px; }
    .cs-conv-actions .cs-select { flex: 1 1 40%; }
    .cs-modal-actions .cs-btn { flex: 1 1 auto; }
}

/* ═══ FAZA 3 — responsive pentru layout-urile noi (rapoarte + composer) ═══ */

@media (max-width: 900px) {
    /* KPI pe 2 coloane pe mobil */
    .cs-stats-grid { grid-template-columns: 1fr 1fr; }

    /* bara de perioadă: inputurile de dată împart rândul, Aplică full-width */
    .cs-period-bar label { flex: 1 1 40%; }
    .cs-period-bar .cs-quick-chips { flex: 1 1 100%; }
    .cs-period-bar #csStatsApply { flex: 1 1 100%; }

    /* headerul conversației: grupurile de acțiuni pe rânduri curate */
    .cs-conv-actions { justify-content: flex-start; }
    .cs-conv-actions-group { flex: 1 1 100%; }
    .cs-conv-actions-group .cs-select { flex: 1 1 40%; }

    /* composer: toolbar-ul se comprimă, Trimite rămâne complet vizibil */
    .cs-composer-bar { padding: 8px; }
    .cs-send-btn { min-height: 44px; }
}

@media (max-width: 480px) {
    .cs-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .cs-stat-value { font-size: 17px; }

    /* Trimite full-width sub unelte, la ecrane foarte înguste */
    .cs-reply-tools { flex: 1 1 100%; }
    .cs-send-btn { flex: 1 1 100%; margin-left: 0; }
}

/* ─── Prezență reală: bandă + dialog de inactivitate ──────────────────────────
   Banda e PERMANENTĂ (nu un pop-up): rămâne vizibilă exact cât operatorul nu e
   disponibil, fiindcă un dialog repetat e închis reflex și nu mai schimbă nimic.
   Dialogul apare doar la depășirea pragului configurat în Setări. */

.cs-presence-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--warning, #f59e0b);
    border-left: 4px solid var(--warning, #f59e0b);
    border-radius: var(--border-radius, 12px);
    background: #fffbeb;
    color: var(--gray-800);
    font-size: 13px;
    line-height: 1.45;
}
.cs-presence-banner-icon { font-size: 16px; line-height: 1; }
/* textul ia spațiul rămas; butonul nu se comprimă */
.cs-presence-banner > span:not(.cs-presence-banner-icon) { flex: 1 1 240px; min-width: 0; }
.cs-presence-banner .cs-btn { flex: 0 0 auto; }

.cs-presence-modal { max-width: 440px; }
.cs-presence-why {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--gray-700);
}
.cs-presence-count {
    margin: 6px 0 2px;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    color: var(--warning, #f59e0b);
    font-variant-numeric: tabular-nums;  /* cifrele nu mai „sar" la fiecare secundă */
}
.cs-presence-count-note {
    text-align: center;
    font-size: 12px;
    color: var(--gray-500);
}

@media (max-width: 900px) {
    .cs-presence-banner { padding: 10px; font-size: 12.5px; }
    /* pe mobil butonul trece pe rândul lui, la lățime completă (țintă ≥44px) */
    .cs-presence-banner .cs-btn { flex: 1 1 100%; }
}

/* ─── Mobil ≤600px: bară de sus a consolei compactată ─────────────────────────
   Scop: pe telefoane (~375px) bara ocupa 4 randuri (taburi rupte pe 2 + controale
   + „Tichet nou"). O comprimam la IDEAL 2 randuri: taburile pe UN rand (cu scroll
   orizontal la nevoie) + controalele pe un rand compact. Desktopul (>600px) e
   neatins. Nimic ascuns; toate tintele raman ≥36px inaltime.
   NB: acest bloc e ULTIMUL din fisier, deci suprascrie corect min-height-urile de
   44px din blocul @media (max-width:900px) de mai sus. */
@media (max-width: 600px) {
    .cs-topbar {
        gap: 8px;
        padding: 8px;
        margin-bottom: 12px;
    }

    /* Cele 3 taburi pe un SINGUR rand; daca nu incap → scroll orizontal, nu wrap. */
    .cs-topbar .cs-tabs {
        flex: 1 1 100%;
        min-width: 0;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;               /* Firefox: ascunde bara de scroll */
    }
    .cs-topbar .cs-tabs::-webkit-scrollbar { display: none; }  /* WebKit */

    .cs-topbar .cs-tab {
        flex: 0 0 auto;                      /* nu se comprima; ies din scroll */
        padding: 6px 10px;
        font-size: 13px;
        min-height: 36px;                    /* tinta de atingere confortabila */
        white-space: nowrap;
    }
    .cs-topbar .cs-tab-badge { margin-left: 4px; }

    /* Controalele din dreapta (tenant + prezenta + clopotei + „Tichet nou")
       pe un rand compact, sub taburi. Containerul are style inline; il tintim ca
       „singurul copil direct al topbar-ului care NU e .cs-tabs". */
    .cs-topbar > div:not(.cs-tabs) {
        flex: 1 1 100%;
        gap: 6px !important;                 /* bate gap-ul inline de 8px */
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .cs-topbar .cs-presence {
        padding: 3px 8px;
        gap: 6px;
        font-size: 12px;
    }
    .cs-topbar .cs-presence select { font-size: 12px; }

    .cs-topbar .cs-cue-toggles { gap: 4px; }
    .cs-topbar .cs-cue-btn { width: 32px; height: 32px; }

    /* „Tichet nou" compact: padding mic + font mai mic, dar apasabil (≥36px). */
    .cs-topbar #csNewTicketBtn {
        min-height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* ═══ Setări → acordeon pe capitole ═══════════════════════════════════════════
   Fiecare capitol e o secțiune pliabilă. Câmpurile/ID-urile rămân neschimbate —
   asta e doar ambalajul vizual (vezi csAccItem în console.js). Colapsarea se face
   cu display:none pe corp: elementele rămân în DOM, deci salvarea (care citește
   prin getElementById) funcționează și când capitolul e închis. */

.cs-settings-shell .cs-acc-intro { margin: 0 0 12px; }

.cs-acc {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cs-acc-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    background: #fff;
    overflow: hidden;
    transition: border-color var(--transition-fast, 0.15s), box-shadow var(--transition-fast, 0.15s);
}
.cs-acc-item.cs-acc-open {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}
.cs-acc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 0;
    background: var(--gray-50);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--gray-800);
    transition: background var(--transition-fast, 0.15s);
}
.cs-acc-head:hover { background: var(--gray-100); }
.cs-acc-item.cs-acc-open > .cs-acc-head {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
}
.cs-acc-head:focus-visible {
    outline: 2px solid var(--tk-teal-600, #0891b2);
    outline-offset: -2px;
}
.cs-acc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    min-width: 0;
}
.cs-acc-ico { font-size: 16px; line-height: 1; flex: 0 0 auto; }
.cs-acc-chevron {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--gray-500);
    border-bottom: 2px solid var(--gray-500);
    transform: rotate(-45deg);           /* ▸ închis */
    transition: transform var(--transition-fast, 0.15s);
    margin-right: 2px;
}
.cs-acc-item.cs-acc-open > .cs-acc-head .cs-acc-chevron {
    transform: rotate(45deg);            /* ▾ deschis */
}
.cs-acc-body { display: none; }
.cs-acc-item.cs-acc-open > .cs-acc-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
}
/* Bara de salvare a setărilor — mereu vizibilă, sub capitole. */
.cs-settings-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .cs-acc-item, .cs-acc-head, .cs-acc-chevron { transition: none; }
}

/* ═══ Rapoarte → design + responsive ══════════════════════════════════════════
   Structura HTML e neschimbată (aceleași carduri/clase/gating). Aici doar rafinăm
   ierarhia vizuală și curgerea pe mobil, folosind tokenii existenți. */

/* Antet de card de raport cu accent discret. */
.cs-report-card > h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-100);
}
/* Bara de perioadă „card": aliniere curată a filtrelor. */
.cs-period-bar.cs-period-card {
    align-items: flex-end;
    gap: 12px;
}
.cs-period-bar .cs-input,
.cs-period-bar .cs-select { min-width: 0; }
.cs-period-bar .cs-quick-chips { align-self: flex-end; }

/* Grupuri KPI: titlu de grup + tile-uri cu accent pe valoare. */
.cs-stat-card {
    position: relative;
    border-left: 3px solid var(--tk-teal-600, #0891b2);
}
.cs-stat-card.cs-stat-empty { border-left-color: var(--gray-300); }

/* Tabelul pe zile: scroll orizontal deja gestionat de .cs-table-wrap;
   îi dăm un pic de aer sub grupurile de KPI. */
.cs-stats-groups + .cs-table-wrap,
.cs-report-card .cs-table-wrap { margin-top: 12px; }

/* ── Tabletă/telefon mare (≤900px): deja tratat parțial mai sus; completăm. ── */
@media (max-width: 900px) {
    .cs-period-bar.cs-period-card { gap: 10px; }
    .cs-period-bar.cs-period-card label { flex: 1 1 45%; }
    .cs-period-bar.cs-period-card .cs-quick-chips { flex: 1 1 100%; }
    .cs-period-bar.cs-period-card #csStatsApply { flex: 1 1 100%; }
}

/* ── Telefon (≤600px): un singur flux, filtre pe rânduri, KPI 1 coloană. ── */
@media (max-width: 600px) {
    /* Filtrele fiecare pe rândul lui, full-width, ținte de atingere confortabile. */
    .cs-period-bar.cs-period-card { flex-direction: column; align-items: stretch; gap: 10px; }
    .cs-period-bar.cs-period-card label { flex: 1 1 100%; }
    .cs-period-bar.cs-period-card .cs-input,
    .cs-period-bar.cs-period-card .cs-select { width: 100%; }
    .cs-period-bar.cs-period-card .cs-quick-chips { justify-content: space-between; }
    .cs-period-bar.cs-period-card .cs-quick { flex: 1 1 auto; text-align: center; }
    .cs-period-bar.cs-period-card #csStatsApply { width: 100%; }

    /* KPI: pe telefoanele reale (~375px) curg pe 1 coloană; pe ecrane spre 600px
       încă încap 2 fără a se înghesui. */
    .cs-stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }

    /* Filtrele din cardul „Echipă" (operator / sursă) tot pe coloană. */
    .cs-report-card .cs-period-bar:not(.cs-period-card) { flex-direction: column; align-items: stretch; }
    .cs-report-card .cs-period-bar:not(.cs-period-card) label { flex: 1 1 100%; }
    .cs-report-card .cs-period-bar:not(.cs-period-card) .cs-select { width: 100%; }

    /* Capitolele de setări: antet mai aerisit, corp cu padding puțin mai mic. */
    .cs-acc-head { padding: 12px; }
    .cs-acc-item.cs-acc-open > .cs-acc-body { padding: 12px; }
    .cs-settings-actions #csSetSave { flex: 1 1 100%; }
}

/* ─── Val 2 D: prezența pe tichet, scurtături, focus tastatură ─────────────── */

/* Banda „⚠️ Alt operator lucrează aici: Ana vizualizează · Mihai scrie…" din
   antetul conversației. Galben discret; devine mai insistentă când cineva scrie. */
.cs-ticket-presence {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-top: 8px;
    padding: 6px 10px;
    border: 1px solid var(--warning, #f59e0b);
    border-left-width: 4px;
    border-radius: 8px;
    background: #fffbeb;
    color: var(--gray-800, #1f2937);
    font-size: 12.5px;
    line-height: 1.4;
}
.cs-ticket-presence[hidden] { display: none; }
.cs-ticket-presence.cs-tp-typing { background: #fef3c7; border-color: #d97706; }
.cs-ticket-presence .cs-tp-label { font-weight: 600; }
.cs-ticket-presence .cs-tp-sep { color: var(--gray-400, #9ca3af); }

/* Cardurile de tichet sunt focalizabile (role=button, tabindex=0). */
.cs-ticket-card:focus { outline: none; }
.cs-ticket-card:focus-visible {
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: -2px;
}

/* Panoul „?" cu scurtăturile. */
.cs-shortcuts-modal { max-width: 480px; }
.cs-shortcuts-hint { margin: 0 0 10px; font-size: 12.5px; color: var(--gray-500, #6b7280); }
.cs-shortcuts-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cs-shortcuts-table td { padding: 6px 4px; border-bottom: 1px solid var(--gray-100, #f3f4f6); vertical-align: top; }
.cs-shortcuts-table td:first-child { white-space: nowrap; padding-right: 12px; }
.cs-shortcuts-table kbd {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    border: 1px solid var(--gray-300, #d1d5db);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--gray-50, #f9fafb);
    font-family: inherit;
    font-size: 12px;
    text-align: center;
}
/* ─── Linkuri, atașamente, bife, „scrie…" (migrarea 391) ─────────────────── */
.cs-msg-bubble a { color: inherit; text-decoration: underline; word-break: break-all; }
.cs-msg.visitor .cs-msg-bubble a { color: var(--tk-teal-600, #0891b2); }
.cs-receipt { text-align: right; margin-top: 2px; line-height: 1; }
.cs-tick { font-size: 11px; letter-spacing: -2px; opacity: .75; white-space: nowrap; }
.cs-tick-read { color: #bae6fd; opacity: 1; font-weight: 700; }
.cs-tick-failed { color: #fecaca; opacity: 1; letter-spacing: 0; }
.cs-att-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; white-space: normal; }
.cs-att { display: inline-block; text-decoration: none !important; }
.cs-att-img img {
    display: block;
    max-width: 260px;
    max-height: 220px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .06);
    min-width: 60px;
    min-height: 40px;
    cursor: zoom-in;
}
.cs-att-file {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .12);
    background: rgba(255, 255, 255, .9);
    color: var(--gray-800, #1f2937) !important;
    font-size: 12.5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cs-visitor-typing {
    align-self: flex-start;
    font-size: 12px;
    font-style: italic;
    color: var(--gray-500, #6b7280);
    padding: 0 6px;
}
.cs-conv-main.cs-drop-active { outline: 2px dashed var(--tk-teal-600, #0891b2); outline-offset: -6px; }
#csAttachBtn[disabled] { opacity: .45; cursor: not-allowed; }

/* ─── Val 2-B: compozitor (ciornă, notă internă, plafon), editare, citare ── */

/* Acțiuni pe mesaj: Citează / Editează (același comportament ca „Șterge") */
.cs-msg-act {
    background: none;
    border: none;
    padding: 0 0 0 6px;
    margin: 0;
    font-size: 11px;
    color: var(--gray-400);
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
}
.cs-msg:hover .cs-msg-act,
.cs-msg-act:focus-visible { opacity: 1; }
.cs-msg-act:hover { color: var(--tk-teal-600, #0891b2); text-decoration: underline; }
.cs-msg-act.cs-msg-act-disabled { cursor: help; text-decoration: line-through; }
.cs-msg-act.cs-msg-act-disabled:hover { color: var(--gray-500); }
@media (hover: none) { .cs-msg-act { opacity: .8; } }

.cs-edited-mark {
    font-size: 11px;
    font-style: italic;
    color: var(--gray-400);
    margin-left: 4px;
    cursor: help;
}

/* „✎ ciornă" pe cardul tichetului cu răspuns început și netrimis */
.cs-draft-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    background: var(--warning-bg, #fef3c7);
    color: #92400e;
    vertical-align: middle;
}

/* ciorna e o NOTĂ internă (rămâne notă la revenire, nu pleacă la client) */
.cs-draft-badge.cs-draft-badge-note {
    border: 1px dashed #d97706;
}

/* Mod „Notă internă": compozitor clar diferențiat (galben + etichetă) */
.cs-note-banner {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #92400e;
    background: #fde68a;
    border-bottom: 1px solid #fcd34d;
}
.cs-note-banner[hidden] { display: none; }
.cs-composer.cs-composer-note {
    border-color: var(--warning, #f59e0b);
    background: #fffbeb;
}
.cs-composer.cs-composer-note:focus-within {
    border-color: var(--warning, #f59e0b);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}
.cs-composer.cs-composer-note .cs-textarea,
.cs-composer.cs-composer-note .cs-composer-bar { background: #fffbeb; }
.cs-composer.cs-composer-note .cs-send-btn {
    background: var(--warning, #f59e0b);
    border-color: var(--warning, #f59e0b);
    color: #fff;
}

/* Contor de caractere (plafon din messageLimits) */
.cs-char-count {
    font-size: 11px;
    color: var(--gray-400);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    margin-left: auto;
}
.cs-char-count.cs-char-warn { color: #b45309; font-weight: 600; }
.cs-char-count.cs-char-over { color: var(--danger, #dc2626); font-weight: 700; }
.cs-send-btn.cs-send-over { opacity: .6; }
.cs-char-count + .cs-send-btn { margin-left: 8px; }

/* Popup răspunsuri predefinite: selecție cu tastatura + căutare + hint */
.cs-canned-item.active { background: var(--tk-teal-50, #ecfeff); outline: 1px solid var(--tk-teal-600, #0891b2); }
.cs-canned-search { width: 100%; margin-bottom: 6px; }
.cs-canned-hint {
    padding: 4px 6px 0;
    font-size: 10.5px;
    color: var(--gray-400);
    border-top: 1px solid var(--gray-100);
    margin-top: 4px;
}

/* Modalul de editare */
.cs-edit-textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 8px 10px;
    line-height: 1.4;
}

/* ═══ REDESIGN 2026-10 — detaliul tichetului (Suport Clienți) ═════════════════
   Totul e limitat la #chatSupportRoot / clase cs-*. Ordinea contează: blocul e
   ULTIMUL din fișier, deci suprascrie regulile mai vechi de mai sus.
   - #chatSupportRoot.cs-ticket-open: titlul paginii ascuns + bară compactă;
   - --cs-panel-offset (măsurat în JS, syncCsHeight) → panourile umplu viewport-ul;
   - chip-uri acordeon pentru Context / Istoric / Acțiuni conectori;
   - compozitor pe un singur rând de unelte + popover ⚙ „tasta de trimitere";
   - coloana din dreapta pe taburi; foaie de jos pe mobil;
   - fir: separatoare de zi, grupare, bule mai aerisite. */

#chatSupportRoot {
    --cs-s1: 4px;
    --cs-s2: 8px;
    --cs-s3: 12px;
    --cs-s4: 16px;
    --cs-r1: 8px;
    --cs-r2: 12px;
    --cs-r3: 16px;
    --cs-line: var(--gray-200, #e5e7eb);
    --cs-accent: var(--tk-teal-600, #0891b2);
    --cs-accent-700: var(--tk-teal-700, #0e7490);
    --cs-accent-50: var(--tk-teal-50, #ecfeff);
    --cs-thread-bg: #f8fafc;
    --cs-side-bg: #fbfcfd;
    --cs-ai-bg: #f5f3ff;
    --cs-ai-line: #ddd6fe;
    --cs-ai-ink: #4c1d95;
    --cs-note-bg: #fffbeb;
    --cs-note-line: var(--warning, #f59e0b);
    --cs-note-ink: #78350f;
    --cs-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --cs-dur: 0.18s;
    /* Rezerva când JS-ul n-a măsurat încă (sau rulează fără el). */
    --cs-panel-h: calc(100vh - var(--cs-panel-offset, 190px));
}
@supports (height: 100dvh) {
    #chatSupportRoot { --cs-panel-h: calc(100dvh - var(--cs-panel-offset, 190px)); }
}

/* Elementele noi ascunse cu atributul `hidden` (clasele lor setează display). */
#chatSupportRoot .cs-aux-bar[hidden],
#chatSupportRoot .cs-aux-chip[hidden],
#chatSupportRoot .cs-aux-warn[hidden],
#chatSupportRoot .cs-filters-more[hidden],
#chatSupportRoot .cs-filters-count[hidden],
#chatSupportRoot .cs-side-tab[hidden],
#chatSupportRoot .cs-sendkey-pop[hidden] { display: none !important; }

/* ─── 1. Pagina cu tichet deschis: titlu ascuns, bară compactă ───────────── */

#chatSupportRoot.cs-ticket-open > .cs-page-header { display: none; }

#chatSupportRoot .cs-topbar {
    border-width: 1px;
    border-color: var(--cs-line);
    transition: padding var(--cs-dur) var(--cs-ease), margin var(--cs-dur) var(--cs-ease);
}
#chatSupportRoot.cs-ticket-open .cs-topbar {
    padding: 6px 8px;
    margin-bottom: 10px;
    gap: 8px;
    box-shadow: none;
}
#chatSupportRoot.cs-ticket-open .cs-topbar .cs-tabs { gap: 6px; }
#chatSupportRoot.cs-ticket-open .cs-topbar .cs-tab {
    min-height: 34px;
    padding: 5px 12px;
    font-size: 13px;
}
#chatSupportRoot.cs-ticket-open .cs-topbar .cs-btn {
    min-height: 34px;
    height: 34px;
    padding: 0 10px;
    box-sizing: border-box;
    line-height: 1;
}
#chatSupportRoot.cs-ticket-open .cs-topbar .cs-presence { height: 34px; box-sizing: border-box; }
#chatSupportRoot.cs-ticket-open .cs-topbar .cs-cue-btn { width: 32px; height: 32px; }
#chatSupportRoot.cs-ticket-open .cs-topbar-tools { gap: 6px !important; }

/* Prezență + capacitate = o singură pastilă (ambele selecturi rămân). */
#chatSupportRoot .cs-presence { gap: 6px; padding: 3px 10px; min-height: 32px; }
/* light-theme.css impune padding/chenar/fundal cu !important pe ORICE select —
   în pastilă selecturile trebuie să fie „text", nu câmpuri cu chenar. */
#chatSupportRoot .cs-presence select {
    padding: 2px 2px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    min-height: 0;
    height: 26px;
}
#chatSupportRoot .cs-presence-cap-sep { color: var(--gray-300); }
#chatSupportRoot #csCapacitySelect { font-weight: 600; color: var(--gray-600); }
#chatSupportRoot .cs-presence:focus-within {
    border-color: var(--cs-accent);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

/* ─── 2. Înălțime: panourile umplu viewport-ul ──────────────────────────── */

#chatSupportRoot .cs-layout {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 12px;
}
#chatSupportRoot .cs-conv-panel.cs-conv-split { grid-template-columns: minmax(0, 1fr) minmax(250px, 290px); }
/* Ecrane desktop înguste (≤1680px, cu meniul aplicației în stânga): coloane
   laterale mai suple ca firul + compozitorul să aibă loc. */
@media (min-width: 901px) and (max-width: 1680px) {
    #chatSupportRoot .cs-layout { grid-template-columns: minmax(240px, 290px) minmax(0, 1fr); }
    #chatSupportRoot .cs-conv-panel.cs-conv-split { grid-template-columns: minmax(0, 1fr) minmax(230px, 260px); }
}
#chatSupportRoot .cs-list-panel,
#chatSupportRoot .cs-conv-panel {
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-r2);
}
@media (min-width: 901px) {
    #chatSupportRoot .cs-list-panel,
    #chatSupportRoot .cs-conv-panel {
        height: var(--cs-panel-h);
        min-height: 420px;
        max-height: none;
    }
}

/* ─── 10. Filtre: căutare mereu vizibilă + rând pliabil ────────────────── */

#chatSupportRoot .cs-filters {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px;
}
#chatSupportRoot .cs-filters-top {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
#chatSupportRoot .cs-filters-top .cs-input { flex: 1 1 auto; min-width: 0; width: auto; }
#chatSupportRoot .cs-filters-toggle { flex: 0 0 auto; gap: 4px; }
#chatSupportRoot .cs-filters-toggle.active,
#chatSupportRoot .cs-filters-toggle.cs-filters-on {
    border-color: var(--cs-accent);
    color: var(--cs-accent-700);
    background: var(--cs-accent-50);
}
#chatSupportRoot .cs-filters-count {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--cs-accent);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 16px;
}
#chatSupportRoot .cs-filters-more {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    animation: cs-fade-in var(--cs-dur) var(--cs-ease);
}

/* ─── 7. Mod concentrare (desktop) ─────────────────────────────────────── */

@media (min-width: 901px) {
    #chatSupportRoot .cs-layout.conv-open.cs-focus-list { grid-template-columns: minmax(0, 1fr); }
    #chatSupportRoot .cs-layout.conv-open.cs-focus-list .cs-list-panel { display: none; }
    #chatSupportRoot .cs-layout.cs-focus-side .cs-conv-panel.cs-conv-split { grid-template-columns: minmax(0, 1fr); }
    #chatSupportRoot .cs-layout.cs-focus-side .cs-conv-split .cs-conv-sidebar { display: none; }
}

/* ─── 3. Antetul conversației: compact ─────────────────────────────────── */

#chatSupportRoot .cs-conv-header {
    padding: 8px 12px;
    gap: 6px;
    background: #fff;
}
#chatSupportRoot .cs-conv-title-row {
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
}
#chatSupportRoot .cs-conv-title {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    line-height: 1.3;
}
#chatSupportRoot .cs-conv-title-row .cs-badge { flex-shrink: 0; }

#chatSupportRoot .cs-hdr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 0 0 auto;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-r1);
    background: #fff;
    color: var(--gray-600);
    font-family: inherit;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    transition: background var(--cs-dur) var(--cs-ease), color var(--cs-dur) var(--cs-ease),
                border-color var(--cs-dur) var(--cs-ease);
}
#chatSupportRoot .cs-hdr-btn:hover { background: var(--cs-accent-50); color: var(--cs-accent-700); }
#chatSupportRoot .cs-hdr-btn[aria-pressed="true"],
#chatSupportRoot .cs-hdr-btn.active {
    background: var(--cs-accent-50);
    border-color: var(--cs-accent);
    color: var(--cs-accent-700);
}
#chatSupportRoot .cs-hdr-btn:focus-visible,
#chatSupportRoot .cs-aux-chip:focus-visible,
#chatSupportRoot .cs-side-tab:focus-visible,
#chatSupportRoot .cs-sheet-x:focus-visible {
    outline: 2px solid var(--cs-accent);
    outline-offset: 2px;
}
#chatSupportRoot .cs-hdr-btn-label { display: none; font-size: 12.5px; font-weight: 600; }
#chatSupportRoot .cs-side-toggle-btn { margin-left: 2px; }

/* Rândul „client" + chip-urile: o linie discretă care se rupe doar la nevoie. */
#chatSupportRoot .cs-conv-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    min-width: 0;
}
#chatSupportRoot .cs-client-block {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}
#chatSupportRoot .cs-client-card {
    gap: 2px 8px;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--gray-500);
}
#chatSupportRoot .cs-client-sep { color: var(--gray-300); }
#chatSupportRoot .cs-client-card #csCallReqBtn {
    min-height: 24px;
    padding: 1px 8px;
    font-size: 11.5px;
    border-radius: 999px;
}

/* ─── 4. Chip-uri acordeon: Context / Istoric / Acțiuni ─────────────────── */

#chatSupportRoot .cs-aux-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 0 1 auto;
}
#chatSupportRoot .cs-aux-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--cs-line);
    border-radius: 999px;
    background: #fff;
    color: var(--gray-600);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    transition: background var(--cs-dur) var(--cs-ease), color var(--cs-dur) var(--cs-ease),
                border-color var(--cs-dur) var(--cs-ease);
}
#chatSupportRoot .cs-aux-chip::after {
    content: '▾';
    font-size: 10px;
    color: var(--gray-400);
    transition: transform var(--cs-dur) var(--cs-ease);
}
#chatSupportRoot .cs-aux-chip[aria-expanded="true"]::after { transform: rotate(180deg); color: inherit; }
#chatSupportRoot .cs-aux-chip:hover { background: var(--cs-accent-50); color: var(--cs-accent-700); }
#chatSupportRoot .cs-aux-chip.active {
    background: var(--cs-accent-50);
    border-color: var(--cs-accent);
    color: var(--cs-accent-700);
}
#chatSupportRoot .cs-aux-chip.cs-aux-chip-warn:not(.active) { border-color: #fcd34d; }
#chatSupportRoot .cs-aux-count { font-weight: 500; color: var(--gray-500); }
#chatSupportRoot .cs-aux-chip.active .cs-aux-count { color: inherit; }
#chatSupportRoot .cs-aux-warn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--warning, #f59e0b);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

/* Secțiunile rămân în DOM (loaderele le caută după id); doar cea deschisă se vede. */
#chatSupportRoot .cs-aux-sec:not(.cs-aux-open) { display: none; }
#chatSupportRoot .cs-aux-sec.cs-aux-open {
    max-height: 40vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-top: 2px;
    padding: 10px 12px;
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-r2);
    background: var(--gray-50, #f9fafb);
    animation: cs-fade-in var(--cs-dur) var(--cs-ease);
}
#chatSupportRoot .cs-aux-sec .cs-history-panel {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    max-height: none;
    overflow: visible;
}
/* Eticheta chip-ului ține loc de titlu — nu-l afișăm de două ori. */
#chatSupportRoot .cs-aux-sec .cs-history-title { display: none; }
#chatSupportRoot .cs-aux-sec .cs-history-sub:first-child { margin-top: 0; }
#chatSupportRoot .cs-aux-sec .cs-conn-panel { background: transparent; border: none; border-radius: 0; }
#chatSupportRoot .cs-aux-sec .cs-conn-panel > summary { display: none; }
#chatSupportRoot .cs-aux-sec .cs-conn-panel > .cs-conn-chips,
#chatSupportRoot .cs-aux-sec .cs-conn-panel > .cs-conn-form { margin: 0; }
#chatSupportRoot .cs-aux-sec .cs-conn-panel > .cs-conn-chips + .cs-conn-form { margin-top: 10px; }

/* Eroare REALĂ a unui panou de context: avertisment galben compact. */
#chatSupportRoot .cs-ctx-warn {
    margin: 2px 0 4px;
    padding: 5px 8px;
    border: 1px solid #fcd34d;
    border-left: 3px solid var(--warning, #f59e0b);
    border-radius: 6px;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* ─── 8. Firul de discuție ─────────────────────────────────────────────── */

#chatSupportRoot .cs-conv-body {
    padding: 16px 16px 12px;
    gap: 12px;
    background: var(--cs-thread-bg);
    box-shadow: none;
    scroll-behavior: auto;
}
#chatSupportRoot .cs-msg { max-width: min(72%, 680px); }
#chatSupportRoot .cs-msg.note { max-width: min(72%, 680px); }
#chatSupportRoot .cs-msg-bubble {
    padding: 9px 13px;
    border-radius: var(--cs-r3);
    font-size: 14px;
    line-height: 1.5;
}
#chatSupportRoot .cs-msg-meta { font-size: 11px; padding: 0 6px; }
#chatSupportRoot .cs-msg.visitor .cs-msg-bubble {
    border-color: var(--cs-line);
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
}
#chatSupportRoot .cs-msg.operator .cs-msg-bubble {
    background: var(--cs-accent);
    border-bottom-right-radius: 6px;
    box-shadow: 0 1px 2px rgba(8, 145, 178, 0.18);
}
#chatSupportRoot .cs-msg.operator .cs-msg-bubble a { color: #fff; text-decoration: underline; }
#chatSupportRoot .cs-msg.ai .cs-msg-bubble {
    background: var(--cs-ai-bg);
    border: 1px solid var(--cs-ai-line);
    color: var(--cs-ai-ink);
    border-bottom-right-radius: 6px;
}
#chatSupportRoot .cs-msg.note .cs-msg-bubble {
    background: var(--cs-note-bg);
    border: 1px dashed var(--cs-note-line);
    color: var(--cs-note-ink);
    border-bottom-right-radius: 6px;
}
#chatSupportRoot .cs-msg.cs-msg-deleted .cs-msg-bubble,
#chatSupportRoot .cs-msg.note.cs-msg-deleted .cs-msg-bubble {
    background: transparent;
    border: 1px dashed var(--gray-300, #d1d5db);
    color: var(--gray-500, #6b7280);
    box-shadow: none;
}

/* Mesaje consecutive ale aceluiași expeditor (≤ 5 min): spațiere strânsă,
   meta mai discretă (rămâne prezentă — acțiunile sunt în ea). */
#chatSupportRoot .cs-msg.cs-msg-grouped { margin-top: -8px; }
#chatSupportRoot .cs-msg.cs-msg-grouped .cs-msg-meta { opacity: 0.55; transition: opacity var(--cs-dur) var(--cs-ease); }
#chatSupportRoot .cs-msg.cs-msg-grouped:hover .cs-msg-meta,
#chatSupportRoot .cs-msg.cs-msg-grouped:focus-within .cs-msg-meta { opacity: 1; }
#chatSupportRoot .cs-msg.visitor.cs-msg-grouped .cs-msg-bubble { border-top-left-radius: 6px; }
#chatSupportRoot .cs-msg.operator.cs-msg-grouped .cs-msg-bubble,
#chatSupportRoot .cs-msg.ai.cs-msg-grouped .cs-msg-bubble { border-top-right-radius: 6px; }

/* Separator de zi: „Azi" / „Ieri" / „Joi, 02 oct." */
#chatSupportRoot .cs-day-sep {
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gray-500);
}
#chatSupportRoot .cs-day-sep::before,
#chatSupportRoot .cs-day-sep::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--cs-line);
}
#chatSupportRoot .cs-day-sep > span {
    padding: 2px 10px;
    border: 1px solid var(--cs-line);
    border-radius: 999px;
    background: #fff;
    white-space: nowrap;
}

#chatSupportRoot .cs-escalation-card {
    background: var(--cs-ai-bg);
    border-color: var(--cs-ai-line);
    border-radius: var(--cs-r2);
    color: var(--cs-ai-ink);
}
#chatSupportRoot .cs-trunc-note { border-radius: var(--cs-r2); }

/* ─── 5. Compozitor: un singur rând de unelte ──────────────────────────── */

#chatSupportRoot .cs-reply {
    padding: 8px 12px 10px;
    border-top: 1px solid var(--cs-line);
}
#chatSupportRoot .cs-composer {
    border-color: var(--gray-300);
    border-radius: var(--cs-r2);
}
#chatSupportRoot .cs-reply .cs-textarea {
    min-height: 44px;
    max-height: 200px; /* sincron cu auto-resize-ul din JS (renderConversation) */
    padding: 10px 12px 4px !important;    /* bate regula globală !important din light-theme */
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;   /* fundalul vine din .cs-composer (alb / galben la notă) */
    font-size: 14px;
    line-height: 1.45;
}
#chatSupportRoot .cs-composer-bar {
    gap: 6px;
    padding: 4px 6px 6px;
    border-top: none;
    background: transparent;
}
#chatSupportRoot .cs-composer.cs-composer-note .cs-composer-bar { background: #fffbeb; }
#chatSupportRoot .cs-reply-tools { gap: 4px; }
#chatSupportRoot .cs-reply-tools .cs-btn,
#chatSupportRoot .cs-composer-bar .cs-icon-btn {
    min-height: 32px;
    min-width: 32px;
    padding: 4px 8px;
    border-color: transparent;
    background: transparent;
    color: var(--gray-600);
}
#chatSupportRoot .cs-reply-tools .cs-btn:hover:not(:disabled),
#chatSupportRoot .cs-composer-bar .cs-icon-btn:hover {
    background: var(--gray-100);
    border-color: var(--cs-line);
}
#chatSupportRoot .cs-composer-bar .cs-icon-btn[aria-expanded="true"] {
    background: var(--cs-accent-50);
    border-color: var(--cs-accent);
    color: var(--cs-accent-700);
}
#chatSupportRoot .cs-reply-tools .cs-suggest-btn { color: #6d28d9; }
#chatSupportRoot .cs-note-toggle {
    min-height: 32px;
    height: 32px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 10px;
    font-size: 12px;
}
#chatSupportRoot .cs-note-toggle input {
    width: 14px;
    height: 14px !important;
    min-height: 0 !important;
    margin: 0;
    padding: 0 !important; /* light-theme dă padding !important oricărui input */
    flex: 0 0 auto;
}
#chatSupportRoot .cs-composer-spacer { flex: 1 1 auto; min-width: 4px; }
#chatSupportRoot .cs-composer-bar .cs-char-count { margin-left: 0; }
#chatSupportRoot .cs-composer-bar .cs-send-btn {
    margin-left: 0;
    min-height: 34px;
    padding: 6px 18px;
    border-radius: var(--cs-r1);
}
#chatSupportRoot .cs-char-count + .cs-send-btn { margin-left: 0; }

/* Coloana centrală îngustă (listă + detalii deschise pe un ecran mic):
   contorul apare doar când contează (peste 90% / peste plafon), ca rândul
   de unelte să rămână pe o singură linie. */
#chatSupportRoot .cs-conv-split .cs-conv-main { container: csmain / inline-size; }
@container csmain (max-width: 560px) {
    #chatSupportRoot .cs-char-count:not(.cs-char-warn):not(.cs-char-over) { display: none; }
    #chatSupportRoot .cs-note-toggle { padding: 3px 8px; }
    #chatSupportRoot .cs-reply-tools .cs-suggest-btn { padding: 4px 6px; }
}

/* Popover ⚙ — conține rândul EXISTENT .cs-sendkey-row (aceleași id-uri). */
#chatSupportRoot .cs-sendkey-pop {
    position: absolute;
    right: 12px;
    bottom: calc(100% + 6px);
    z-index: 51;
    width: min(340px, calc(100% - 24px));
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-r2);
    box-shadow: var(--shadow-lg, 0 10px 25px rgba(15, 23, 42, 0.15));
    animation: cs-fade-in var(--cs-dur) var(--cs-ease);
}
#chatSupportRoot .cs-sendkey-pop .cs-sendkey-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0;
    font-size: 12px;
}
#chatSupportRoot .cs-sendkey-pop .cs-sendkey-select {
    min-height: 32px;
    padding: 4px 6px !important;
    font-size: 12.5px;
}

/* ─── 6. Coloana din dreapta pe taburi ─────────────────────────────────── */

#chatSupportRoot .cs-side-tabs {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 0 8px;
    background: var(--cs-side-bg);
    border-bottom: 1px solid var(--cs-line);
}
#chatSupportRoot .cs-side-tab {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
    padding: 0 4px;
    border: 1px solid transparent;
    border-radius: var(--cs-r1);
    background: transparent;
    color: var(--gray-600);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    touch-action: manipulation;
    transition: background var(--cs-dur) var(--cs-ease), color var(--cs-dur) var(--cs-ease);
}
#chatSupportRoot .cs-side-tab:hover { background: var(--gray-100); }
#chatSupportRoot .cs-side-tab.active {
    background: #fff;
    border-color: var(--cs-line);
    color: var(--cs-accent-700);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
#chatSupportRoot .cs-sheet-x,
#chatSupportRoot .cs-sheet-handle,
#chatSupportRoot .cs-sheet-backdrop { display: none; }

#chatSupportRoot .cs-side-panel.cs-side-inactive { display: none; }
#chatSupportRoot .cs-side-panel {
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-r2);
    padding: 12px;
    gap: 10px;
    animation: cs-fade-in var(--cs-dur) var(--cs-ease);
}
/* Tabul îi ține loc de titlu. */
#chatSupportRoot .cs-conv-sidebar .cs-side-panel > .cs-side-title { display: none; }
#chatSupportRoot .cs-conv-sidebar .cs-select {
    min-height: 32px;
    padding: 5px 8px !important;
    border-color: var(--cs-line) !important;
}
#chatSupportRoot .cs-conv-sidebar .cs-btn { min-height: 32px; padding: 5px 10px; }

@media (min-width: 901px) {
    #chatSupportRoot .cs-conv-split .cs-conv-sidebar {
        gap: 10px;
        padding: 0 12px 12px;
        background: var(--cs-side-bg);
        border-left: 1px solid var(--cs-line);
    }
}

@keyframes cs-fade-in {
    from { opacity: 0; transform: translateY(-2px); }
    to { opacity: 1; transform: none; }
}

/* ─── 9. Mobil ≤ 900px ─────────────────────────────────────────────────── */

@media (max-width: 900px) {
    /* Bara de sus cu tichet deschis: un singur rând derulabil orizontal
       (nimic ascuns, nimic inaccesibil). */
    #chatSupportRoot.cs-ticket-open .cs-topbar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 6px;
        gap: 6px;
        margin-bottom: 8px;
    }
    #chatSupportRoot.cs-ticket-open .cs-topbar::-webkit-scrollbar { display: none; }
    #chatSupportRoot.cs-ticket-open .cs-topbar > * { flex: 0 0 auto !important; }
    #chatSupportRoot.cs-ticket-open .cs-topbar .cs-tabs,
    #chatSupportRoot.cs-ticket-open .cs-topbar-tools {
        flex-wrap: nowrap !important;
        overflow: visible;
    }
    #chatSupportRoot.cs-ticket-open .cs-topbar .cs-tab,
    #chatSupportRoot.cs-ticket-open .cs-topbar .cs-btn { min-height: 36px; white-space: nowrap; }

    #chatSupportRoot .cs-list-panel,
    #chatSupportRoot .cs-layout.conv-open .cs-conv-panel {
        height: var(--cs-panel-h);
        min-height: 360px;
        max-height: none;
        margin-bottom: 0;
    }

    /* Conversația: firul derulează intern, compozitorul rămâne jos. */
    #chatSupportRoot .cs-conv-split .cs-conv-main {
        flex: 1 1 auto;
        min-height: 0;
    }
    #chatSupportRoot .cs-reply {
        padding: 6px 8px max(8px, env(safe-area-inset-bottom, 0px));
    }
    #chatSupportRoot .cs-msg,
    #chatSupportRoot .cs-msg.note { max-width: 88%; }
    #chatSupportRoot .cs-conv-body { padding: 12px 10px; }

    /* Antet: ← Listă · titlu · ⓘ Detalii pe primul rând, badge-urile dedesubt. */
    #chatSupportRoot .cs-conv-title-row { flex-wrap: wrap; row-gap: 6px; }
    #chatSupportRoot .cs-conv-title-row .cs-back-btn { order: 1; }
    #chatSupportRoot .cs-conv-title-row .cs-conv-title { order: 2; flex: 1 1 40%; }
    #chatSupportRoot .cs-conv-title-row .cs-side-toggle-btn { order: 3; }
    #chatSupportRoot .cs-conv-title-row .cs-badge { order: 4; }
    #chatSupportRoot .cs-focus-btn { display: none; }
    #chatSupportRoot .cs-hdr-btn { min-height: 44px; min-width: 44px; }
    #chatSupportRoot .cs-hdr-btn-label { display: inline; }
    #chatSupportRoot .cs-aux-chip { height: 36px; }
    #chatSupportRoot .cs-client-card #csCallReqBtn { min-height: 36px; }

    /* Compozitor: rândul 1 = ⚡ 📎 ✨ 📌, rândul 2 = contor · ⚙ · Trimite. */
    #chatSupportRoot .cs-composer-bar { flex-wrap: wrap; padding: 4px 6px 6px; }
    #chatSupportRoot .cs-reply-tools { flex: 1 1 100%; }
    #chatSupportRoot .cs-reply-tools .cs-btn,
    #chatSupportRoot .cs-composer-bar .cs-icon-btn,
    #chatSupportRoot .cs-note-toggle { min-height: 44px; min-width: 44px; }
    #chatSupportRoot .cs-note-toggle { height: 44px; }
    #chatSupportRoot .cs-composer-bar .cs-send-btn { min-height: 44px; flex: 0 0 auto; }

    /* Coloana din dreapta → foaie de jos (85dvh) cu aceleași taburi.
       z-index sub modalele consolei (1200), ca un modal deschis din foaie
       (ex. 🔀 Transferă) să apară deasupra ei. */
    #chatSupportRoot .cs-conv-split .cs-conv-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1100;
        height: 85vh;
        height: 85dvh;
        max-height: 85dvh;
        gap: 10px;
        padding: 0 14px calc(90px + env(safe-area-inset-bottom, 0px));
        border: none;
        border-radius: var(--cs-r3) var(--cs-r3) 0 0;
        background: #fff;
        box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.2);
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateY(105%);
        visibility: hidden;
        transition: transform 0.24s var(--cs-ease), visibility 0s linear 0.24s;
    }
    #chatSupportRoot .cs-conv-panel.cs-sheet-open .cs-conv-sidebar {
        transform: none;
        visibility: visible;
        transition: transform 0.24s var(--cs-ease), visibility 0s;
    }
    #chatSupportRoot .cs-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1099;
        background: rgba(15, 23, 42, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    #chatSupportRoot .cs-conv-panel.cs-sheet-open .cs-sheet-backdrop { opacity: 1; pointer-events: auto; }
    #chatSupportRoot .cs-sheet-handle {
        display: block;
        width: 40px;
        height: 4px;
        margin: 8px auto 0;
        border-radius: 999px;
        background: var(--gray-300, #d1d5db);
        flex: 0 0 auto;
    }
    #chatSupportRoot .cs-side-tabs { background: #fff; padding: 6px 0 8px; }
    #chatSupportRoot .cs-side-tab { height: 44px; font-size: 13px; }
    #chatSupportRoot .cs-sheet-x {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 44px;
        height: 44px;
        border: 1px solid var(--cs-line);
        border-radius: var(--cs-r1);
        background: #fff;
        color: var(--gray-600);
        font-size: 16px;
        cursor: pointer;
    }
    #chatSupportRoot .cs-conv-sidebar .cs-select,
    #chatSupportRoot .cs-conv-sidebar .cs-btn { min-height: 44px; }

    #chatSupportRoot .cs-aux-sec.cs-aux-open { max-height: 30vh; }

    /* Client + chip-uri: câte un rând derulabil orizontal (nimic tăiat). */
    #chatSupportRoot .cs-client-card,
    #chatSupportRoot .cs-aux-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        white-space: nowrap;
        max-width: 100%;
    }
    #chatSupportRoot .cs-client-card::-webkit-scrollbar,
    #chatSupportRoot .cs-aux-bar::-webkit-scrollbar { display: none; }
    #chatSupportRoot .cs-client-card > *,
    #chatSupportRoot .cs-aux-chip { flex: 0 0 auto; }
    #chatSupportRoot .cs-conv-meta { flex-direction: column; align-items: stretch; gap: 6px; }
}

@media (max-width: 480px) {
    /* Anulează „Trimite full-width" (FAZA 3) — rândul 2 rămâne compact. */
    #chatSupportRoot .cs-composer-bar .cs-send-btn { flex: 0 0 auto; margin-left: 0; }
    #chatSupportRoot .cs-reply-tools { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    #chatSupportRoot .cs-aux-sec.cs-aux-open,
    #chatSupportRoot .cs-filters-more,
    #chatSupportRoot .cs-side-panel,
    #chatSupportRoot .cs-sendkey-pop { animation: none; }
    #chatSupportRoot .cs-conv-split .cs-conv-sidebar,
    #chatSupportRoot .cs-sheet-backdrop,
    #chatSupportRoot .cs-topbar,
    #chatSupportRoot .cs-hdr-btn,
    #chatSupportRoot .cs-aux-chip,
    #chatSupportRoot .cs-aux-chip::after,
    #chatSupportRoot .cs-side-tab { transition: none !important; }
}

/* ═══ Redesign 2026-10 — compactare mobil (≤900px) ════════════════════════════
   Desktopul nu se schimbă: ambalajul badge-urilor e `display: contents` acolo. */
#chatSupportRoot .cs-conv-badges { display: contents; }

@media (max-width: 900px) {
    #chatSupportRoot .cs-conv-header { padding: 6px 10px; gap: 4px; }

    /* Rândul de titlu: ← Listă · titlu · ⓘ Detalii — butoane compacte (36px vizibil),
       zona de atingere rămâne 44px prin ::after. */
    #chatSupportRoot .cs-conv-title-row { row-gap: 4px; }
    #chatSupportRoot .cs-conv-title-row .cs-back-btn,
    #chatSupportRoot .cs-conv-title-row .cs-side-toggle-btn {
        position: relative;
        min-height: 36px;
        height: 36px;
        min-width: 40px;
        padding: 0 8px;
        font-size: 12.5px;
    }
    #chatSupportRoot .cs-conv-title-row .cs-back-btn::after,
    #chatSupportRoot .cs-conv-title-row .cs-side-toggle-btn::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: -4px;
        bottom: -4px;
    }
    #chatSupportRoot .cs-conv-title { font-size: 14.5px; }

    /* Badge-urile: un singur rând derulabil orizontal, sub titlu. */
    #chatSupportRoot .cs-conv-badges {
        order: 4;
        flex: 1 1 100%;
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #chatSupportRoot .cs-conv-badges::-webkit-scrollbar { display: none; }
    #chatSupportRoot .cs-conv-badges .cs-badge { flex: 0 0 auto; white-space: nowrap; }

    /* Linia clientului + chip-urile: UN rând derulabil orizontal (în loc de două). */
    #chatSupportRoot .cs-conv-meta {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #chatSupportRoot .cs-conv-meta::-webkit-scrollbar { display: none; }
    #chatSupportRoot .cs-conv-meta > .cs-client-block,
    #chatSupportRoot .cs-conv-meta > .cs-aux-bar { flex: 0 0 auto; min-width: 0; }
    #chatSupportRoot .cs-conv-meta .cs-client-card,
    #chatSupportRoot .cs-conv-meta .cs-aux-bar { overflow: visible; max-width: none; }
    #chatSupportRoot .cs-aux-chip { height: 32px; }
    #chatSupportRoot .cs-client-card #csCallReqBtn { min-height: 30px; height: 30px; }

    /* Compozitor: tot două rânduri de unelte, dar mai strâns (≤ ~120px în repaus).
       Butoanele au 36px vizibil + zonă de atingere 44px prin ::after. */
    #chatSupportRoot .cs-reply { padding-top: 4px; padding-bottom: max(6px, env(safe-area-inset-bottom, 0px)); }
    #chatSupportRoot .cs-reply .cs-textarea { min-height: 40px; padding: 9px 12px 3px !important; }
    #chatSupportRoot .cs-composer-bar { row-gap: 4px; column-gap: 6px; padding: 2px 6px 2px; }
    #chatSupportRoot .cs-reply-tools { gap: 4px; }
    #chatSupportRoot .cs-reply-tools .cs-btn,
    #chatSupportRoot .cs-composer-bar .cs-icon-btn,
    #chatSupportRoot .cs-composer-bar .cs-send-btn,
    #chatSupportRoot .cs-note-toggle {
        position: relative;
        min-height: 36px;
        height: 36px;
        min-width: 40px;
    }
    #chatSupportRoot .cs-reply-tools .cs-btn::after,
    #chatSupportRoot .cs-composer-bar .cs-icon-btn::after,
    #chatSupportRoot .cs-composer-bar .cs-send-btn::after,
    #chatSupportRoot .cs-note-toggle::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: -4px;
        bottom: -4px;
    }
}

/* ═══ Redesign 2026-10 — runda 3 ═══════════════════════════════════════════ */

/* #1 Pastila „↓ N mesaje noi" (poziția verticală o setează JS, peste compozitor). */
#chatSupportRoot .cs-conv-split .cs-conv-main { position: relative; }
#chatSupportRoot .cs-newmsg-pill {
    position: absolute;
    left: 50%;
    bottom: 120px;
    z-index: 6;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 999px;
    background: var(--cs-accent);
    color: #fff;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(8, 145, 178, 0.35);
    cursor: pointer;
    animation: cs-pill-in var(--cs-dur) var(--cs-ease);
}
#chatSupportRoot .cs-newmsg-pill:hover { background: var(--cs-accent-700); }
#chatSupportRoot .cs-newmsg-pill:focus-visible { outline: 2px solid var(--cs-accent-700); outline-offset: 2px; }
#chatSupportRoot .cs-newmsg-pill[hidden] { display: none !important; }
@keyframes cs-pill-in {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* #2 Linia „Mesaje noi" (la deschiderea unui tichet necitit). */
#chatSupportRoot .cs-new-divider {
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
#chatSupportRoot .cs-new-divider::before,
#chatSupportRoot .cs-new-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: rgba(220, 38, 38, 0.45);
}

/* #5 Separatoare de zi lipite sus cât derulezi: doar pastila (fără linii, ca să
   nu taie textul de sub ea), fundal semi-opac + umbră discretă. */
#chatSupportRoot .cs-day-sep {
    position: sticky;
    top: 0;
    z-index: 3;
    justify-content: center;
    margin: 2px 0 0;
    pointer-events: none;
}
#chatSupportRoot .cs-day-sep::before,
#chatSupportRoot .cs-day-sep::after { display: none; }
#chatSupportRoot .cs-day-sep > span {
    padding: 2px 10px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* #7 Badge-ul de status = comutator (select nativ invizibil peste el). */
#chatSupportRoot .cs-stbadge {
    position: relative;
    cursor: pointer;
    padding-right: 6px;
}
#chatSupportRoot .cs-stbadge-caret { font-size: 9px; opacity: 0.7; margin-left: 1px; }
#chatSupportRoot .cs-stbadge:hover { filter: brightness(0.96); }
#chatSupportRoot .cs-stbadge:focus-within { outline: 2px solid var(--cs-accent); outline-offset: 1px; }
#chatSupportRoot .cs-stbadge-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 !important;      /* light-theme pune padding/chenar !important pe orice select */
    border: none !important;
    opacity: 0;
    cursor: pointer;
    font-size: 16px;            /* fără zoom automat pe iOS la focus */
    -webkit-appearance: none;
    appearance: none;
}

/* #8 Carduri de tichet mai dense: chip-uri mai mici, maxim ~2 rânduri. */
#chatSupportRoot .cs-ticket-card { padding: 8px 10px; margin-bottom: 6px; }
#chatSupportRoot .cs-ticket-preview { margin-top: 2px; }
#chatSupportRoot .cs-ticket-meta { gap: 4px; margin-top: 5px; }
#chatSupportRoot .cs-ticket-meta .cs-badge,
#chatSupportRoot .cs-ticket-meta .cs-tag-chip {
    padding: 0 6px;
    font-size: 10.5px;
    line-height: 1.6;
}
#chatSupportRoot .cs-ticket-meta .cs-tag-chip { max-width: 110px; }
#chatSupportRoot .cs-ticket-meta .cs-rating-stars { font-size: 10.5px; letter-spacing: 0; }
#chatSupportRoot .cs-tag-more { background: #fff; font-weight: 700; cursor: help; }

/* #4 Desktop: linia clientului = UN rând cu „…"; detaliile complete în tooltip.
   Chip-urile stau pe același rând când e loc, altfel trec dedesubt. */
@media (min-width: 901px) {
    #chatSupportRoot .cs-client-block { flex: 1 1 320px; min-width: 0; }
    #chatSupportRoot .cs-client-card {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #chatSupportRoot .cs-client-card #csCallReqBtn { display: inline-flex; vertical-align: middle; margin: -2px 0; }
}

@media (max-width: 900px) {
    /* #0 Rândul unic de pe mobil: chip-urile (cu avertismentul de context) ÎNTÂI. */
    #chatSupportRoot .cs-conv-meta > .cs-aux-bar { order: -1; }

    /* #6 Tastatura deschisă: înălțimea vine din viewport-ul vizual (JS). */
    #chatSupportRoot .cs-layout.conv-open .cs-conv-panel {
        height: var(--cs-vv-panel-h, var(--cs-panel-h));
    }
}

/* #3 Tactil / mobil: acțiunile pe mesaj apar doar la atingerea mesajului. */
@media (hover: none), (max-width: 900px) {
    #chatSupportRoot .cs-msg .cs-msg-act,
    #chatSupportRoot .cs-msg .cs-msg-del { display: none; }
    #chatSupportRoot .cs-msg.cs-msg-acts-open .cs-msg-act,
    #chatSupportRoot .cs-msg.cs-msg-acts-open .cs-msg-del {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
        padding: 4px 8px;
        opacity: 1;
        font-size: 12px;
    }
    #chatSupportRoot .cs-msg.cs-msg-acts-open .cs-msg-bubble { box-shadow: 0 0 0 2px var(--cs-accent-50), 0 0 0 3px var(--cs-accent); }
    #chatSupportRoot .cs-msg { -webkit-tap-highlight-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
    #chatSupportRoot .cs-newmsg-pill { animation: none; }
}

/* Runda 3 — corecții desktop: titlul are prioritate față de badge-uri (care se
   taie la nevoie, cu tooltip-urile lor intacte), separatoare cu spațiu în linia
   clientului (care nu mai e flex). */
@media (min-width: 901px) {
    #chatSupportRoot .cs-conv-title { flex: 1 1 160px; min-width: 120px; }
    #chatSupportRoot .cs-conv-badges {
        display: flex;
        align-items: center;
        flex: 0 1 auto;
        gap: 6px;
        min-width: 0;
        overflow: hidden;
    }
    #chatSupportRoot .cs-conv-badges .cs-badge { flex: 0 0 auto; }
    #chatSupportRoot .cs-client-card .cs-client-sep { margin: 0 6px; }
}

/* ═══ Redesign 2026-10 — runda 4 (desktop) ════════════════════════════════════ */

/* #1 Coloane redimensionabile. Lățimile implicite stau în variabile; JS le
   suprascrie inline pe #chatSupportRoot (px) după ce userul trage mânerul. */
#chatSupportRoot {
    --cs-list-col: minmax(260px, 320px);
    --cs-side-col: minmax(250px, 290px);
}
@media (min-width: 901px) and (max-width: 1680px) {
    #chatSupportRoot {
        --cs-list-col: minmax(240px, 290px);
        --cs-side-col: minmax(230px, 260px);
    }
}
@media (min-width: 1920px) {
    #chatSupportRoot { --cs-list-col: minmax(300px, 380px); } /* #5: listă implicit mai lată */
}
@media (min-width: 901px) {
    #chatSupportRoot .cs-layout {
        grid-template-columns: var(--cs-list-col) 12px minmax(0, 1fr);
        gap: 0;
    }
    #chatSupportRoot .cs-conv-panel.cs-conv-split {
        grid-template-columns: minmax(0, 1fr) 6px var(--cs-side-col);
    }
    #chatSupportRoot .cs-layout.conv-open.cs-focus-list #csListResizer,
    #chatSupportRoot .cs-layout.cs-focus-side #csSideResizer { display: none; }
}
#chatSupportRoot .cs-col-resizer {
    position: relative;
    align-self: stretch;
    min-height: 40px;
    cursor: col-resize;
    touch-action: none;
    outline: none;
}
#chatSupportRoot .cs-col-resizer::after {
    content: "";
    position: absolute;
    top: 12%;
    bottom: 12%;
    left: 50%;
    width: 3px;
    margin-left: -1.5px;
    border-radius: 3px;
    background: transparent;
    transition: background var(--cs-dur) var(--cs-ease);
}
#chatSupportRoot .cs-col-resizer:hover::after { background: var(--gray-300, #d1d5db); }
#chatSupportRoot .cs-col-resizer:focus-visible::after,
#chatSupportRoot.cs-resizing .cs-col-resizer::after { background: var(--cs-accent); }
#chatSupportRoot .cs-col-resizer-side { background: var(--cs-side-bg); }
#chatSupportRoot.cs-resizing,
#chatSupportRoot.cs-resizing * { cursor: col-resize !important; user-select: none !important; }
@media (max-width: 900px) {
    #chatSupportRoot .cs-col-resizer { display: none; }
}

/* #2 Cardul clientului (hover / focus pe nume). */
#chatSupportRoot .cs-req-name {
    cursor: help;
    border-bottom: 1px dotted var(--gray-300);
    border-radius: 2px;
    outline: none;
}
#chatSupportRoot .cs-req-name:hover,
#chatSupportRoot .cs-req-name[aria-expanded="true"] { color: var(--cs-accent-700); border-bottom-color: var(--cs-accent); }
#chatSupportRoot .cs-req-name:focus-visible { box-shadow: 0 0 0 2px var(--cs-accent); }
@media (max-width: 900px) {
    #chatSupportRoot .cs-req-name { cursor: default; border-bottom: none; }
}
#chatSupportRoot .cs-hover-card {
    position: fixed;
    z-index: 1150;
    width: 330px;
    max-width: calc(100vw - 16px);
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--cs-line);
    border-radius: var(--cs-r2);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    font-size: 12.5px;
    color: var(--gray-700);
    animation: cs-fade-in var(--cs-dur) var(--cs-ease);
}
#chatSupportRoot .cs-hc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
#chatSupportRoot .cs-hc-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cs-accent-50);
    color: var(--cs-accent-700);
    font-weight: 800;
}
#chatSupportRoot .cs-hc-name { font-size: 14px; color: var(--gray-900); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chatSupportRoot .cs-hc-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    min-width: 0;
}
#chatSupportRoot .cs-hc-row a { color: var(--cs-accent-700); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chatSupportRoot .cs-hc-row a:hover { text-decoration: underline; }
#chatSupportRoot .cs-hc-muted { color: var(--gray-500); font-size: 12px; }
#chatSupportRoot .cs-hc-copy {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-500);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}
#chatSupportRoot .cs-hc-copy:hover,
#chatSupportRoot .cs-hc-copy:focus-visible { background: var(--gray-100); border-color: var(--cs-line); color: var(--cs-accent-700); outline: none; }
#chatSupportRoot .cs-hc-call { margin-left: auto; min-height: 26px; height: 26px; padding: 0 10px; }
#chatSupportRoot .cs-hc-sub {
    margin: 10px 0 4px;
    padding-top: 8px;
    border-top: 1px solid var(--cs-line);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-400);
}
#chatSupportRoot .cs-hc-hist {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    margin: 0 -6px;
    border-radius: 6px;
    color: var(--gray-700);
    text-decoration: none;
}
#chatSupportRoot .cs-hc-hist:hover,
#chatSupportRoot .cs-hc-hist:focus-visible { background: var(--gray-100); outline: none; }
#chatSupportRoot .cs-hc-hist-subj { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* #4 „Clientul scrie…" în antet, lângă nume. */
#chatSupportRoot .cs-hdr-typing {
    margin-left: 6px;
    color: var(--cs-accent-700);
    font-size: 12px;
    font-style: italic;
    font-weight: 600;
    animation: cs-typing-pulse 1.4s ease-in-out infinite;
}
#chatSupportRoot .cs-hdr-typing[hidden] { display: none; }
@keyframes cs-typing-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* #5 Ecrane late: firul și compozitorul centrate, max ~900px. */
@media (min-width: 1920px) {
    #chatSupportRoot .cs-conv-split .cs-conv-body {
        padding-left: max(16px, calc((100% - 900px) / 2));
        padding-right: max(16px, calc((100% - 900px) / 2));
    }
    #chatSupportRoot .cs-conv-split .cs-reply {
        padding-left: max(12px, calc((100% - 900px) / 2));
        padding-right: max(12px, calc((100% - 900px) / 2));
    }
    #chatSupportRoot .cs-conv-split .cs-sendkey-pop { right: max(12px, calc((100% - 900px) / 2)); }
}

/* #6 Banda „❝ citat" deasupra casetei. */
#chatSupportRoot .cs-quote-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 8px 0;
    padding: 6px 6px 6px 10px;
    border-left: 3px solid var(--cs-accent);
    border-radius: 8px;
    background: var(--cs-accent-50);
    font-size: 12.5px;
    color: var(--gray-700);
    min-width: 0;
}
#chatSupportRoot .cs-quote-banner[hidden] { display: none; }
#chatSupportRoot .cs-quote-ico { color: var(--cs-accent); font-size: 16px; line-height: 1; }
#chatSupportRoot .cs-quote-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chatSupportRoot .cs-quote-count {
    flex: 0 0 auto;
    padding: 0 6px;
    border-radius: 999px;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    color: var(--cs-accent-700);
}
#chatSupportRoot .cs-quote-x {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--gray-500);
    font-size: 13px;
    cursor: pointer;
}
#chatSupportRoot .cs-quote-x:hover,
#chatSupportRoot .cs-quote-x:focus-visible { background: #fff; color: var(--danger, #dc2626); outline: none; }
#chatSupportRoot .cs-composer.cs-composer-note .cs-quote-banner { background: #fef3c7; border-left-color: var(--warning, #f59e0b); }

/* #7 Drag & drop: overlay pe toată coloana centrală. */
#chatSupportRoot .cs-conv-main.cs-drop-active::after {
    content: attr(data-cs-drop-msg);
    position: absolute;
    inset: 8px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 2px dashed var(--cs-accent);
    border-radius: var(--cs-r3);
    background: rgba(236, 254, 255, 0.93);
    color: var(--cs-accent-700);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    pointer-events: none;
}
#chatSupportRoot .cs-conv-main.cs-drop-active.cs-drop-blocked::after {
    border-color: var(--warning, #f59e0b);
    background: rgba(255, 251, 235, 0.95);
    color: #92400e;
    font-size: 14px;
}

/* #8 Lightbox (montat în <body>, deci nelimitat la #chatSupportRoot; prefix cs-). */
.cs-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.88);
}
.cs-lightbox .cs-lb-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 72px;
}
.cs-lightbox .cs-lb-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    background: #fff;
}
.cs-lightbox .cs-lb-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    color: #e2e8f0;
    font-size: 13px;
}
.cs-lightbox .cs-lb-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-lightbox .cs-lb-count { color: #94a3b8; font-variant-numeric: tabular-nums; }
.cs-lightbox .cs-lb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.cs-lightbox .cs-lb-btn:hover,
.cs-lightbox .cs-lb-btn:focus-visible { background: rgba(255, 255, 255, 0.18); outline: none; }
.cs-lightbox .cs-lb-nav {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 64px;
    margin-top: -48px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
}
.cs-lightbox .cs-lb-nav:hover,
.cs-lightbox .cs-lb-nav:focus-visible { background: rgba(255, 255, 255, 0.22); outline: none; }
.cs-lightbox .cs-lb-nav[hidden] { display: none; }
.cs-lightbox .cs-lb-prev { left: 12px; }
.cs-lightbox .cs-lb-next { right: 12px; }

@media (prefers-reduced-motion: reduce) {
    #chatSupportRoot .cs-hdr-typing,
    #chatSupportRoot .cs-hover-card { animation: none; }
}

/* ═══ Setări → Echipă: drepturi în Centrală + modalele membrilor (SPEC_L2_UI) ══
   Fragmentul .cs-rights e același în „Adaugă membru" și „Editează membrul";
   badge-urile 📞/🎵/👁️ din listă au culorile în clase (fără inline-style). */

/* ─── Cardul unui membru ─────────────────────────────────────────────────── */

#chatSupportRoot .cs-member-card { margin-bottom: 8px; padding: 12px 14px; }
.cs-member-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px 12px;
}
.cs-member-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    min-width: 0;
}
.cs-member-name { font-size: 14px; color: var(--gray-800); }
.cs-member-meta { font-size: 12px; color: var(--gray-600); }
.cs-member-email { word-break: break-all; }
.cs-member-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.cs-member-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}

/* Badge-uri seat / rol Suport (culorile vechi, mutate din inline-style) */
.cs-badge.cs-seat-on  { background: #dcfce7; color: #166534; }
.cs-badge.cs-seat-off { background: #f1f5f9; color: #64748b; }
.cs-badge.cs-suprole-manager { background: #ede9fe; color: #5b21b6; }
.cs-badge.cs-suprole-agent   { background: #e0f2fe; color: #075985; }
.cs-badge.cs-suprole-none    { background: #f1f5f9; color: #64748b; }

/* Badge-uri drepturi în Centrală (același vocabular ca „Compania Mea" / Centrală).
   Textul „Fără apeluri" e pe #64748b, nu #94a3b8: la 11px bold are nevoie de ≥ 4.5:1. */
.cs-badge.cs-right-on     { background: #dcfce7; color: #166534; }
.cs-badge.cs-right-off    { background: #f1f5f9; color: #64748b; }
.cs-badge.cs-right-rec    { background: #e0f2fe; color: #075985; }
.cs-badge.cs-right-sup    { background: #fef3c7; color: #92400e; }
.cs-badge.cs-right-tenant { background: var(--gray-100); color: var(--gray-700); font-weight: 600; }

/* ─── Modalele membrilor ─────────────────────────────────────────────────── */

.cs-modal-member { max-width: 560px; }
.cs-modal-member .cs-settings-form { max-width: none; gap: 12px; }
.cs-modal-member .cs-modal-actions { margin-top: 14px; }
.cs-modal-sub {
    margin: -8px 0 12px;
    font-size: 12.5px;
    color: var(--gray-600);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}
.cs-modal-sub strong { color: var(--gray-800); }
.cs-label-note { color: var(--gray-500); font-weight: 400; }
/* hint-uri care explică o alegere: contrast ≥ 4.5:1 (gray-600), nu gray-400 */
.cs-form-hint-strong { font-size: 12px; color: var(--gray-600); line-height: 1.45; }
.cs-note-ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--border-radius-sm, 8px);
    padding: 10px 14px;
    margin: 10px 0 0;
    color: #166534;
    font-size: 12.5px;
}
.cs-error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--border-radius-sm, 8px);
    padding: 8px 12px;
    margin-top: 10px;
    text-align: left;
    color: #b91c1c;
}
.cs-seat-add-tabs { margin: 0 0 14px; }
.cs-seat-add-tabs .cs-tab { font-size: 13px; padding: 7px 14px; }
.cs-seat-search { display: flex; gap: 6px; margin: 0 0 10px; }
.cs-seat-search .cs-input { flex: 1 1 auto; min-width: 0; }
.cs-seat-assign-intro { margin: 0 0 10px; }

/* ─── Fieldset „📞 Drepturi în Centrală" ─────────────────────────────────── */

.cs-rights {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    padding: 10px 12px 4px;
    margin: 8px 0;
    min-width: 0;
}
.cs-rights-legend {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
    padding: 0 4px;
}
.cs-rights-intro {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.45;
}
.cs-check-block {
    align-items: flex-start;
    min-height: 32px;
    line-height: 1.35;
}
.cs-check-block input { margin-top: 2px; flex: 0 0 auto; }
.cs-check-block strong { font-weight: 600; color: var(--gray-800); }
.cs-check-hint {
    display: block;
    margin: -4px 0 8px 24px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--gray-600);
}
.cs-check-hint strong { color: #9a3412; font-weight: 600; } /* costul, scos în evidență */
.cs-rights-locked {
    margin-left: 0;
    padding: 6px 8px;
    border-radius: var(--border-radius-sm, 8px);
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    color: var(--gray-700);
}
.cs-check-hint.cs-rights-locked { margin: 0 0 10px; }
#csSeatNewCanSupLocked, #csSeatAssignCanSupLocked, #csSeatEditCanSupLocked { margin: -2px 0 8px 24px; }
.cs-rights.is-locked .cs-check { cursor: not-allowed; }
.cs-rights.is-locked .cs-check strong { color: var(--gray-600); }
.cs-check input[disabled] { cursor: not-allowed; }
.cs-rights-off {
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px dashed var(--gray-300);
    border-radius: var(--border-radius-sm, 8px);
    background: var(--gray-50);
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--gray-700);
}
.cs-rights-note { margin: 0; font-size: 12px; color: var(--gray-600); line-height: 1.45; }

/* ─── Sub-blocul „Numere pe care primește și dă apeluri" (sub bifa 📞) ───── */

.cs-rights-numbers {
    margin: -2px 0 10px 24px;
    padding: 8px 10px 4px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: var(--gray-50);
    min-width: 0;
}
.cs-rights-numbers-legend {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-800);
    padding: 0 4px;
}
.cs-rights-numbers-empty { padding: 8px 10px; }
.cs-rights-numbers-empty .cs-check-hint { margin: 0; }
.cs-rights-numbers .cs-check-block { min-height: 28px; }
.cs-rights-numbers .cs-check-hint { margin: -4px 0 6px 24px; }
.cs-rights-numbers-note { margin: 0 0 8px !important; font-style: italic; color: var(--gray-700); }
.cs-rights-numbers-note[hidden] { display: none; }
.cs-check-radio input[type="radio"] { accent-color: var(--tk-teal-600, #0891b2); }
.cs-rights-numbers-list {
    max-height: 160px;
    overflow: auto;
    margin: 2px 0 6px 24px;
    padding: 4px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: #fff;
}
.cs-rights-numbers-list.is-disabled { opacity: .55; pointer-events: none; }
.cs-check-num { min-height: 26px; align-items: center; font-size: 13px; }
.cs-check-num input { width: 16px; height: 16px; flex: 0 0 auto; }
.cs-check-num .cs-num-phone { font-weight: 600; color: var(--gray-800); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cs-check-num .cs-num-mode { color: var(--gray-500); font-size: 12px; margin-left: 6px; }
.cs-check-num .cs-num-stale { color: #9a3412; }
.cs-rights.is-locked .cs-rights-numbers { background: transparent; }
.cs-rights-numbers input[type="radio"]:focus-visible,
.cs-rights-numbers-list input:focus-visible {
    outline: 2px solid var(--tk-teal-600, #0891b2);
    outline-offset: 2px;
}

/* focus vizibil pe bife și select-uri (tastatură) */
.cs-check input:focus-visible,
.cs-select:focus-visible {
    outline: 2px solid var(--tk-teal-600, #0891b2);
    outline-offset: 2px;
}

/* ─── Mobil ≤900px: bife 20px, ținte 44px, acțiuni lipite jos ────────────── */

@media (max-width: 900px) {
    .cs-check input { width: 20px; height: 20px; }
    .cs-check-block { min-height: 44px; }
    /* legenda lungă s-ar rupe pe două rânduri „pe chenar"; floatată, devine bloc normal în fieldset */
    .cs-rights { padding-top: 12px; }
    .cs-rights-legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; line-height: 1.3; }
    .cs-rights-intro { clear: both; }
    .cs-check-hint { margin-left: 28px; }
    #csSeatNewCanSupLocked, #csSeatAssignCanSupLocked, #csSeatEditCanSupLocked { margin-left: 28px; }
    .cs-rights-numbers { margin-left: 0; }
    .cs-rights-numbers .cs-check-hint { margin-left: 28px; }
    .cs-rights-numbers-list { margin-left: 0; }
    .cs-check-num { min-height: 40px; }
    .cs-check-num input { width: 20px; height: 20px; }
    .cs-modal-member .cs-modal-actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-top: 8px;
        padding-bottom: 4px;
        margin-bottom: -4px;
        box-shadow: 0 -8px 12px -8px rgba(15, 23, 42, 0.18);
    }
    .cs-member-head { flex-direction: column; align-items: stretch; }
    .cs-member-actions .cs-btn { flex: 1 1 auto; }
}

/* ═══ Monitor Live (tab „🖥️ Monitor Live", doar manageri & administrator) ═══
   Reutilizează .cs-report-card / .cs-stat-card / .cs-stats-grid / .cs-table.
   Regulile de mai jos adaugă DOAR accente specifice monitorului (prefix
   cs-monitor-* / cs-mon-*) — nu modifică stilurile existente. */
.cs-monitor-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.cs-monitor-access {
    margin: 4px 0 0;
    font-weight: 600;
    color: var(--gray-500);
}
.cs-monitor-head-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.cs-monitor-updated {
    font-size: 12px;
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
}
.cs-monitor-win {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cs-monitor-win-lbl {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
}
.cs-monitor-win-btn {
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.cs-monitor-win-btn:hover { border-color: var(--gray-300); }
.cs-monitor-win-btn.active {
    background: var(--tk-teal-50, #ecfeff);
    border-color: var(--tk-teal-700, #0e7490);
    color: var(--tk-teal-700, #0e7490);
}
.cs-monitor-section { margin-top: 14px; }
.cs-monitor-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-height: 40px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    list-style: none;
    border-radius: 8px;
    margin: -4px;
    padding: 4px;
    transition: background var(--transition-fast);
}
.cs-monitor-summary:hover { background: var(--gray-50); }
.cs-monitor-summary::-webkit-details-marker { display: none; }
.cs-mon-sum-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
/* Mini-rezumat în dreapta sumarului (ex. „42 deschise · 20 în așteptare") */
.cs-mon-sum-meta {
    margin-left: auto;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.cs-monitor-summary-sub {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
    font-variant-numeric: tabular-nums;
}
.cs-monitor-caret {
    flex-shrink: 0;
    transition: transform var(--transition-fast);
    color: var(--gray-400);
}
.cs-monitor-section[open] .cs-monitor-caret { transform: rotate(90deg); }
.cs-monitor-section > :not(summary) { margin-top: 14px; }
.cs-badge.cs-mon-live {
    background: var(--success-bg, #d1fae5);
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10px;
}

/* ── Card KPI de monitor: iconiță sus-stânga, valoare mare, etichetă,
      micro-explicație și (opțional) mini-bară de prag ── */
.cs-monitor-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 13px;
    min-height: 92px;
    border-left: 3px solid var(--gray-200);
}
.cs-mon-tile-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-bottom: 2px;
    border-radius: 9px;
    background: var(--gray-100);
    font-size: 16px;
    line-height: 1;
}
.cs-monitor-tile .cs-stat-value {
    font-size: 23px;
    font-variant-numeric: tabular-nums;
}
.cs-monitor-tile .cs-stat-label { font-weight: 600; color: var(--gray-600); }
.cs-mon-tile-unit { font-size: 12px; font-weight: 600; color: var(--gray-500); }
.cs-mon-tile-hint {
    font-size: 11px;
    color: var(--gray-400);
    line-height: 1.35;
    margin-top: 1px;
}

/* Mini-bară de prag (SLA / CSAT / Rată succes) */
.cs-mon-prog {
    height: 5px;
    border-radius: 3px;
    background: var(--gray-200);
    overflow: hidden;
    margin-top: 6px;
}
.cs-mon-prog > span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--gray-400);
    transition: width var(--transition-base, .3s) ease;
}
.cs-mon-prog.cs-mon-good > span { background: #16a34a; }
.cs-mon-prog.cs-mon-warn > span { background: #d97706; }
.cs-mon-prog.cs-mon-bad > span { background: #dc2626; }

/* Accente de prag pe tile (verde ≥90 / galben / roșu) */
.cs-monitor-tile.cs-mon-good { border-left-color: #16a34a; background: var(--success-bg, #d1fae5); }
.cs-monitor-tile.cs-mon-warn { border-left-color: #d97706; background: var(--warning-bg, #fef3c7); }
.cs-monitor-tile.cs-mon-bad {
    border-left-color: #dc2626;
    background: var(--error-bg, #fee2e2);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.25);
}
.cs-monitor-tile.cs-mon-good .cs-mon-tile-ico { background: rgba(22, 163, 74, 0.14); }
.cs-monitor-tile.cs-mon-warn .cs-mon-tile-ico { background: rgba(217, 119, 6, 0.14); }
.cs-monitor-tile.cs-mon-bad .cs-mon-tile-ico { background: rgba(220, 38, 38, 0.14); }
.cs-monitor-tile.cs-stat-empty { border-left-color: var(--gray-200); background: var(--gray-50); }

/* ── Health-at-a-glance: coada + operatorii liberi, cele mai proeminente ── */
.cs-mon-health {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.cs-mon-tile-hero {
    border-left-width: 4px;
    padding: 16px;
    min-height: 116px;
}
.cs-mon-tile-hero .cs-mon-tile-ico { width: 36px; height: 36px; font-size: 20px; border-radius: 11px; }
.cs-mon-tile-hero .cs-stat-value { font-size: 32px; font-weight: 800; }
.cs-mon-tile-hero .cs-stat-label { font-size: 13px; }

/* Tile clickabil pentru drill-down „AHT > 20 min" */
.cs-monitor-drill-btn {
    text-align: left;
    cursor: pointer;
    font: inherit;
    width: 100%;
    border: 1px solid var(--gray-200);
    border-left-width: 3px;
}
.cs-monitor-drill-btn:hover { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }
.cs-monitor-drill-btn:focus-visible { outline: 2px solid var(--primary-500, #3b82f6); outline-offset: 2px; }
.cs-mon-drill-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary-600, #2563eb);
}
.cs-monitor-drill-caret {
    font-size: 12px;
    display: inline-block;
    transition: transform var(--transition-fast);
}
.cs-monitor-drill-btn.cs-monitor-drill-open .cs-monitor-drill-caret { transform: rotate(90deg); }
.cs-monitor-drill { margin-top: 12px; }

/* ── Plăci de NAVIGARE / DRILL (click → Tichete sau panou inline) ── */
.cs-mon-tile-nav,
.cs-mon-tile-drill {
    cursor: pointer;
    position: relative;
}
.cs-mon-tile-nav:hover,
.cs-mon-tile-drill:hover { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }
.cs-mon-tile-nav:focus-visible,
.cs-mon-tile-drill:focus-visible { outline: 2px solid var(--primary-500, #3b82f6); outline-offset: 2px; }
.cs-mon-tile-drill.cs-monitor-drill-open .cs-monitor-drill-caret { transform: rotate(90deg); }

/* ── Declanșatori de drill: pastile prezență + chips status apeluri ── */
.cs-mon-pres-btn,
.cs-mon-chip-btn {
    font: inherit;
    cursor: pointer;
    border: 1px solid transparent;
}
.cs-mon-pres-btn:hover,
.cs-mon-chip-btn:hover { filter: brightness(0.97); border-color: var(--gray-300); }
.cs-mon-pres-btn:focus-visible,
.cs-mon-chip-btn:focus-visible { outline: 2px solid var(--primary-500, #3b82f6); outline-offset: 2px; }
.cs-mon-pres-btn .cs-monitor-drill-caret,
.cs-mon-chip-btn .cs-monitor-drill-caret { margin-left: 4px; font-size: 11px; }
.cs-mon-pres-btn.cs-monitor-drill-open .cs-monitor-drill-caret,
.cs-mon-chip-btn.cs-monitor-drill-open .cs-monitor-drill-caret { transform: rotate(90deg); }

/* ── Lista de operatori din panoul de prezență ── */
.cs-mon-oplist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cs-mon-opitem {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}
.cs-mon-opname { font-weight: 600; color: var(--gray-700); flex: 1 1 auto; min-width: 0; }
.cs-mon-opcap { font-variant-numeric: tabular-nums; color: var(--gray-500); font-size: 12px; }
/* Selector de status al operatorului — vizibil doar managerilor (taskul #326). */
.cs-mon-opstatus {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
}
.cs-mon-opstatus:disabled { opacity: .6; cursor: progress; }

/* ── Rânduri de agent clickabile ── */
.cs-table.cs-monitor-agents tr.cs-mon-agent-row { cursor: pointer; }
.cs-table.cs-monitor-agents tr.cs-mon-agent-row:hover { background: var(--primary-50, #eff6ff); }
.cs-table.cs-monitor-agents tr.cs-mon-agent-row:focus-visible { outline: 2px solid var(--primary-500, #3b82f6); outline-offset: -2px; }

/* ── Prezență operatori ── */
.cs-monitor-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}
.cs-mon-strip-lbl { font-size: 12px; font-weight: 600; color: var(--gray-500); margin-right: 2px; }
.cs-badge.cs-mon-pres {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gray-100);
    color: var(--gray-600);
}
.cs-mon-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.cs-badge.cs-mon-pres-online { background: var(--success-bg, #d1fae5); color: #047857; }
.cs-badge.cs-mon-pres-away { background: var(--warning-bg, #fef3c7); color: #b45309; }
.cs-badge.cs-mon-pres-prep { background: #ede9fe; color: #5b21b6; }
/* Outbound (taskul #330): distinct de „Prep to off" prin portocaliu. */
.cs-badge.cs-mon-pres-outbound { background: #ffedd5; color: #c2410c; }

/* ── Defalcare apeluri pe status ── */
.cs-mon-chips-wrap { margin-top: 14px; }
.cs-mon-chips-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--gray-500); margin-bottom: 6px; }
.cs-monitor-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cs-badge.cs-mon-chip { background: var(--gray-100); color: var(--gray-600); }
.cs-badge.cs-mon-tag { background: var(--tk-teal-50, #ecfeff); color: var(--tk-teal-700, #0e7490); }
.cs-badge.cs-mon-team-badge { background: var(--gray-100); color: var(--gray-500); font-weight: 600; font-size: 11px; }
.cs-mon-notag { color: var(--gray-400); font-style: italic; font-size: 12px; }

/* ── Note discrete ── */
.cs-mon-notes {
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}
.cs-monitor-note { margin: 0; }
.cs-monitor-note + .cs-monitor-note { margin-top: 4px; }

/* Mini-bară SLA în tabelul de agenți */
.cs-mon-bar {
    display: block;
    height: 4px;
    border-radius: 2px;
    background: var(--gray-200);
    margin-top: 4px;
    overflow: hidden;
}
.cs-mon-bar > span { display: block; height: 100%; background: var(--tk-teal-700, #0e7490); }
.cs-mon-bar.cs-mon-good > span { background: #16a34a; }
.cs-mon-bar.cs-mon-warn > span { background: #d97706; }
.cs-mon-bar.cs-mon-bad > span { background: #dc2626; }
.cs-table.cs-monitor-agents td.cs-mon-good { color: #047857; }
.cs-table.cs-monitor-agents td.cs-mon-warn { color: #b45309; }
.cs-table.cs-monitor-agents td.cs-mon-bad { color: #dc2626; }
.cs-table.cs-monitor-agents tbody tr:nth-child(even) { background: var(--gray-50); }

/* ═══ Responsive ═══ */
.cs-mon-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 900px) {
    .cs-mon-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
@media (max-width: 640px) {
    .cs-monitor-head-row { flex-direction: column; align-items: stretch; }
    .cs-monitor-head-tools { width: 100%; justify-content: space-between; gap: 10px; }
    .cs-monitor-win { flex: 1 1 auto; justify-content: flex-end; }
    .cs-monitor-win-btn { min-height: 40px; padding: 8px 16px; }
    .cs-mon-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .cs-mon-health { grid-template-columns: 1fr; }
    .cs-mon-tile-hero { min-height: 0; padding: 14px; }
    .cs-mon-tile-hero .cs-stat-value { font-size: 28px; }
    .cs-mon-sum-meta { font-size: 12px; }

    /* Tabele → listă de carduri (un card per rând, etichete din data-label) */
    .cs-mon-cards-wrap { overflow: visible; border: 0; background: none; }
    .cs-mon-cards,
    .cs-mon-cards tbody,
    .cs-mon-cards tr,
    .cs-mon-cards td { display: block; width: 100%; }
    .cs-mon-cards thead { display: none; }
    .cs-mon-cards tbody tr,
    .cs-mon-cards tbody tr:nth-child(even) {
        border: 1px solid var(--gray-200);
        border-radius: 10px;
        padding: 4px 12px;
        margin-bottom: 10px;
        background: var(--gray-50);
    }
    .cs-mon-cards td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        text-align: right;
        padding: 7px 0;
        border: 0;
        border-bottom: 1px solid var(--gray-100);
    }
    .cs-mon-cards tr td:last-child { border-bottom: 0; }
    .cs-mon-cards td::before {
        content: attr(data-label);
        flex-shrink: 0;
        font-size: 11.5px;
        font-weight: 600;
        color: var(--gray-500);
        text-align: left;
    }
    .cs-mon-cards td .cs-mon-bar { display: none; }
}
@media (max-width: 380px) {
    .cs-mon-grid { grid-template-columns: 1fr; }
}

/* ── Top etichete „în timp real" (client vs merchant) ── */
.cs-mon-toptags {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--gray-50);
}
.cs-mon-toptags-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 12px;
}
.cs-mon-toptags-sub {
    flex: 1 1 100%;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--gray-500);
}
.cs-mon-toptags-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.cs-mon-toptags-col {
    background: var(--white, #fff);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 10px 12px;
}
.cs-mon-toptags-coltitle {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 8px;
}
.cs-mon-toptags-empty {
    font-size: 12px;
    font-style: italic;
    color: var(--gray-400);
    padding: 6px 0;
}
.cs-mon-toptags-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
/* Cartonaș clickabil (toggle de filtru) */
.cs-mon-toptag-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.cs-mon-toptag-card:hover { background: var(--gray-100); border-color: var(--gray-300); }
/* Varianta STATICĂ din Rapoarte (card „Top 5 etichete"): doar afișare, nu e
   clickabil ca filtrul din Monitor Live → fără cursor/hover care sugerează click. */
.cs-mon-toptag-card.cs-toptag-static { cursor: default; }
.cs-mon-toptag-card.cs-toptag-static:hover { background: transparent; border-color: transparent; }

/* ── Volumetrie chaturi pe ore (task #332) — bare CSS, fara librarie de grafice ── */
.cs-volume-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 2px 0 10px; font-size: 12px; color: var(--gray-600, #4b5563); }
.cs-volume-leg { display: inline-flex; align-items: center; gap: 5px; }
.cs-volume-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.cs-volume-sw-client { background: #16a34a; }
.cs-volume-sw-merchant { background: #dc2626; }
.cs-volume-sw-sla { height: 3px; border-radius: 2px; background: #0e7490; }
.cs-volume-chart { display: flex; align-items: flex-end; gap: 3px; width: 100%; overflow-x: auto; padding-bottom: 4px; }
.cs-volume-col { flex: 1 1 0; min-width: 22px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cs-volume-bars { position: relative; width: 100%; height: 130px; display: flex; align-items: flex-end; justify-content: center; gap: 2px; background: var(--gray-50, #f9fafb); border-radius: 4px; }
.cs-volume-bar { width: 42%; max-width: 12px; min-height: 1px; border-radius: 3px 3px 0 0; }
.cs-volume-bar-client { background: #16a34a; }
.cs-volume-bar-merchant { background: #dc2626; }
.cs-volume-sla { position: absolute; left: 2px; right: 2px; height: 2px; background: #0e7490; opacity: 0.85; pointer-events: none; }
.cs-volume-hour { font-size: 11px; color: var(--gray-500, #6b7280); }
.cs-volume-slapct { font-size: 10px; font-weight: 600; color: #0e7490; }
.cs-volume-slapct-low { color: #dc2626; }
.cs-mon-toptag-card:focus-visible { outline: 2px solid var(--primary-500, #3b82f6); outline-offset: 2px; }
.cs-mon-toptag-card.cs-mon-toptag-active {
    background: var(--tk-teal-50, #ecfeff);
    border-color: var(--tk-teal-700, #0e7490);
}
.cs-mon-toptag-card.cs-mon-toptag-active .cs-mon-toptag-bar > span { background: var(--tk-teal-700, #0e7490); }
.cs-mon-toptag-card.cs-mon-toptag-active .cs-mon-toptag-rank { background: var(--tk-teal-700, #0e7490); color: #fff; }
.cs-mon-toptag-card.cs-mon-toptag-dim { opacity: 0.5; }
.cs-mon-toptag-card.cs-mon-toptag-dim:hover { opacity: 1; }
.cs-mon-toptag-rank {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cs-mon-toptag-main {
    flex: 1 1 auto;
    min-width: 0;
}
.cs-mon-toptag-label {
    display: block;
    font-size: 12.5px;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cs-mon-toptag-bar {
    display: block;
    height: 4px;
    border-radius: 2px;
    background: var(--gray-200);
    margin-top: 3px;
    overflow: hidden;
}
.cs-mon-toptag-bar > span {
    display: block;
    height: 100%;
    background: var(--tk-teal-700, #0e7490);
}
.cs-mon-toptag-count {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    font-variant-numeric: tabular-nums;
    min-width: 20px;
    text-align: right;
}
/* Banner de filtru activ (deasupra coloanelor) */
.cs-mon-toptags-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 12px;
    padding: 8px 12px;
    border: 1px solid var(--tk-teal-700, #0e7490);
    border-radius: 10px;
    background: var(--tk-teal-50, #ecfeff);
}
.cs-mon-toptags-filter-lbl { font-size: 12.5px; color: var(--gray-700); }
.cs-mon-toptags-filter-stream {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--tk-teal-700, #0e7490);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}
.cs-mon-toptags-open {
    margin-left: auto;
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    background: var(--tk-teal-700, #0e7490);
    color: #fff;
}
.cs-mon-toptags-open:hover { filter: brightness(1.05); }
.cs-mon-toptags-open:focus-visible,
.cs-mon-toptags-clear:focus-visible { outline: 2px solid var(--primary-500, #3b82f6); outline-offset: 2px; }
.cs-mon-toptags-clear {
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--white, #fff);
    color: var(--gray-600);
}
.cs-mon-toptags-clear:hover { background: var(--gray-100); }
@media (max-width: 640px) {
    .cs-mon-toptags-cols { grid-template-columns: 1fr; }
    .cs-mon-toptags-open { margin-left: 0; width: 100%; min-height: 40px; }
    .cs-mon-toptags-clear { width: 100%; min-height: 40px; }
    .cs-mon-toptag-card { padding: 9px 8px; }
}

/* ═══ 📨 Canale externe: Email + Facebook & Instagram (D9, PR FACEBOOKIEMAILSUPORT) ═══
   Iconițe SVG proprii (currentColor) + culoarea fiecărui canal ca token. Totul e
   aditiv: tichetele vechi nu primesc nicio clasă de aici. */

#chatSupportRoot, .cs-modal-overlay {
    --cs-ch-email: #4f46e5;      --cs-ch-email-bg: #eef2ff;      --cs-ch-email-line: #c7d2fe;
    --cs-ch-fb: #1d4ed8;         --cs-ch-fb-bg: #eff6ff;         --cs-ch-fb-line: #bfdbfe;
    --cs-ch-ig: #be185d;         --cs-ch-ig-bg: #fdf2f8;         --cs-ch-ig-line: #fbcfe8;
}
.cs-ch-ico { width: 1.05em; height: 1.05em; flex-shrink: 0; vertical-align: -0.16em; }
.cs-badge.cs-ch { gap: 4px; border-width: 1px; border-style: solid; }
.cs-badge.cs-ch-email      { color: var(--cs-ch-email, #4f46e5); background: var(--cs-ch-email-bg, #eef2ff); border-color: var(--cs-ch-email-line, #c7d2fe); }
.cs-badge.cs-ch-messenger,
.cs-badge.cs-ch-fb_comment { color: var(--cs-ch-fb, #1d4ed8); background: var(--cs-ch-fb-bg, #eff6ff); border-color: var(--cs-ch-fb-line, #bfdbfe); }
.cs-badge.cs-ch-instagram,
.cs-badge.cs-ch-ig_comment { color: var(--cs-ch-ig, #be185d); background: var(--cs-ch-ig-bg, #fdf2f8); border-color: var(--cs-ch-ig-line, #fbcfe8); }
.cs-badge.cs-ch-mini { padding: 2px 5px; }

/* ── Banda canalului (sub cardul clientului) ── */
.cs-ch-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--cs-ch-email-line, #c7d2fe);
    background: var(--cs-ch-email-bg, #eef2ff);
    font-size: 12.5px;
    color: var(--gray-700, #374151);
}
.cs-ch-strip.cs-ch-messenger, .cs-ch-strip.cs-ch-fb_comment { border-color: var(--cs-ch-fb-line, #bfdbfe); background: var(--cs-ch-fb-bg, #eff6ff); }
.cs-ch-strip.cs-ch-instagram, .cs-ch-strip.cs-ch-ig_comment { border-color: var(--cs-ch-ig-line, #fbcfe8); background: var(--cs-ch-ig-bg, #fdf2f8); }
.cs-ch-strip-src { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.cs-ch-strip.cs-ch-email .cs-ch-strip-src { color: var(--cs-ch-email, #4f46e5); }
.cs-ch-strip.cs-ch-messenger .cs-ch-strip-src, .cs-ch-strip.cs-ch-fb_comment .cs-ch-strip-src { color: var(--cs-ch-fb, #1d4ed8); }
.cs-ch-strip.cs-ch-instagram .cs-ch-strip-src, .cs-ch-strip.cs-ch-ig_comment .cs-ch-strip-src { color: var(--cs-ch-ig, #be185d); }
.cs-ch-strip-acct { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.cs-ch-strip-more {
    margin-left: auto;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    min-height: 28px;
    border-radius: 999px;
    border: 1px solid var(--gray-300, #d1d5db);
    background: #fff;
    color: var(--gray-700, #374151);
    cursor: pointer;
}
.cs-ch-strip-more:hover { background: var(--gray-50, #f9fafb); }
.cs-ch-strip-more[aria-expanded="true"] { background: var(--gray-800, #1f2937); border-color: var(--gray-800, #1f2937); color: #fff; }
.cs-ch-strip-more:focus-visible, .cs-ch-mode:focus-visible, .cs-em-full-btn:focus-visible,
.cs-dlv-btn:focus-visible, .cs-mb-preset:focus-visible { outline: 2px solid var(--primary-500, #3b82f6); outline-offset: 2px; }

/* Fereastra de răspuns Meta (pastilă cu numărătoare). */
.cs-chw {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    border: 1px solid transparent;
}
.cs-chw-ok     { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.cs-chw-warn   { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.cs-chw-late   { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.cs-chw-closed { background: #f3f4f6; color: #991b1b; border-color: #fecaca; }

/* ── Panoul „Canal" (aux) ── */
.cs-ch-panel .cs-kv-val a { color: var(--cs-accent-700, #0e7490); font-weight: 600; }
.cs-ch-quote {
    display: block;
    padding: 4px 8px;
    border-left: 3px solid var(--gray-300, #d1d5db);
    background: #fff;
    border-radius: 4px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.cs-ch-removed { color: #b91c1c; font-weight: 600; }
.cs-ch-help { margin: 8px 0 0; font-size: 12.5px; color: var(--gray-600, #4b5563); line-height: 1.5; }
.cs-ch-help-list { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--gray-600, #4b5563); line-height: 1.5; }
.cs-ch-help-list li { margin: 2px 0; }

/* ── Compozitorul: public / privat + alertă ── */
.cs-ch-composer { padding: 8px 10px 0; }
.cs-composer-note .cs-ch-composer { display: none; }
.cs-ch-modes {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    border-radius: 999px;
    background: var(--gray-100, #f3f4f6);
    border: 1px solid var(--gray-200, #e5e7eb);
}
.cs-ch-mode {
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 12px;
    min-height: 30px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--gray-600, #4b5563);
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
}
.cs-ch-mode:hover { color: var(--gray-800, #1f2937); }
.cs-ch-mode.active { background: #fff; color: var(--cs-accent-700, #0e7490); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }
.cs-ch-mode[aria-disabled="true"] { color: var(--gray-400, #9ca3af); cursor: not-allowed; text-decoration: line-through; text-decoration-thickness: 1px; }
.cs-ch-mode-hint { margin-top: 4px; font-size: 11.5px; color: var(--gray-500, #6b7280); line-height: 1.4; }
.cs-ch-mode-hint:empty { display: none; }
.cs-ch-alert {
    margin-top: 6px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.45;
}
.cs-ch-alert[hidden] { display: none; }
.cs-ch-alert-err  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.cs-ch-alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Starea de livrare sub mesajul operatorului ── */
.cs-dlv-row {
    align-self: flex-end;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 8px;
    margin-top: 3px;
    padding: 0 6px;
    font-size: 11.5px;
    color: var(--gray-500, #6b7280);
}
.cs-dlv-none { display: none; }
.cs-dlv-sent { color: #047857; }
.cs-dlv-ext { color: var(--gray-500, #6b7280); font-style: italic; }
.cs-dlv-failed, .cs-dlv-unknown {
    padding: 5px 8px;
    border-radius: 8px;
    font-weight: 600;
}
.cs-dlv-failed  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.cs-dlv-unknown { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.cs-dlv-skipped { color: var(--gray-500, #6b7280); }
/* D11: verificarea automată a livrării în curs + nota de pe un mesaj trimis (ex. respins de destinatar) */
.cs-dlv-verifying { color: #92400e; }
.cs-dlv-note { color: #b45309; font-weight: 500; }
#chatSupportRoot .cs-dlv-row .cs-dlv-btn { min-height: 28px; padding: 3px 10px; font-size: 12px; background: #fff; }
.cs-dlv-spin {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid var(--gray-300, #d1d5db);
    border-top-color: var(--cs-accent, #0891b2);
    animation: cs-dlv-rot 0.8s linear infinite;
}
@keyframes cs-dlv-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cs-dlv-spin { animation: none; } }
#chatSupportRoot .cs-msg.cs-msg-extagent .cs-msg-bubble { background: var(--gray-700, #374151); }

/* ── Răspunsurile email GRUPATE (516): starea pe mesaj + bara de deasupra compozitorului ── */
.cs-dlv-queued { color: var(--cs-accent-700, #0e7490); font-weight: 600; }
.cs-dlv-q-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cs-accent, #0891b2);
    box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.45);
    animation: cs-eb-pulse 1.8s ease-out infinite;
}
.cs-dlv-cancelled { color: var(--gray-500, #6b7280); font-weight: 600; }
#chatSupportRoot .cs-msg.operator:has(.cs-dlv-queued) .cs-msg-bubble { outline: 1.5px dashed rgba(8, 145, 178, 0.55); outline-offset: 2px; }
#chatSupportRoot .cs-msg.operator:has(.cs-dlv-cancelled) .cs-msg-bubble { opacity: 0.62; }
@keyframes cs-eb-pulse {
    0% { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0.45); }
    70% { box-shadow: 0 0 0 6px rgba(8, 145, 178, 0); }
    100% { box-shadow: 0 0 0 0 rgba(8, 145, 178, 0); }
}

.cs-eb {
    position: relative;
    margin: 0 0 8px;
    border: 1px solid #a5f3fc;
    border-radius: 12px;
    background: linear-gradient(180deg, #ecfeff 0%, #f8feff 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 14px -8px rgba(8, 145, 178, 0.35);
    overflow: hidden;
    animation: cs-eb-in 0.18s ease-out;
}
.cs-eb[hidden] { display: none; }
@keyframes cs-eb-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.cs-eb-main {
    display: flex;
    align-items: center;
    gap: 10px 12px;
    padding: 9px 10px 9px 12px;
}
.cs-eb-ico {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 16px;
    background: #fff;
    border: 1px solid #a5f3fc;
}
.cs-eb-text { flex: 1 1 auto; min-width: 0; }
.cs-eb-title { font-size: 13.5px; font-weight: 700; color: #164e63; line-height: 1.3; }
.cs-eb-time {
    display: inline-block;
    min-width: 3.2ch;
    font-variant-numeric: tabular-nums;
    color: var(--cs-accent-700, #0e7490);
}
.cs-eb-sub { margin-top: 1px; font-size: 12px; color: #155e75; opacity: 0.85; line-height: 1.35; }
.cs-eb-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
#chatSupportRoot .cs-eb .cs-eb-btn { min-height: 30px; padding: 4px 11px; font-size: 12.5px; white-space: nowrap; }
#chatSupportRoot .cs-eb .cs-eb-btn:not(.cs-btn-primary) { background: #fff; }
#chatSupportRoot .cs-eb .cs-eb-cancel { color: #9f1239; }
#chatSupportRoot .cs-eb .cs-eb-cancel:hover { background: #fff1f2; border-color: #fecdd3; }
#chatSupportRoot .cs-eb .cs-eb-now { display: inline-flex; align-items: center; gap: 6px; }
.cs-eb-btn:focus-visible { outline: 2px solid var(--primary-500, #3b82f6); outline-offset: 2px; }
.cs-eb-bar { height: 3px; background: rgba(8, 145, 178, 0.12); }
.cs-eb-fill { display: block; height: 100%; width: 0; background: var(--cs-accent, #0891b2); transition: width 0.9s linear; }
.cs-eb-alert {
    padding: 7px 12px;
    font-size: 12.5px;
    line-height: 1.45;
    color: #92400e;
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
}
.cs-eb-alert-sub { color: #a16207; }
.cs-eb.cs-eb-warn { border-color: #fcd34d; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 14px -8px rgba(217, 119, 6, 0.45); }
.cs-eb.cs-eb-sending .cs-eb-title { color: #0e7490; }
@media (prefers-reduced-motion: reduce) {
    .cs-dlv-q-dot, .cs-eb { animation: none; }
    .cs-eb-fill { transition: none; }
}
@media (max-width: 900px) {
    .cs-eb-main { flex-wrap: wrap; gap: 8px 10px; padding: 9px 10px; }
    .cs-eb-ico { width: 28px; height: 28px; font-size: 14px; }
    .cs-eb-text { flex: 1 1 calc(100% - 40px); }
    .cs-eb-actions { flex: 1 1 100%; }
    #chatSupportRoot .cs-eb .cs-eb-btn { flex: 1 1 0; min-height: 40px; justify-content: center; }
    #chatSupportRoot .cs-eb .cs-eb-now { flex: 1.4 1 0; }
}

/* ── Mesajele de email: „carduri de email" ── */
#chatSupportRoot .cs-msg.cs-email-msg { max-width: min(88%, 760px); }
#chatSupportRoot .cs-msg.cs-email-msg .cs-msg-bubble {
    background: #fff;
    color: var(--gray-800, #1f2937);
    border: 1px solid var(--cs-line, #e5e7eb);
    border-left: 4px solid var(--cs-ch-email, #4f46e5);
    border-radius: var(--cs-r2, 12px);
    padding: 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}
#chatSupportRoot .cs-msg.operator.cs-email-msg .cs-msg-bubble { border-left-color: var(--cs-accent, #0891b2); background: #f8feff; }
#chatSupportRoot .cs-msg.operator.cs-email-msg .cs-msg-bubble a { color: var(--cs-accent-700, #0e7490); }
.cs-em-head {
    padding: 8px 12px;
    background: var(--gray-50, #f9fafb);
    border-bottom: 1px solid var(--cs-line, #e5e7eb);
    font-size: 12px;
    color: var(--gray-600, #4b5563);
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.cs-em-k {
    display: inline-block;
    min-width: 54px;
    font-weight: 700;
    color: var(--gray-500, #6b7280);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.cs-em-body { padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cs-em-foot { padding: 0 12px 10px; }
.cs-em-skipped { font-size: 12px; color: var(--cs-warn-fg, #92400e); margin: 0 0 6px; overflow-wrap: anywhere; }
.cs-em-full-btn {
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    min-height: 30px;
    border-radius: 999px;
    border: 1px solid var(--cs-ch-email-line, #c7d2fe);
    background: var(--cs-ch-email-bg, #eef2ff);
    color: var(--cs-ch-email, #4f46e5);
    cursor: pointer;
}
.cs-em-full-btn:hover { filter: brightness(0.97); }

/* Fereastra „Emailul complet" */
.cs-modal.cs-modal-email { max-width: 860px; display: flex; flex-direction: column; gap: 10px; }
.cs-em-modal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cs-em-modal-top h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cs-em-full-head {
    padding: 10px 12px;
    border: 1px solid var(--cs-line, #e5e7eb);
    border-radius: 10px;
    background: var(--gray-50, #f9fafb);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.cs-em-full-note { font-size: 11.5px; color: var(--gray-500, #6b7280); }
.cs-em-frame {
    width: 100%;
    height: min(62vh, 640px);
    border: 1px solid var(--cs-line, #e5e7eb);
    border-radius: 10px;
    background: #fff;
}
.cs-em-text {
    margin: 0;
    padding: 12px;
    max-height: 62vh;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.55;
    border: 1px solid var(--cs-line, #e5e7eb);
    border-radius: 10px;
    background: #fff;
}

/* ── Setări → 📨 Canale ── */
.cs-chs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.cs-chs-card {
    min-width: 0;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 14px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.cs-chs-card.cs-ch-email { border-top: 4px solid var(--cs-ch-email, #4f46e5); }
.cs-chs-card.cs-ch-meta { border-top: 4px solid var(--cs-ch-fb, #1d4ed8); }
.cs-chs-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.cs-chs-head h4 { margin: 0 0 2px; font-size: 15px; color: var(--gray-800, #1f2937); }
.cs-chs-head p { margin: 0; font-size: 12.5px; color: var(--gray-500, #6b7280); line-height: 1.45; }
.cs-chs-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    font-size: 21px;
    color: var(--cs-ch-email, #4f46e5);
    background: var(--cs-ch-email-bg, #eef2ff);
}
.cs-chs-ico.cs-chs-ico-duo { width: 52px; font-size: 17px; color: var(--cs-ch-fb, #1d4ed8); background: linear-gradient(135deg, var(--cs-ch-fb-bg, #eff6ff), var(--cs-ch-ig-bg, #fdf2f8)); }
.cs-chs-ico-duo .cs-ch-ico + .cs-ch-ico { color: var(--cs-ch-ig, #be185d); }
.cs-chs-sub { margin: 14px 0 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-500, #6b7280); }
.cs-chs-list { display: flex; flex-direction: column; gap: 8px; }
.cs-chs-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    background: var(--gray-50, #f9fafb);
}
.cs-chs-item-main { display: flex; gap: 10px; align-items: flex-start; min-width: 0; flex: 1 1 260px; }
.cs-chs-item-txt { min-width: 0; flex: 1 1 auto; }
.cs-chs-item-title { font-weight: 700; font-size: 13.5px; color: var(--gray-800, #1f2937); overflow-wrap: anywhere; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cs-chs-item-sub { font-size: 12px; color: var(--gray-500, #6b7280); margin-top: 2px; line-height: 1.45; }
.cs-chs-item-err { font-size: 12px; color: #b91c1c; margin-top: 4px; overflow-wrap: anywhere; }
.cs-chs-item-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-chs-muted { color: var(--gray-500, #6b7280); font-weight: 500; }
.cs-chs-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--gray-400, #9ca3af); }
.cs-chs-dot-ok { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.cs-chs-dot-err { background: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }
.cs-chs-dot-wait { background: #d97706; box-shadow: 0 0 0 3px #fef3c7; }
.cs-chs-dot-off { background: var(--gray-300, #d1d5db); }
.cs-chs-empty { padding: 12px; border: 1px dashed var(--gray-300, #d1d5db); border-radius: 10px; font-size: 13px; color: var(--gray-500, #6b7280); text-align: center; }
.cs-chs-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cs-chs-unavail { padding: 12px; border-radius: 10px; background: var(--gray-50, #f9fafb); border: 1px dashed var(--gray-300, #d1d5db); font-size: 13px; color: var(--gray-600, #4b5563); }
.cs-chs-gate { margin-bottom: 10px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.45; }
.cs-chs-gate[hidden] { display: none; }
.cs-chs-gate-on { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.cs-chs-gate-off { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.cs-chs-warn { margin-bottom: 10px; padding: 10px 12px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: 12.5px; line-height: 1.5; }
.cs-chs-warn ul { margin: 6px 0 0; padding-left: 18px; }
.cs-chs-warn code, .cs-chs-guide code, .cs-chs-url code { font-size: 11.5px; background: rgba(15, 23, 42, 0.06); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.cs-chs-connect { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#chatSupportRoot .cs-fb-btn, .cs-fb-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
    font-weight: 700;
}
#chatSupportRoot .cs-fb-btn:hover:not(:disabled), .cs-fb-btn:hover:not(:disabled) { background: #166fe0; }
#chatSupportRoot .cs-fb-btn:disabled, .cs-fb-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.cs-btn-stopline { color: #b91c1c; }
.cs-btn-stopline:hover:not(:disabled) { background: #fef2f2; border-color: #fecaca; }
.cs-chs-pages { display: flex; flex-direction: column; gap: 10px; }
.cs-chs-page { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 12px; padding: 10px 12px; background: var(--gray-50, #f9fafb); }
.cs-chs-page-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.cs-chs-page-head .cs-btn { margin-left: auto; }
.cs-chs-togs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px; margin-top: 10px; }
.cs-chs-tog {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    min-height: 38px;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 9px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}
.cs-chs-tog:has(input:checked) { border-color: var(--cs-accent, #0891b2); background: var(--cs-accent-50, #ecfeff); }
.cs-chs-tog.is-off { opacity: 0.55; cursor: not-allowed; }
.cs-chs-tog input { width: 16px; height: 16px; }
.cs-chs-page-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; }
.cs-chs-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-700, #374151); }
.cs-chs-inline .cs-select { width: auto; min-width: 150px; }
.cs-chs-guide { margin-top: 12px; border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; background: #fff; }
.cs-chs-guide > summary { cursor: pointer; padding: 9px 12px; font-weight: 700; font-size: 13px; color: var(--gray-700, #374151); }
.cs-chs-guide[open] > summary { border-bottom: 1px solid var(--gray-200, #e5e7eb); }
.cs-chs-guide > :not(summary) { margin-left: 12px; margin-right: 12px; }
.cs-chs-guide ol, .cs-chs-guide ul { padding-left: 20px; font-size: 12.5px; line-height: 1.55; color: var(--gray-700, #374151); }
.cs-chs-guide li { margin: 3px 0; }
.cs-chs-guide h5 { margin: 12px 12px 0; font-size: 12.5px; color: var(--gray-800, #1f2937); }
.cs-chs-urls { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 12px; }
.cs-chs-url-lbl { font-size: 12px; font-weight: 600; color: var(--gray-600, #4b5563); margin-bottom: 3px; }
.cs-chs-url-row { display: flex; align-items: center; gap: 8px; }
.cs-chs-url-row code { flex: 1 1 auto; min-width: 0; padding: 6px 8px; display: block; }

/* Formularul căsuței de email + alegerea paginilor */
.cs-modal.cs-modal-mb { max-width: 760px; }
.cs-mb-form { gap: 12px; max-width: none; }
.cs-mb-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-mb-preset[aria-pressed="true"] { background: var(--cs-accent, #0891b2); border-color: var(--cs-accent, #0891b2); color: #fff; }
.cs-mb-preset-hint {
    margin-top: 6px;
    padding: 9px 11px;
    border-radius: 9px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0c4a6e;
    font-size: 12.5px;
    line-height: 1.5;
}
.cs-mb-preset-hint[hidden] { display: none; }
.cs-mb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; align-items: start; }
.cs-mb-grid > .cs-check { grid-column: 1 / -1; }
.cs-form-row.cs-mb-port .cs-input { max-width: 140px; }
.cs-form-row[hidden] { display: none; }
.cs-mb-fs { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--gray-200, #e5e7eb); border-radius: 12px; display: flex; flex-direction: column; gap: 10px; }
.cs-mb-fs > legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--gray-700, #374151); }
.cs-mb-ack { min-height: 92px; }
.cs-mb-test-res { padding: 9px 11px; border-radius: 9px; font-size: 12.5px; line-height: 1.5; }
.cs-mb-test-res[hidden] { display: none; }
.cs-mb-test-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.cs-mb-test-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.cs-mp-row { cursor: pointer; justify-content: flex-start; align-items: center; }
.cs-mp-row input { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Mobil ── */
@media (max-width: 900px) {
    .cs-ch-strip { gap: 6px 8px; padding: 6px 8px; }
    .cs-ch-strip-acct { max-width: 180px; }
    .cs-ch-strip-more { min-height: 34px; }
    .cs-ch-modes { display: flex; width: 100%; }
    .cs-ch-mode { flex: 1 1 0; min-height: 40px; }
    #chatSupportRoot .cs-msg.cs-email-msg { max-width: 96%; }
    #chatSupportRoot .cs-dlv-row .cs-dlv-btn { min-height: 36px; }
    .cs-em-full-btn { min-height: 36px; }
}
@media (max-width: 600px) {
    .cs-chs-grid { grid-template-columns: 1fr; }
    .cs-chs-card { padding: 12px; border-radius: 12px; }
    .cs-chs-item-actions { width: 100%; }
    .cs-chs-item-actions .cs-btn { flex: 1 1 calc(50% - 6px); }
    .cs-chs-page-head .cs-btn { margin-left: 0; width: 100%; }
    .cs-chs-togs { grid-template-columns: 1fr; }
    .cs-chs-url-row { flex-direction: column; align-items: stretch; }
    .cs-mb-grid { grid-template-columns: 1fr; }
    .cs-form-row.cs-mb-port .cs-input { max-width: none; }
    /* Ferestrele mari de canal ocupă tot ecranul pe telefon. */
    .cs-modal-overlay.cs-modal-overlay-full { padding: 0; }
    .cs-modal.cs-modal-email, .cs-modal.cs-modal-mb { max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; }
    .cs-em-frame { height: 58dvh; }
    .cs-modal-mb .cs-modal-actions { position: sticky; bottom: -20px; background: #fff; padding: 10px 0; flex-wrap: wrap; }
}
.cs-mp-row.is-off { opacity: 0.6; cursor: not-allowed; }
.cs-modal .cs-btn.cs-mb-preset[aria-pressed="true"] { color: #fff !important; background: var(--cs-accent, #0891b2) !important; border-color: var(--cs-accent, #0891b2) !important; }
.cs-ch-panel .cs-chw { white-space: normal; }

/* ── Canalul Email: emailuri ignorate, expeditor neverificat, Cc (reply-all) ── */
.cs-ch-strip-cc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; font-size: 12px; color: var(--gray-600, #4b5563); }
.cs-em-unverified {
    display: inline-block;
    margin: 0 0 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
}
.cs-modal.cs-modal-ign { max-width: 760px; width: calc(100vw - 32px); }
.cs-ign-help { font-size: 13px; color: var(--gray-600, #4b5563); margin: 0 0 10px; }
.cs-ign-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.cs-ign-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    background: var(--cs-surface, #fff);
}
.cs-ign-main { min-width: 0; flex: 1 1 auto; }
.cs-ign-subj { font-weight: 600; overflow-wrap: anywhere; }
.cs-ign-meta { font-size: 12px; color: var(--gray-500, #6b7280); overflow-wrap: anywhere; }
.cs-ign-reason { font-size: 12px; color: #92400e; margin-top: 2px; }
.cs-ign-excerpt { font-size: 12px; color: var(--gray-600, #4b5563); margin-top: 4px; overflow-wrap: anywhere; }
.cs-ign-act { flex-shrink: 0; }
.cs-ign-done { font-size: 12px; font-weight: 600; color: #15803d; white-space: nowrap; }
@media (max-width: 640px) {
    .cs-ign-item { flex-direction: column; }
    .cs-ch-strip-cc { max-width: 100%; white-space: normal; }
}

/* ─── Emoji: buton, selector (picker) și sugestii „:cod" (task #337) ─────── */
.cs-emoji-btn { font-size: 15px; line-height: 1; }
.cs-emoji-pop {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(100% + 6px);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 51;
    padding: 8px;
}
.cs-emoji-search { width: 100%; margin-bottom: 8px; }
.cs-emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 2px;
}
.cs-emoji-cell {
    border: 0;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    padding: 5px 0;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
}
.cs-emoji-cell:hover { background: var(--tk-teal-50, #ecfeff); }
.cs-emoji-cell:focus-visible { outline: 2px solid var(--tk-teal-600, #0891b2); outline-offset: 1px; }
.cs-emoji-suggest {
    position: absolute;
    left: 12px;
    bottom: calc(100% + 6px);
    min-width: 200px;
    max-width: 320px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm, 8px);
    box-shadow: var(--shadow-lg);
    max-height: 240px;
    overflow-y: auto;
    z-index: 52;
    padding: 6px;
}
.cs-emoji-sg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.cs-emoji-sg-item:hover,
.cs-emoji-sg-item.active { background: var(--tk-teal-50, #ecfeff); }
.cs-emoji-sg-item.active { outline: 1px solid var(--tk-teal-600, #0891b2); }
.cs-emoji-sg-e { font-size: 20px; line-height: 1; }
.cs-emoji-sg-code { font-size: 12.5px; color: var(--gray-600); }

/* ─── „Istoric client": secțiunea Apeluri (task #335 partea 2) ──────────── */
.cs-history-call { align-items: center; }
.cs-history-caldur { font-size: 12px; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.cs-history-rec {
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--tk-teal-700, #0e7490);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}
.cs-history-rec:hover { background: var(--tk-teal-50, #ecfeff); }
.cs-history-audio { height: 30px; max-width: 220px; }
.cs-history-recerr { font-size: 12px; color: var(--red-600, #dc2626); }
