/**
 * Support Center — Agent Dashboard + Admin Panel
 * Version 1.0.2 — all values hardcoded, no CSS variable dependencies
 */

/* ─────────────────────────────────────────────────────────────
   RESET — isolate from theme interference
───────────────────────────────────────────────────────────── */
.sc-agent-dashboard,
.sc-agent-dashboard *,
.sc-admin-panel,
.sc-admin-panel * {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}
.sc-agent-dashboard,
.sc-admin-panel {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #111827;
}


/* ═════════════════════════════════════════════════════════════
   AGENT DASHBOARD  [support_agent_dashboard]   — premium layout (v1.3)

   Everything is derived from the admin "Brand color" via the
   --sc-user-* tokens printed in <head> (see inject_inline_css_vars).
   Elements appended to <body> by JS (call alert, toasts, modal) carry
   their own classes and share the same token block.
═════════════════════════════════════════════════════════════ */
.sc-agent-dashboard,
.sc-dash-float,
.sc-dash-toast,
.sc-dash-handover,
.sc-dash-modal-overlay {
    --sc-brand:        var(--sc-user-brand, #F5A623);
    --sc-brand-dark:   var(--sc-user-brand-dark, #D4881A);
    --sc-brand-light:  var(--sc-user-brand-light, #FFF8EC);
    --sc-on-brand:     var(--sc-user-on-brand, #1c1303);
    --sc-grad-end:     var(--sc-user-grad-end, #F9C466);

    --sc-brand-ink:    var(--sc-brand-dark);
    --sc-tint-1:       var(--sc-brand-light);
    --sc-tint-2:       var(--sc-brand-light);
    --sc-brand-line:   var(--sc-brand-light);
    --sc-ring:         rgba(16, 24, 40, 0.14);
    --sc-bubble-out:   var(--sc-brand-light);
    --sc-page:         #F3F5F8;
    --sc-live-top:     #17261f;
    --sc-live-bottom:  #0d1814;

    --sc-text:         #101828;
    --sc-muted:        #566074;
    --sc-faint:        #8591A5;
    --sc-line:         #E6EAF0;
    --sc-line-strong:  #D3D9E3;
    --sc-wash:         #F6F8FA;
    --sc-bubble-in:    #F2F4F7;
    --sc-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
    .sc-agent-dashboard,
    .sc-dash-float,
    .sc-dash-toast,
    .sc-dash-handover,
    .sc-dash-modal-overlay {
        --sc-brand-ink:   color-mix(in srgb, var(--sc-brand) 52%, #000);
        --sc-tint-1:      color-mix(in srgb, var(--sc-brand) 8%,  #fff);
        --sc-tint-2:      color-mix(in srgb, var(--sc-brand) 16%, #fff);
        --sc-brand-line:  color-mix(in srgb, var(--sc-brand) 34%, #fff);
        --sc-ring:        color-mix(in srgb, var(--sc-brand) 28%, transparent);
        --sc-bubble-out:  color-mix(in srgb, var(--sc-brand) 15%, #fff);
        --sc-page:        color-mix(in srgb, var(--sc-brand) 4%, #F2F4F7);
        --sc-live-top:    color-mix(in srgb, var(--sc-brand) 44%, #000);
        --sc-live-bottom: color-mix(in srgb, var(--sc-brand) 20%, #000);
    }
}

.sc-agent-dashboard {
    max-width: 1520px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: var(--sc-font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--sc-text);
    background: var(--sc-page);
    border: 1px solid rgba(16, 24, 40, 0.08);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 30px 70px -34px rgba(16, 24, 40, 0.42), 0 3px 10px rgba(16, 24, 40, 0.05);
}
.sc-agent-dashboard button,
.sc-agent-dashboard input,
.sc-agent-dashboard select,
.sc-agent-dashboard textarea { font-family: inherit; }
.sc-agent-dashboard button { margin: 0; text-transform: none; letter-spacing: normal; }
.sc-agent-dashboard svg { flex-shrink: 0; }
.sc-agent-dashboard h2,
.sc-agent-dashboard h3 { margin: 0; padding: 0; text-transform: none; letter-spacing: normal; }
.sc-agent-dashboard :focus-visible,
.sc-dash-float :focus-visible,
.sc-dash-modal-overlay :focus-visible { outline: 2px solid var(--sc-brand-ink); outline-offset: 2px; }
.sc-dash-header :focus-visible { outline-color: var(--sc-on-brand); }

/* ── Top bar ─────────────────────────────────────────────────── */
.sc-dash-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 24px;
    color: var(--sc-on-brand);
    background:
        radial-gradient(60% 160% at 100% -40%, rgba(255,255,255,.26) 0%, rgba(255,255,255,0) 60%),
        radial-gradient(40% 140% at 0% 140%, rgba(0,0,0,.16) 0%, rgba(0,0,0,0) 62%),
        linear-gradient(120deg, var(--sc-brand) 0%, var(--sc-grad-end) 100%);
}
.sc-dash-brand { display: flex; align-items: center; gap: 14px; min-width: 0; flex: none; }
.sc-dash-logo {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid rgba(255,255,255,.92);
    background: rgba(255,255,255,.3);
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 8px 18px -8px rgba(0,0,0,.4);
}
.sc-dash-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-agent-dashboard .sc-dash-title { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; color: inherit; white-space: nowrap; }

.sc-dash-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 280px;
    max-width: 560px;
    min-width: 0;
    height: 48px;
    margin: 0 auto 0 12px;
    padding: 0 18px;
    border-radius: 999px;
    background: #fff;
    color: var(--sc-text);
    box-shadow: 0 10px 24px -14px rgba(0,0,0,.5);
    transition: box-shadow .15s;
}
.sc-dash-search:focus-within { box-shadow: 0 0 0 4px rgba(255,255,255,.4), 0 10px 24px -14px rgba(0,0,0,.5); }
.sc-dash-search svg { width: 19px; height: 19px; color: var(--sc-muted); }
.sc-agent-dashboard .sc-dash-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    font-size: 14.5px;
    color: var(--sc-text);
    -webkit-appearance: none;
    appearance: none;
}
.sc-dash-search input::placeholder { color: var(--sc-muted); opacity: 1; }
.sc-dash-search input::-webkit-search-cancel-button { cursor: pointer; }

.sc-dash-actions { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; max-width: 100%; }
.sc-dash-pill,
.sc-dash-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.34);
    background: rgba(255,255,255,.14);
    color: inherit;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
}
.sc-dash-pill svg { width: 19px; height: 19px; }
.sc-dash-pill b { font-weight: 700; }
.sc-dash-status { position: relative; cursor: pointer; background: rgba(255,255,255,.22); font-weight: 600; user-select: none; }
.sc-dash-status input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sc-dash-status:focus-within { outline: 2px solid var(--sc-on-brand); outline-offset: 2px; }
.sc-dash-status-dot { width: 11px; height: 11px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.28); }
.sc-dash-status-off { display: none; }
.sc-dash-status input:not(:checked) ~ .sc-dash-status-on  { display: none; }
.sc-dash-status input:not(:checked) ~ .sc-dash-status-off { display: inline; }
.sc-dash-status input:not(:checked) ~ .sc-dash-status-dot { background: #9AA4B2; box-shadow: 0 0 0 3px rgba(154,164,178,.3); }
.sc-dash-avatar-btn {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 2.5px solid rgba(255,255,255,.92);
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    color: var(--sc-brand-ink);
    cursor: pointer;
    transition: transform .15s;
}
.sc-dash-avatar-btn:hover { transform: scale(1.05); }
.sc-dash-avatar-btn.active { box-shadow: 0 0 0 3px rgba(255,255,255,.5); }
.sc-dash-avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-dash-avatar-btn svg { width: 22px; height: 22px; }

/* ── Layout ──────────────────────────────────────────────────── */
.sc-dash-body {
    display: grid;
    grid-template-columns: minmax(300px, 370px) minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    height: clamp(620px, calc(100vh - 210px), 880px);
    min-height: 0;
}
.sc-dash-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
    padding: 1px 2px 2px 1px;
    scrollbar-width: thin;
    scrollbar-color: var(--sc-line-strong) transparent;
}

/* ── Side cards ──────────────────────────────────────────────── */
.sc-dash-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--sc-line);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 24px -20px rgba(16,24,40,.35);
    overflow: hidden;
}
.sc-dash-card.sc-tone-conv { flex: 1 1 300px; min-height: 230px; }
.sc-dash-card.is-collapsed { flex: 0 0 auto; min-height: 0; }
.sc-dash-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    cursor: pointer;
    user-select: none;
}
.sc-dash-card-head h3 { flex: 1; min-width: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.005em; color: var(--sc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-dash-card-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
}
.sc-dash-card-icon svg { width: 20px; height: 20px; }
.sc-dash-count {
    min-width: 30px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #EEF1F5;
    color: var(--sc-text);
    font-size: 13px;
    font-weight: 650;
    text-align: center;
}
.sc-dash-chev { display: grid; place-items: center; color: var(--sc-faint); transition: transform .2s; }
.sc-dash-card.is-collapsed .sc-dash-chev { transform: rotate(-90deg); }
.sc-dash-card-body { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--sc-line); scrollbar-width: thin; scrollbar-color: var(--sc-line-strong) transparent; }
.sc-dash-card.is-collapsed .sc-dash-card-body { display: none; }
.sc-dash-card.is-collapsed .sc-dash-card-head { padding-bottom: 15px; }
.sc-dash-icon-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--sc-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.sc-dash-icon-btn:hover { background: var(--sc-tint-1); color: var(--sc-brand-ink); }
.sc-dash-icon-btn.is-spinning svg { animation: scDashSpin .8s linear infinite; }
@keyframes scDashSpin { to { transform: rotate(360deg); } }
.sc-dash-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; animation: scDashLive 1.6s ease-in-out infinite; }
@keyframes scDashLive { 0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); } }

.sc-sessions-list,
.sc-tickets-panel,
.sc-voice-queue-panel { max-height: none; overflow: visible; }
.sc-tickets-panel,
.sc-voice-queue-panel { padding: 12px; }

.sc-agent-dashboard .sc-dash-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 26px 16px;
    border-radius: 14px;
    background: var(--sc-wash);
    color: var(--sc-muted);
    font-size: 13.5px;
}
.sc-dash-empty svg { width: 28px; height: 28px; color: var(--sc-muted); opacity: .85; }
.sc-sessions-list > .sc-dash-empty { margin: 12px; }
.sc-agent-dashboard .sc-loading { padding: 22px; text-align: center; color: var(--sc-muted); font-size: 13px; }
.sc-dash-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #FFF4E0;
    color: #8A4B08;
    font-size: 13.5px;
}

/* ── Conversation rows ───────────────────────────────────────── */
.sc-session-item {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px 16px;
    border-bottom: 1px solid #EEF1F4;
    border-left: 0;
    cursor: pointer;
    background: #fff;
    transition: background .12s;
}
.sc-session-item:last-child { border-bottom: 0; }
.sc-session-item:hover { background: var(--sc-wash); }
.sc-session-item.active { background: var(--sc-tint-1); box-shadow: inset 3px 0 0 var(--sc-brand); border-left: 0; }
.sc-session-item.is-ended .sc-session-name,
.sc-session-item.is-ended .sc-session-preview { opacity: .78; }
.sc-session-avatar-wrap { position: relative; flex: none; }
.sc-session-avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
    font-size: 14px;
    font-weight: 700;
}
.sc-session-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-session-dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; border: 2.5px solid #fff; }
.sc-session-item.active .sc-session-dot { border-color: var(--sc-tint-1); }
.sc-session-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sc-session-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sc-session-name { font-size: 15px; font-weight: 650; color: var(--sc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-session-time { flex: none; font-size: 12px; color: var(--sc-faint); }
.sc-session-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sc-session-location { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--sc-muted); }
.sc-session-location svg { width: 14px; height: 14px; }
.sc-session-location span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-session-preview { font-size: 13px; color: var(--sc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sc-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 3px 9px;
    border-radius: 8px;
    background: #F1F3F6;
    color: #566074;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}
.sc-tag svg { width: 13px; height: 13px; }
.sc-tag-muted  { background: #F1F3F6; color: #566074; }
.sc-tag-danger { background: #FEECEC; color: #B42318; }
.sc-tag-violet { background: #EFE9FD; color: #5B34C4; }
.sc-tag-blue   { background: #E6EFFE; color: #1F55B8; }
.sc-tag-warn   { background: #FFF1DB; color: #A4570B; }
.sc-session-tags .sc-unread-badge {
    margin-left: auto;
    display: grid;
    place-items: center;
    width: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--sc-brand);
    color: var(--sc-on-brand);
    font-size: 12px;
    font-weight: 700;
}

/* ── Voice queue rows ────────────────────────────────────────── */
.sc-voice-queue-panel .sc-queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--sc-line);
    border-radius: 14px;
    background: #fff;
}
.sc-voice-queue-panel .sc-queue-item:last-child { margin-bottom: 0; }
.sc-queue-avatar { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: #E1ECFC; color: #1F5FBF; font-size: 12.5px; font-weight: 700; }
.sc-voice-queue-panel .sc-queue-info { flex: 1; min-width: 0; }
.sc-queue-name { font-size: 14px; font-weight: 650; color: var(--sc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-queue-meta { font-size: 12px; color: var(--sc-muted); }
.sc-voice-queue-panel .sc-callback-badge { margin-left: auto; padding: 4px 10px; border-radius: 8px; background: #E6EFFE; color: #1F55B8; font-size: 12px; font-weight: 600; }
.sc-answer-queue-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: #DDF4EA;
    color: #0B6B45;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
}
.sc-answer-queue-btn:hover { background: #C4EBD9; }
.sc-answer-queue-btn:disabled { opacity: .5; cursor: default; }
.sc-answer-queue-btn svg { width: 15px; height: 15px; }

/* ── Main panel ──────────────────────────────────────────────── */
.sc-dash-main {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: #fff;
    border: 1px solid var(--sc-line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 24px -20px rgba(16,24,40,.35);
}
.sc-dash-tabs { display: flex; align-items: center; gap: 4px; flex: none; padding: 0 12px 0 10px; border-bottom: 1px solid var(--sc-line); background: #fff; }
.sc-agent-panel-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 17px 20px 18px;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--sc-muted);
    font-size: 16px;
    font-weight: 650;
    cursor: pointer;
    transition: color .15s;
}
.sc-agent-panel-tab svg { width: 22px; height: 22px; }
.sc-agent-panel-tab::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--sc-brand);
    transform: scaleX(0);
    transition: transform .2s;
}
.sc-agent-panel-tab:hover { color: var(--sc-text); }
.sc-agent-panel-tab.active { color: var(--sc-brand-ink); }
.sc-agent-panel-tab.active::after { transform: scaleX(1); }

.sc-agent-dashboard .sc-agent-lang-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    height: 44px;
    padding: 0 10px 0 14px;
    border: 1px solid var(--sc-line);
    border-radius: 999px;
    background: #fff;
    color: var(--sc-muted);
}
.sc-agent-dashboard .sc-agent-lang-wrap .sc-lang-icon { display: grid; place-items: center; color: var(--sc-muted); }
.sc-agent-dashboard .sc-agent-lang-wrap .sc-lang-icon svg { width: 20px; height: 20px; }
.sc-agent-dashboard .sc-agent-lang-wrap .sc-lang-select {
    max-width: 150px;
    padding: 6px 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sc-text) !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
.sc-agent-dashboard .sc-agent-lang-wrap:focus-within { border-color: var(--sc-brand); box-shadow: 0 0 0 4px var(--sc-ring); }

/* Conversation header */
.sc-chat-head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: none;
    padding: 16px 24px;
    border-bottom: 1px solid var(--sc-line);
    background: #fff;
}
.sc-chat-head-avatar { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: var(--sc-tint-2); color: var(--sc-brand-ink); font-size: 16px; font-weight: 700; }
.sc-chat-head-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-chat-head-text { flex: 1; min-width: 0; }
.sc-chat-head-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--sc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-chat-head-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: 13px; color: var(--sc-muted); }
.sc-chat-head-state { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: #0B6B45; }
.sc-chat-head-state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; }
.sc-chat-head-state.is-ended { color: var(--sc-muted); }
.sc-chat-head-state.is-ended::before { background: #9AA4B2; }
.sc-chat-head-loc { display: inline-flex; align-items: center; gap: 6px; }
.sc-chat-head-loc:empty { display: none; }
.sc-chat-head-loc svg, .sc-chat-head-page svg { width: 15px; height: 15px; }
.sc-chat-head-page {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 1 auto;
    max-width: 38%;
    min-width: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--sc-tint-1);
    color: var(--sc-brand-ink);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.sc-chat-head-page:hover { background: var(--sc-tint-2); text-decoration: underline; }
.sc-chat-head-page span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Messages */
.sc-agent-messages {
    flex: 1;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 26px;
    overflow-y: auto;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: var(--sc-line-strong) transparent;
}
.sc-agent-dashboard .sc-no-session {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: auto;
    height: auto;
    min-height: 0;
    max-width: 380px;
    text-align: center;
    color: var(--sc-muted);
    font-size: 14.5px;
    line-height: 1.5;
}
.sc-no-session strong { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--sc-text); margin-top: 10px; }
.sc-no-session-icon { display: grid; place-items: center; width: 100px; height: 100px; border-radius: 50%; background: var(--sc-tint-1); color: var(--sc-brand-ink); }
.sc-no-session-icon svg { width: 46px; height: 46px; }

.sc-agent-dashboard .sc-msg { display: flex; align-items: flex-end; gap: 12px; }
.sc-agent-dashboard .sc-msg.sc-msg-in     { justify-content: flex-start; }
.sc-agent-dashboard .sc-msg.sc-msg-out    { flex-direction: row-reverse; }
.sc-agent-dashboard .sc-msg.sc-msg-system { justify-content: center; }
.sc-agent-dashboard .sc-msg-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--sc-tint-2);
    color: var(--sc-brand-ink);
    font-size: 12px;
    font-weight: 700;
}
.sc-agent-dashboard .sc-msg-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-agent-dashboard .sc-msg-avatar.is-bot { background: #EEF0FF; color: #4F46E5; }
.sc-agent-dashboard .sc-msg-avatar svg { width: 20px; height: 20px; }
.sc-agent-dashboard .sc-msg-inner { max-width: 68%; min-width: 0; }
.sc-agent-dashboard .sc-msg-bubble { padding: 13px 18px; border-radius: 20px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.sc-agent-dashboard .sc-msg.sc-msg-in  .sc-msg-bubble { background: var(--sc-bubble-in); color: var(--sc-text); border-bottom-left-radius: 6px; }
.sc-agent-dashboard .sc-msg.sc-msg-out .sc-msg-bubble { background: var(--sc-bubble-out); color: var(--sc-text); border-bottom-right-radius: 6px; }
.sc-agent-dashboard .sc-msg.sc-msg-system .sc-msg-bubble { padding: 5px 14px; border-radius: 999px; background: var(--sc-wash); color: var(--sc-muted); font-size: 12.5px; font-style: normal; }
.sc-agent-dashboard .sc-msg-time { margin-top: 5px; padding: 0 4px; font-size: 12px; color: var(--sc-faint); }
.sc-agent-dashboard .sc-msg.sc-msg-out .sc-msg-time { text-align: right; }
.sc-msg-file { display: inline-flex; align-items: center; gap: 8px; color: inherit; font-weight: 600; text-decoration: underline; }
.sc-msg-file svg { width: 16px; height: 16px; }

.sc-agent-typing { display: flex; align-items: center; gap: 10px; flex: none; padding: 0 26px 14px; border: 0; background: #fff; font-style: normal; color: var(--sc-muted); font-size: 13px; }
.sc-agent-typing .sc-typing-dots { display: inline-flex; gap: 4px; padding: 10px 14px; border-radius: 16px; background: var(--sc-tint-1); }
.sc-agent-typing .sc-typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--sc-brand-ink); opacity: .55; animation: scDashBounce 1.2s infinite; }
.sc-agent-typing .sc-typing-dots i:nth-child(2) { animation-delay: .2s; }
.sc-agent-typing .sc-typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes scDashBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

/* Reply bar */
.sc-agent-reply-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: none;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--sc-line);
    background: #fff;
}
.sc-reply-attach {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--sc-line-strong);
    border-radius: 50%;
    background: #fff;
    color: var(--sc-muted);
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.sc-reply-attach:hover { background: var(--sc-tint-1); color: var(--sc-brand-ink); border-color: var(--sc-brand-line); }
.sc-reply-attach svg { width: 21px; height: 21px; }
.sc-reply-attach.is-busy { opacity: .5; }
.sc-reply-pill {
    flex: 1 1 260px;
    min-width: 200px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border: 1px solid var(--sc-line-strong);
    border-radius: 26px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.sc-reply-pill:focus-within { border-color: var(--sc-brand); box-shadow: 0 0 0 4px var(--sc-ring); }
.sc-agent-dashboard .sc-agent-reply-bar textarea {
    display: block;
    flex: 1;
    min-width: 0;
    height: 46px;
    min-height: 46px;
    max-height: 140px;
    margin: 0;
    padding: 13px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    resize: none;
    overflow: hidden;
    font-size: 14.5px;
    line-height: 20px;
    color: var(--sc-text);
}
.sc-agent-reply-bar textarea::placeholder { color: var(--sc-faint); opacity: 1; }
.sc-agent-reply-bar textarea:disabled { cursor: not-allowed; }
.sc-reply-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Buttons */
.sc-agent-dashboard .sc-dbtn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 20px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    background: #fff;
    color: var(--sc-text);
    font-size: 14.5px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, filter .15s;
}
.sc-agent-dashboard .sc-dbtn svg { width: 18px; height: 18px; }
.sc-agent-dashboard .sc-dbtn:disabled { opacity: .5; cursor: not-allowed; }
.sc-agent-dashboard .sc-dbtn-primary { background: var(--sc-brand); color: var(--sc-on-brand); box-shadow: 0 10px 20px -12px var(--sc-brand); }
.sc-agent-dashboard .sc-dbtn-primary:hover:not(:disabled) { filter: brightness(.94); }
.sc-agent-dashboard .sc-dbtn-outline { border-color: var(--sc-brand-line); color: var(--sc-brand-ink); }
.sc-agent-dashboard .sc-dbtn-outline:hover:not(:disabled) { background: var(--sc-tint-1); border-color: var(--sc-brand); }
.sc-agent-dashboard .sc-dbtn-danger { border-color: #F4B4B0; color: #D92D20; }
.sc-agent-dashboard .sc-dbtn-danger:hover:not(:disabled) { background: #FEF3F2; border-color: #E5484D; }
.sc-agent-dashboard .sc-dbtn-ghost { border-color: var(--sc-line-strong); color: var(--sc-muted); }
.sc-agent-dashboard .sc-dbtn-ghost:hover:not(:disabled) { background: var(--sc-wash); color: var(--sc-text); }
.sc-dbtn-solid-danger,
.sc-agent-dashboard .sc-dbtn-solid-danger { background: #E5484D; color: #fff; }
.sc-dbtn-solid-danger:hover { filter: brightness(.94); }
.sc-agent-dashboard .sc-dbtn-sm { height: 36px; padding: 0 14px; font-size: 13px; gap: 6px; }
.sc-agent-dashboard .sc-dbtn-sm svg { width: 15px; height: 15px; }

/* Admin-style buttons that still appear in the profile panel */
.sc-agent-dashboard .sc-btn { height: 44px; padding: 0 22px; border-radius: 999px; font-size: 14px; font-weight: 650; }
.sc-agent-dashboard .sc-btn-primary { background: var(--sc-brand); color: var(--sc-on-brand); }
.sc-agent-dashboard .sc-btn-primary:hover { background: var(--sc-brand); filter: brightness(.94); }

/* ── Tickets ─────────────────────────────────────────────────── */
.sc-dash-tickets { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; }
.sc-tk-item { padding: 16px; margin-bottom: 12px; border: 1px solid var(--sc-line); border-radius: 16px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.sc-tk-item:hover { border-color: var(--sc-brand-line); box-shadow: 0 12px 24px -20px rgba(16,24,40,.45); }
.sc-tk-row { display: flex; align-items: center; gap: 14px; }
.sc-tk-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; background: #ECE5FB; color: #6338C9; }
.sc-tk-icon svg { width: 21px; height: 21px; }
.sc-tk-main { flex: 1; min-width: 0; }
.sc-tk-subject { font-size: 15px; font-weight: 650; color: var(--sc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-tk-meta { margin-top: 2px; font-size: 12.5px; color: var(--sc-muted); }
.sc-tk-status { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.sc-tk-status.is-open        { background: #FEECEC; color: #B42318; }
.sc-tk-status.is-in_progress { background: #FFF1DB; color: #A4570B; }
.sc-tk-status.is-resolved    { background: #E3F6EC; color: #0B6B45; }
.sc-tk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sc-tk-item .sc-tk-actions { padding-left: 56px; }

.sc-tk-detail { max-width: 820px; }
.sc-back-ico svg { transform: rotate(180deg); }
.sc-tk-detail-title { margin-top: 16px; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; color: var(--sc-text); }
.sc-tk-desc { margin: 16px 0 20px; padding: 16px; border-radius: 14px; background: var(--sc-wash); color: var(--sc-text); font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; }
.sc-tk-fields { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.sc-tk-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--sc-muted); }
.sc-tk-fields select { min-width: 170px; height: 44px; padding: 0 14px; border: 1px solid var(--sc-line-strong); border-radius: 12px; background: #fff; color: var(--sc-text); font-size: 14px; font-weight: 500; outline: none; }
.sc-tk-fields select:focus { border-color: var(--sc-brand); box-shadow: 0 0 0 4px var(--sc-ring); }
.sc-tk-thread-title { margin-bottom: 10px; font-size: 14px; font-weight: 700; color: var(--sc-text); }
.sc-tk-reply { margin-bottom: 10px; padding: 12px 16px; border-radius: 14px; border-left: 4px solid var(--sc-line-strong); background: var(--sc-wash); }
.sc-tk-reply.is-agent { border-left-color: var(--sc-brand); background: var(--sc-tint-1); }
.sc-tk-reply.is-note  { border-left-color: #E0A100; background: #FFF9E5; }
.sc-tk-reply-meta { margin-bottom: 4px; font-size: 12px; color: var(--sc-muted); }
.sc-tk-reply-meta b { color: var(--sc-text); }
.sc-tk-reply-body { font-size: 14px; line-height: 1.55; color: var(--sc-text); white-space: pre-wrap; }
.sc-tk-compose { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--sc-line); }
.sc-tk-compose textarea { display: block; width: 100%; padding: 14px 16px; border: 1px solid var(--sc-line-strong); border-radius: 14px; background: #fff; color: var(--sc-text); font-size: 14.5px; line-height: 1.5; resize: vertical; outline: none; box-shadow: none; }
.sc-tk-compose textarea:focus { border-color: var(--sc-brand); box-shadow: 0 0 0 4px var(--sc-ring); }
.sc-tk-compose .sc-tk-actions { margin-top: 12px; }

/* ── Live call panel (agent side) ───────────────────────────── */
.sc-call-panel {
    position: absolute;
    inset: 0;
    z-index: 30;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #fff;
    background:
        radial-gradient(70% 50% at 50% 30%, rgba(255,255,255,.1) 0%, rgba(255,255,255,0) 70%),
        linear-gradient(180deg, var(--sc-live-top) 0%, var(--sc-live-bottom) 100%);
}
.sc-call-panel-inner { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 420px; text-align: center; }
.sc-call-panel-ring { padding: 6px; margin-bottom: 18px; border-radius: 50%; border: 3px solid var(--sc-brand); background: rgba(255,255,255,.06); }
.sc-call-panel.is-connecting .sc-call-panel-ring { animation: scDashRing 1.5s infinite; }
.sc-call-panel.is-live .sc-call-panel-ring { box-shadow: 0 0 0 8px var(--sc-ring), 0 0 54px -6px var(--sc-brand); }
@keyframes scDashRing { 0%,100% { box-shadow: 0 0 0 0 var(--sc-ring); } 50% { box-shadow: 0 0 0 18px transparent; } }
.sc-call-panel-avatar { display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%; background: var(--sc-tint-2); color: var(--sc-brand-ink); font-size: 34px; font-weight: 700; }
.sc-call-panel-avatar svg { width: 48px; height: 48px; }
.sc-call-panel-name { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.sc-call-panel-status { margin-top: 4px; font-size: 14px; color: rgba(255,255,255,.75); }
.sc-call-panel-timer { margin: 10px 0 26px; font-size: 40px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.sc-call-panel-controls { display: flex; justify-content: center; gap: 22px; margin-bottom: 34px; }
.sc-call-panel-ctrl { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255,255,255,.72); }
.sc-call-panel-btn { display: grid; place-items: center; width: 60px; height: 60px; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.09); color: #fff; cursor: pointer; transition: background .15s; }
.sc-call-panel-btn:hover { background: rgba(255,255,255,.18); }
.sc-call-panel-btn.is-on { background: var(--sc-brand); border-color: var(--sc-brand); color: var(--sc-on-brand); }
.sc-call-panel-btn svg { width: 24px; height: 24px; }
.sc-call-panel-end { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 240px; height: 58px; padding: 0 28px; border: 0; border-radius: 999px; background: #E5484D; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 16px 28px -14px rgba(229,72,77,.8); transition: filter .15s; }
.sc-call-panel-end:hover { filter: brightness(.94); }
.sc-call-panel-end svg { width: 22px; height: 22px; }

/* ── Profile panel ───────────────────────────────────────────── */
.sc-agent-profile-panel { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: inherit; }
.sc-dash-panel-head { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 16px 24px; border-bottom: 1px solid var(--sc-line); }
.sc-dash-panel-head h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--sc-text); }
.sc-profile-body { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 26px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; }
.sc-profile-avatar-row { display: flex; align-items: center; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--sc-line); }
.sc-profile-avatar-circle { display: flex; align-items: center; justify-content: center; flex: none; width: 88px; height: 88px; border-radius: 50%; overflow: hidden; background: var(--sc-tint-2); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--sc-brand-line); }
.sc-profile-avatar-circle span { color: var(--sc-brand-ink) !important; }
.sc-profile-avatar-edit { position: absolute; right: 0; bottom: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sc-brand); color: var(--sc-on-brand); box-shadow: 0 4px 10px -2px rgba(0,0,0,.3); cursor: pointer; }
.sc-profile-avatar-edit svg { width: 15px; height: 15px; }
.sc-profile-display-name { font-size: 18px; font-weight: 700; color: var(--sc-text); margin-bottom: 2px; }
.sc-profile-fields { display: flex; flex-direction: column; gap: 16px; }
.sc-profile-label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 650; color: var(--sc-text); }
.sc-agent-dashboard .sc-profile-input { display: block; width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--sc-line-strong); border-radius: 12px; background: #fff; color: var(--sc-text); font-size: 14.5px; outline: none; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
.sc-agent-dashboard .sc-profile-input:focus { border-color: var(--sc-brand); box-shadow: 0 0 0 4px var(--sc-ring); }
.sc-profile-pwd-link { padding: 0; border: 0; background: none; color: var(--sc-brand-ink); font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; }

/* ── Elements appended to <body> ─────────────────────────────── */
.sc-dash-toast {
    position: fixed;
    top: 22px;
    left: 50%;
    z-index: 100001;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 12px 14px;
    border-radius: 14px;
    color: #fff;
    font-family: var(--sc-font);
    font-size: 14px;
    font-weight: 600;
    transform: translateX(-50%);
    box-shadow: 0 18px 36px -16px rgba(16,24,40,.55);
    animation: scDashToast .25s ease-out both;
}
.sc-dash-toast.is-ok    { background: #0F7B53; }
.sc-dash-toast.is-error { background: #D92D20; }
.sc-dash-toast-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.2); }
.sc-dash-toast-ico svg { width: 15px; height: 15px; }
@keyframes scDashToast { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.sc-dash-handover {
    position: fixed;
    top: 22px;
    left: 50%;
    z-index: 99997;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px 12px 12px;
    border-radius: 18px;
    background: var(--sc-brand);
    color: var(--sc-on-brand);
    font-family: var(--sc-font);
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transform: translateX(-50%);
    box-shadow: 0 20px 40px -16px rgba(16,24,40,.6);
    animation: scDashToast .25s ease-out both;
}
.sc-dash-handover-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.28); }
.sc-dash-handover-ico svg { width: 18px; height: 18px; }
.sc-dash-handover-btn { height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--sc-on-brand); color: var(--sc-brand); font-size: 13px; font-weight: 700; cursor: pointer; }

.sc-dash-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    width: 290px;
    padding: 24px 22px 18px;
    border-radius: 26px;
    color: #fff;
    text-align: center;
    cursor: grab;
    user-select: none;
    font-family: var(--sc-font);
    background: linear-gradient(180deg, var(--sc-live-top) 0%, var(--sc-live-bottom) 100%);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08) inset;
    animation: scDashFloatIn .28s cubic-bezier(.34,1.12,.64,1);
}
.sc-dash-float.is-dragging { cursor: grabbing; }
@keyframes scDashFloatIn { from { opacity: 0; transform: translateY(20px) scale(.92); } to { opacity: 1; transform: none; } }
.sc-dash-float-ring { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; background: rgba(255,255,255,.1); animation: scDashRing 1.3s infinite; }
.sc-dash-float-ring span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--sc-brand); color: var(--sc-on-brand); }
.sc-dash-float-ring svg { width: 26px; height: 26px; }
.sc-dash-float-title { font-size: 17px; font-weight: 700; }
.sc-dash-float-name { margin: 3px 0 20px; font-size: 14px; color: rgba(255,255,255,.72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-dash-float-actions { display: flex; justify-content: center; gap: 22px; }
.sc-dash-float-btn { display: grid; place-items: center; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; color: #fff; cursor: pointer; transition: filter .15s, transform .15s; }
.sc-dash-float-btn:hover { filter: brightness(1.1); transform: scale(1.05); }
.sc-dash-float-btn svg { width: 25px; height: 25px; }
.sc-dash-float-btn.is-answer  { background: #12A66A; box-shadow: 0 12px 22px -10px #12A66A; }
.sc-dash-float-btn.is-decline { background: #E5484D; box-shadow: 0 12px 22px -10px #E5484D; }
.sc-dash-float-hint { margin-top: 16px; font-size: 11.5px; color: rgba(255,255,255,.42); }

.sc-dash-modal-overlay { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(16,24,40,.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); font-family: var(--sc-font); }
.sc-dash-modal { position: relative; z-index: 100000; width: 100%; max-width: 380px; padding: 28px 26px 24px; border-radius: 22px; background: #fff; text-align: center; box-shadow: 0 40px 80px -24px rgba(16,24,40,.6); animation: scDashFloatIn .22s ease-out both; }
.sc-dash-modal-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--sc-text); }
.sc-dash-modal-text { margin: 0 0 24px; font-size: 14px; line-height: 1.55; color: var(--sc-muted); }
.sc-dash-modal-actions { display: flex; gap: 10px; }
.sc-dash-modal-actions .sc-dbtn { flex: 1; height: 46px; padding: 0 14px; }
/* .sc-dbtn lives under .sc-agent-dashboard for the main UI — the modal is mounted on <body>, so restate it */
.sc-dash-modal .sc-dbtn { appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid transparent; border-radius: 999px; background: #fff; color: var(--sc-text); font: 650 14.5px/1 var(--sc-font); cursor: pointer; transition: background .15s, filter .15s; }
.sc-dash-modal .sc-dbtn-outline { border-color: var(--sc-line-strong); color: var(--sc-muted); }
.sc-dash-modal .sc-dbtn-outline:hover { background: var(--sc-wash); }
.sc-dash-modal .sc-dbtn-primary { background: var(--sc-brand); color: var(--sc-on-brand); }
.sc-dash-modal .sc-dbtn-solid-danger { background: #E5484D; color: #fff; }
.sc-dash-modal .sc-dbtn:hover { filter: brightness(.95); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .sc-dash-body { grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); }
    .sc-dash-pill { padding: 0 13px; font-size: 13px; }
}
@media (max-width: 860px) {
    .sc-dash-header { flex-wrap: wrap; gap: 12px 14px; padding: 14px 16px; }
    .sc-dash-search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
    .sc-dash-body { grid-template-columns: minmax(0, 1fr); height: auto; padding: 12px; }
    .sc-dash-side, .sc-dash-card, .sc-dash-main { min-width: 0; }
    .sc-dash-side { overflow: visible; }
    .sc-dash-card.sc-tone-conv { flex: 0 0 auto; }
    .sc-dash-card.sc-tone-conv .sc-dash-card-body { max-height: 340px; }
    .sc-dash-main { min-height: 640px; }
    .sc-agent-panel-tab { padding: 15px 14px 16px; font-size: 15px; }
    .sc-chat-head { padding: 14px 16px; }
    .sc-chat-head-page { display: none !important; }
    .sc-agent-messages { padding: 16px; }
    .sc-agent-dashboard .sc-msg-inner { max-width: 82%; }
    .sc-dash-tickets { padding: 16px; }
}
@media (max-width: 560px) {
    .sc-dash-title { font-size: 18px; }
    .sc-dash-actions { flex-wrap: wrap; flex: 1 1 100%; margin-left: 0; }
    .sc-dash-pill { flex: 1 1 calc(50% - 5px); justify-content: center; padding: 0 10px; font-size: 12.5px; gap: 7px; min-width: 0; }
    .sc-dash-status { flex: 1 1 auto; justify-content: center; }
    .sc-agent-reply-bar { padding: 12px 12px 16px; }
    .sc-reply-actions { width: 100%; }
    .sc-reply-actions .sc-dbtn { flex: 1 1 calc(50% - 5px); padding: 0 12px; }
    .sc-tk-item .sc-tk-actions { padding-left: 0; }
    .sc-dash-float { right: 12px; bottom: 12px; width: calc(100vw - 24px); max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) {
    .sc-agent-dashboard *, .sc-dash-float, .sc-dash-float *, .sc-dash-toast, .sc-dash-handover, .sc-dash-modal { animation: none !important; transition: none !important; }
}

/* ═════════════════════════════════════════════════════════════
   SHARED PRIMITIVES — also consumed by the admin panel
   (support-admin.js builds .sc-msg-* / badges / empty states). Kept verbatim.
═════════════════════════════════════════════════════════════ */

.sc-unread-badge {
    background: #f5a623;
    color: #fff;
    border-radius: 50%;
    width: 17px;
    height: 17px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}


.sc-callback-badge {
    background: #dbeafe;
    color: #1e40af;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}


/* Message bubbles */
.sc-msg { display: flex; align-items: flex-end; gap: 8px; }
.sc-msg.sc-msg-agent    { justify-content: flex-start; }
.sc-msg.sc-msg-customer { justify-content: flex-end; }
.sc-msg.sc-msg-system   { justify-content: center; }
.sc-msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff8ec;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #d4881a;
}
.sc-msg-inner { max-width: 70%; }
.sc-msg-bubble {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}
.sc-msg.sc-msg-agent    .sc-msg-bubble { background: #f5a623; color: #fff; border-bottom-right-radius: 4px; }
.sc-msg.sc-msg-customer .sc-msg-bubble { background: #f3f4f6; color: #111827; border-bottom-left-radius: 4px; }
.sc-msg.sc-msg-system   .sc-msg-bubble { color: #9ca3af; font-size: 11px; font-style: italic; }
.sc-msg-time { font-size: 10px; color: #9ca3af; margin-top: 3px; padding: 0 2px; }
.sc-msg.sc-msg-agent .sc-msg-time { text-align: right; }

/* Loading / empty */
.sc-loading,
.sc-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    padding: 20px;
}

/* ═════════════════════════════════════════════════════════════
   ADMIN PANEL  [support_center_admin]
═════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   ADMIN PANEL — Modern full-width layout with collapsible sidebar
   ═══════════════════════════════════════════════════════════════════ */

/* ── Full-width override: strip WP .wrap margins / max-width ─────── */
body.wp-admin .wrap:has(.sc-admin-panel),
body.wp-admin .wrap:has(.sc-admin-panel) h1:first-child { display: none; }
.sc-admin-panel {
    --sidebar-w:       220px;
    --sidebar-w-coll:   64px;
    --sidebar-bg:      #16162a;
    --sidebar-accent:  #f5a623;
    --topbar-h:         56px;
    display: flex;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    background: #f8fafc;
    position: fixed;
    inset: 0;
    z-index: 9990;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sc-admin-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;  /* clips expanding content during width transition */
    transition: width 0.22s cubic-bezier(0.4,0,0.2,1);
    z-index: 10;
}
/* After transition completes, allow tooltips to escape sidebar bounds */
.sc-admin-sidebar:not(.sc-sidebar-collapsed) { overflow: hidden; }

/* Collapsed sidebar */
.sc-sidebar-collapsed {
    width: var(--sidebar-w-coll) !important;
    overflow: visible !important;  /* allow tooltips to escape */
    /* Delay overflow change until after width transition finishes */
    transition: width 0.22s cubic-bezier(0.4,0,0.2,1),
                overflow 0s linear 0.22s;
}

/* In collapsed mode: hide text labels, centre footer */
.sc-sidebar-collapsed .sc-admin-nav-label,
.sc-sidebar-collapsed .sc-admin-foot-name,
.sc-sidebar-collapsed .sc-admin-foot-label { opacity: 0; width: 0; overflow: hidden; white-space: nowrap; }
.sc-sidebar-collapsed .sc-admin-sidebar-foot { justify-content: center; }

/* Collapsed brand row: hide logo + name, centre the toggle button so it's always clickable */
.sc-sidebar-collapsed .sc-admin-sidebar-brand {
    justify-content: center;
    padding: 0 8px;
    overflow: visible;          /* never clip the toggle */
}
.sc-sidebar-collapsed .sc-admin-brand-circle { display: none; }
.sc-sidebar-collapsed .sc-admin-brand-name   { display: none; }
/* Flip chevron to point right when collapsed (expand direction) */
.sc-sidebar-collapsed #sc-sidebar-toggle { transform: rotate(180deg); }
/* When sidebar is collapsed the main area fills the freed space automatically
   because sidebar width shrinks and main has flex:1 — no explicit rule needed.
   Class is kept for future JS targeting. */
.sc-sidebar-is-collapsed .sc-admin-main { /* flex auto-expands */ }
#sc-sidebar-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    opacity: 0.7;
    transition: opacity 0.15s, background 0.15s, transform 0.25s cubic-bezier(0.4,0,0.2,1);
    margin-left: auto;   /* push to right in expanded brand row */
    z-index: 1;          /* always above other brand-row children */
    position: relative;
}
#sc-sidebar-toggle:hover {
    opacity: 1;
    background: rgba(255,255,255,0.12);
}
.sc-toggle-icon {
    width: 15px;
    height: 15px;
    display: block;
    flex-shrink: 0;
}
/* In collapsed mode the margin-left:auto would push it off-screen;
   brand row is justify-content:center so auto margin is meaningless there */
.sc-sidebar-collapsed #sc-sidebar-toggle { margin-left: 0; }

/* Sidebar brand row */
.sc-admin-sidebar-brand {
    height: var(--topbar-h);
    padding: 0 14px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    overflow: hidden;
}
.sc-admin-brand-circle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--sidebar-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.sc-admin-brand-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.18s, width 0.18s;
}

/* Sidebar nav */
.sc-admin-nav { flex: 1; padding: 10px 8px; overflow-y: auto; overflow-x: hidden; }
.sc-admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    border-left: none;
    border-radius: 10px;
    margin-bottom: 2px;
    user-select: none;
    white-space: nowrap;
    transition: background 0.14s, color 0.14s;
    position: relative;
    overflow: hidden;
}
.sc-admin-nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}
.sc-admin-nav-item.active {
    background: var(--sidebar-accent);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245,166,35,0.35);
}
.sc-admin-nav-icon { font-size: 18px; flex-shrink: 0; line-height: 1; width: 22px; text-align: center; display: flex; align-items: center; justify-content: center; }
.sc-admin-nav-icon svg { display: block; width: 18px; height: 18px; stroke: currentColor; transition: stroke 0.14s; }
.sc-admin-nav-label { transition: opacity 0.18s; }
/* Collapsed state: centre icon, hide label */
.sc-sidebar-collapsed .sc-admin-nav { padding: 10px 6px; }
.sc-sidebar-collapsed .sc-admin-nav-item { justify-content: center; padding: 12px 6px; border-radius: 10px; gap: 0; }

/* ── Collapsed sidebar tooltips ─────────────────────────────────────
   Shown only when sidebar is collapsed; appear to the right of each nav item.
   Arrow points left. Uses :before for the arrow and :after for the content. */

.sc-sidebar-collapsed .sc-admin-nav-item {
    position: relative;  /* anchor for pseudo-element tooltip */
    overflow: visible;   /* let tooltip escape the item bounds */
}

/* Tooltip box */
.sc-sidebar-collapsed .sc-admin-nav-item::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) scale(0.88);
    transform-origin: left center;
    background: #1e2035;
    color: #f0f0f4;
    font-size: 12px;
    font-weight: 500;
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.28), 0 1px 4px rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.08);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 99999;
}

/* Tooltip left-pointing arrow */
.sc-sidebar-collapsed .sc-admin-nav-item::before {
    content: '';
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #1e2035;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 99999;
}

/* Show on hover */
.sc-sidebar-collapsed .sc-admin-nav-item:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}
.sc-sidebar-collapsed .sc-admin-nav-item:hover::before {
    opacity: 1;
}

/* Active item tooltip gets accent border */
.sc-sidebar-collapsed .sc-admin-nav-item.active::after {
    border-color: rgba(245,166,35,0.3);
    background: #252840;
}

/* Sidebar overflow:visible when collapsed is set in .sc-sidebar-collapsed rule above */
.sc-admin-nav { overflow: visible !important; }

/* ── End tooltips ─────────────────────────────────────────────────── */

/* Sidebar footer */
.sc-admin-sidebar-foot {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    overflow: hidden;
}
.sc-admin-foot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sidebar-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}
.sc-admin-foot-name  { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.85); white-space: nowrap; transition: opacity 0.18s; }
.sc-admin-foot-label { font-size: 10px; color: rgba(255,255,255,0.4); white-space: nowrap; transition: opacity 0.18s; }

/* ── Main area ─────────────────────────────────────────────────── */
.sc-admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: #f8fafc;
}

/* Sticky topbar */
.sc-admin-topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 9;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.sc-admin-page-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    white-space: nowrap;
}
.sc-admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.sc-date-range-picker {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 2px;
}
.sc-drp-btn {
    padding: 5px 10px;
    font-size: 12px;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    font-family: inherit;
    transition: all 0.12s;
}
.sc-drp-btn.active {
    background: #ffffff;
    color: #111827;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.sc-drp-btn:hover:not(.active) { background: #ffffff; color: #374151; }

.sc-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    color: #374151;
    transition: border-color 0.15s;
}
.sc-export-btn:hover { border-color: #f5a623; color: #d4881a; }

/* Views */
.sc-admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
    /* Content scrolls independently; topbar stays sticky */
}
.sc-admin-view { display: none; }
.sc-admin-view.active { display: block; }

/* ── Stat cards ── */
.sc-stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px,1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.sc-stat-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}
.sc-stat-card-label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sc-stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-bottom: 4px;
}
.sc-stat-card-delta { font-size: 11px; }
.sc-stat-card-delta.up   { color: #10b981; }
.sc-stat-card-delta.down { color: #ef4444; }

/* ── Charts ── */
.sc-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 800px) { .sc-charts-row { grid-template-columns: 1fr; } }

.sc-chart-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}
.sc-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 14px;
}
.sc-chart-wrap { position: relative; height: 200px; }

/* ── Tables ── */
.sc-admin-table-wrap {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}
.sc-admin-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-wrap: wrap;
    gap: 8px;
}
.sc-admin-table-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}
.sc-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.sc-filter-input,
.sc-filter-select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    background: #ffffff;
    color: #111827;
    outline: none;
    font-family: inherit;
}
.sc-filter-input:focus,
.sc-filter-select:focus { border-color: #f5a623; }

.sc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sc-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    white-space: nowrap;
}
.sc-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #111827;
    vertical-align: middle;
}
.sc-table tr:last-child td { border-bottom: none; }
.sc-table tbody tr:hover td { background: #fafafa; cursor: pointer; }
.sc-table .sc-table-empty td {
    text-align: center;
    color: #9ca3af;
    padding: 32px;
    cursor: default;
}

/* ── Status pills ── */
.sc-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.sc-pill-open     { background: #fef3c7; color: #92400e; }
.sc-pill-pending  { background: #dbeafe; color: #1e40af; }
.sc-pill-resolved { background: #d1fae5; color: #065f46; }
.sc-pill-closed   { background: #f3f4f6; color: #6b7280; }
.sc-pill-active   { background: #d1fae5; color: #065f46; }
.sc-pill-ended    { background: #f3f4f6; color: #6b7280; }
.sc-pill-waiting  { background: #fef3c7; color: #92400e; }
.sc-pill-urgent   { background: #fee2e2; color: #991b1b; }
.sc-pill-normal   { background: #fef3c7; color: #92400e; }
.sc-pill-low      { background: #f3f4f6; color: #6b7280; }
.sc-pill-callback { background: #dbeafe; color: #1e40af; }

/* ── Buttons ── */
.sc-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 500;
}
.sc-btn-primary            { background: #f5a623; color: #ffffff; }
.sc-btn-primary:hover      { background: #d4881a; }
.sc-btn-secondary          { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.sc-btn-secondary:hover    { background: #e5e7eb; }
.sc-btn-danger             { background: #fee2e2; color: #991b1b; }
.sc-btn-danger:hover       { background: #fecaca; }
.sc-btn-success            { background: #d1fae5; color: #065f46; }
.sc-btn-success:hover      { background: #a7f3d0; }
.sc-btn-sm { padding: 4px 10px; font-size: 11px; }

/* ── Pagination ── */
.sc-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
}
.sc-page-btns { display: flex; gap: 6px; }
.sc-page-btn {
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
}
.sc-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sc-page-btn:not(:disabled):hover { border-color: #f5a623; color: #d4881a; }

/* ── Slide-in detail panel ── */
.sc-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    height: 100vh;
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.sc-detail-panel.open { transform: translateX(0); }
.sc-detail-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 9998;
    display: none;
}
.sc-detail-panel-overlay.open { display: block; }
.sc-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.sc-detail-title { font-size: 15px; font-weight: 600; color: #111827; }
.sc-detail-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    line-height: 1;
}
.sc-detail-close:hover { background: #e5e7eb; color: #111827; }
.sc-detail-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.sc-detail-foot {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* ── Meta grid ── */
.sc-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.sc-meta-item label {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 3px;
}
.sc-meta-item span { font-size: 13px; color: #111827; }

/* ── Reply thread ── */
.sc-reply-thread { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.sc-reply-item { padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.sc-reply-item.customer  { background: #fff8ec; margin-left: 20px; }
.sc-reply-item.agent     { background: #f3f4f6; margin-right: 20px; }
.sc-reply-item.internal  { background: #fffbeb; border: 1px solid #fde68a; }
.sc-reply-item.original  { background: #f9fafb; font-style: italic; color: #6b7280; }
.sc-reply-sender { font-size: 11px; font-weight: 600; color: #6b7280; margin-bottom: 4px; }
.sc-reply-time   { font-size: 10px; color: #9ca3af; margin-top: 4px; text-align: right; }

/* Reply box */
.sc-reply-box { margin-top: 12px; }
.sc-reply-box textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    resize: vertical;
    min-height: 70px;
    color: #111827;
    background: #ffffff;
}
.sc-reply-box textarea:focus { border-color: #f5a623; }
.sc-reply-box-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}
.sc-internal-toggle {
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

/* ── KB layout ── */
.sc-kb-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 700px) { .sc-kb-layout { grid-template-columns: 1fr; } }

.sc-kb-cat-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}
.sc-kb-cat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.1s;
}
.sc-kb-cat-row:last-child { border-bottom: none; }
.sc-kb-cat-row:hover { background: #f9fafb; }
.sc-kb-cat-row.active {
    background: #fff8ec;
    border-left: 3px solid #f5a623;
}
.sc-kb-cat-icon { font-size: 15px; flex-shrink: 0; }
.sc-kb-cat-name { flex: 1; font-weight: 500; color: #111827; }
.sc-kb-cat-count { font-size: 11px; color: #9ca3af; }
.sc-kb-cat-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.sc-kb-cat-row:hover .sc-kb-cat-actions { opacity: 1; }
.sc-kb-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
    color: #6b7280;
}
.sc-kb-icon-btn:hover { background: #f3f4f6; color: #111827; }
.sc-add-cat-btn {
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-top: 1px solid #e5e7eb;
    font-size: 13px;
    color: #d4881a;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.sc-add-cat-btn:hover { background: #fff8ec; }

/* ── Article editor ── */
.sc-article-editor {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 16px;
    overflow: hidden;
}
.sc-editor-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sc-editor-body {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 800px) { .sc-editor-body { grid-template-columns: 1fr; } }

.sc-editor-field { margin-bottom: 12px; }
.sc-editor-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 5px;
}
.sc-editor-input,
.sc-editor-select,
.sc-editor-textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    outline: none;
}
.sc-editor-input:focus,
.sc-editor-select:focus,
.sc-editor-textarea:focus { border-color: #f5a623; }
.sc-editor-textarea { min-height: 200px; resize: vertical; }

.sc-preview-pane {
    background: #f9fafb;
    border-radius: 8px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.7;
    color: #111827;
    min-height: 200px;
    border: 1px solid #e5e7eb;
}
.sc-preview-pane h3 {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 600;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sc-editor-actions {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Agent cards ── */
.sc-agent-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.sc-agent-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
}
.sc-agent-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.sc-agent-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff8ec;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #d4881a;
    position: relative;
    flex-shrink: 0;
}
.sc-online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #ffffff;
    position: absolute;
    bottom: 0;
    right: 0;
}
.sc-offline-dot { background: #d1d5db !important; }
.sc-agent-card-name  { font-size: 14px; font-weight: 600; color: #111827; }
.sc-agent-card-role  { font-size: 11px; color: #9ca3af; }
.sc-agent-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}
.sc-agent-stat label {
    font-size: 10px;
    color: #9ca3af;
    display: block;
    margin-bottom: 2px;
}
.sc-agent-stat span { font-size: 15px; font-weight: 600; color: #111827; }
.sc-agent-card-actions { display: flex; gap: 6px; }

/* ── Voice queue ── */
.sc-voice-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px,1fr));
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.sc-voice-stat label {
    font-size: 10px;
    color: #9ca3af;
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.sc-voice-stat span { font-size: 18px; font-weight: 600; color: #111827; }
.sc-wait-timer { font-variant-numeric: tabular-nums; }

/* ── Settings ── */
.sc-settings-sections { display: flex; flex-direction: column; gap: 20px; }
.sc-settings-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.sc-settings-section-header {
    padding: 12px 18px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.sc-settings-section-body { padding: 18px; }
.sc-settings-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}
.sc-settings-row:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.sc-settings-label { width: 200px; flex-shrink: 0; }
.sc-settings-label strong { font-size: 13px; color: #111827; display: block; margin-bottom: 2px; }
.sc-settings-label span   { font-size: 11px; color: #9ca3af; }
.sc-settings-control { flex: 1; }
.sc-settings-input,
.sc-settings-select,
.sc-settings-textarea {
    width: 100%;
    max-width: 360px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    outline: none;
}
.sc-settings-input:focus,
.sc-settings-select:focus,
.sc-settings-textarea:focus { border-color: #f5a623; }
.sc-settings-textarea { min-height: 80px; resize: vertical; }
input[type="color"].sc-settings-input {
    padding: 4px;
    height: 36px;
    width: 80px;
    cursor: pointer;
}
.sc-settings-save-bar {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    margin: 0 -20px -20px;
}
.sc-settings-save-msg { font-size: 13px; color: #059669; font-weight: 500; }

/* ── Danger zone ── */
.sc-danger-zone {
    border: 1px solid #fecaca;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}
.sc-danger-zone-header {
    background: #fef2f2;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #991b1b;
    border-bottom: 1px solid #fecaca;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sc-danger-zone-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.sc-danger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.sc-danger-info strong { font-size: 13px; color: #111827; display: block; }
.sc-danger-info span   { font-size: 11px; color: #9ca3af; }

/* ── Toasts ── */
.sc-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.sc-toast {
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    animation: scToastIn 0.2s ease;
    pointer-events: all;
    max-width: 300px;
}
.sc-toast.success { background: #059669; }
.sc-toast.error   { background: #dc2626; }
.sc-toast.warning { background: #d97706; }
.sc-toast.info    { background: #2563eb; }
@keyframes scToastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Confirm dialog ── */
.sc-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.sc-confirm-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.sc-confirm-box h3 { font-size: 16px; font-weight: 600; color: #111827; margin: 0 0 8px; }
.sc-confirm-box p  { font-size: 13px; color: #6b7280; margin: 0 0 16px; line-height: 1.5; }
.sc-confirm-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 14px;
    outline: none;
}
.sc-confirm-input:focus { border-color: #ef4444; }
.sc-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Activity feed ── */
.sc-activity-feed { display: flex; flex-direction: column; }
.sc-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}
.sc-activity-item:last-child { border-bottom: none; }
.sc-activity-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff8ec;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #d4881a;
}
.sc-activity-text { flex: 1; color: #111827; line-height: 1.5; }
.sc-activity-time { font-size: 11px; color: #9ca3af; flex-shrink: 0; margin-top: 2px; }

/* ── Toggle switch ── */
.sc-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    display: inline-block;
    flex-shrink: 0;
}
.sc-toggle input { opacity: 0; width: 0; height: 0; }
.sc-toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}
.sc-toggle-slider:before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.sc-toggle input:checked + .sc-toggle-slider { background: #f5a623; }
.sc-toggle input:checked + .sc-toggle-slider:before { transform: translateX(16px); }

/* ── Checkbox ── */
.sc-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #111827;
    cursor: pointer;
    margin-bottom: 8px;
}
.sc-checkbox-row input { cursor: pointer; width: 14px; height: 14px; }

/* ── Stars ── */
.sc-stars       { color: #f5a623; letter-spacing: 1px; font-size: 13px; }
.sc-stars-empty { color: #d1d5db; }

/* ── Spinner ── */
.sc-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #f5a623;
    border-radius: 50%;
    animation: scSpin 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes scSpin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 900px) {
    .sc-admin-sidebar { width: 200px; }
    .sc-stat-cards { grid-template-columns: repeat(2,1fr); }
    .sc-meta-grid  { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .sc-admin-panel { flex-direction: column; }
    .sc-admin-sidebar { width: 100%; }
    .sc-admin-nav {
        display: flex;
        flex-direction: row;
        padding: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .sc-admin-nav::-webkit-scrollbar { display: none; }
    .sc-admin-nav-item {
        padding: 10px 12px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .sc-admin-nav-item.active { border-left: none; border-bottom-color: #f5a623; }
    .sc-admin-sidebar-brand,
    .sc-admin-sidebar-foot { display: none; }
    .sc-kb-layout  { grid-template-columns: 1fr; }
    .sc-detail-panel { width: 100%; }
    .sc-settings-label { width: 120px; }
}


/* ── Admin: quick-replies editor (Settings → Welcome message & quick replies) ── */
.sc-admin-panel .sc-qr-editor { max-width: 460px; }
.sc-admin-panel .sc-qr-list { display: flex; flex-direction: column; gap: 8px; }
.sc-admin-panel .sc-qr-row { display: flex; align-items: center; gap: 6px; }
.sc-admin-panel .sc-qr-row .sc-qr-input { flex: 1; min-width: 0; max-width: none; margin: 0; }
.sc-admin-panel .sc-qr-btn {
    display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0;
    border: 1px solid #d5dae3; border-radius: 8px; background: #fff; color: #566074; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.sc-admin-panel .sc-qr-btn:hover:not(:disabled) { background: #f3f5f8; color: #101828; }
.sc-admin-panel .sc-qr-btn:disabled { opacity: .35; cursor: default; }
.sc-admin-panel .sc-qr-remove:hover:not(:disabled) { background: #fef3f2; border-color: #f4b4b0; color: #d92d20; }
.sc-admin-panel .sc-qr-up svg { transform: rotate(180deg); }
.sc-admin-panel .sc-qr-btn svg { width: 16px; height: 16px; }
.sc-admin-panel .sc-qr-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.sc-admin-panel .sc-qr-count { font-size: 12px; color: #6b7280; }
