/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Arial, sans-serif;
    background: #f0f2f5;
    color: #212529;
    height: 100vh;
    overflow: hidden;
}

/* ── Login page ───────────────────────────────────────────────────────────── */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}
.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
    padding: 40px 36px;
    width: 360px;
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo img {
    height: 44px;
    width: auto;
    margin-bottom: 8px;
}
.login-logo p  { font-size: .85rem; color: #6c757d; margin-top: 4px; }
.login-error {
    background: #fde8e8;
    color: #c0392b;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: .85rem;
    margin-bottom: 16px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; }
.form-group input {
    width: 100%; padding: 9px 12px;
    border: 1px solid #ced4da; border-radius: 7px;
    font-size: .9rem; outline: none;
    transition: border-color .2s;
}
.form-group input:focus { border-color: #C4E435; }

/* ── Shared buttons ───────────────────────────────────────────────────────── */
.btn-primary {
    padding: 9px 18px;
    background: #C4E435; color: #1a1a1a;
    border: none; border-radius: 7px;
    font-size: .9rem; font-weight: 600; cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.btn-primary:hover:not(:disabled) { background: #A8C428; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-full { width: 100%; padding: 10px; font-size: .95rem; }
.btn-danger {
    padding: 9px 18px;
    background: #dc3545; color: #fff;
    border: none; border-radius: 7px;
    font-size: .9rem; cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.btn-danger:hover { background: #b02a37; }
.btn-secondary {
    padding: 9px 18px;
    background: #f8f9fa; color: #495057;
    border: 1px solid #ced4da; border-radius: 7px;
    font-size: .9rem; cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.btn-secondary:hover { background: #e9ecef; }

/* ── Dashboard layout ────────────────────────────────────────────────────── */
.dash-layout {
    display: flex;
    height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.dash-sidebar {
    width: 220px;
    background: #1a1f2e;
    color: #e0e4ef;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar-header {
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo {
    height: 30px;
    width: auto;
    display: block;
}
.sidebar-sub { font-size: .72rem; color: #8892aa; margin-top: 6px; }
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-btn {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 10px 16px;
    background: transparent; color: #c0c9de;
    border: none; border-left: 3px solid transparent;
    font-size: .88rem; cursor: pointer;
    border-radius: 0;
    transition: background .15s, color .15s, border-color .15s;
    text-align: left;
}
.nav-btn:hover  { background: rgba(255,255,255,.06); color: #fff; }
.nav-btn.active { background: rgba(196,228,53,.15); color: #C4E435; border-left-color: #C4E435; }
.badge {
    background: #3a4a6b; color: #c0c9de;
    font-size: .72rem; border-radius: 10px;
    padding: 1px 7px; min-width: 22px; text-align: center;
}
.badge-warn  { background: #7a4a00; color: #ffd07a; }
.badge-muted { background: #2a3040; color: #778; }
.badge-mine  { background: #5a189a; color: #fff; }
.badge-phone { background: #3d1f6e; color: #d4b8ff; }
.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex; align-items: center; justify-content: space-between;
    font-size: .8rem; color: #8892aa;
}
.btn-logout {
    background: none; border: 1px solid rgba(255,255,255,.18);
    color: #8892aa; border-radius: 5px; padding: 3px 9px;
    font-size: .75rem; cursor: pointer;
    transition: color .15s, border-color .15s;
}
.btn-logout:hover { color: #fff; border-color: rgba(255,255,255,.4); }

/* ── Main area ───────────────────────────────────────────────────────────── */
.dash-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Connection status bar ───────────────────────────────────────────────── */
.conn-bar {
    padding: 6px 16px;
    font-size: .78rem;
    background: #fff3cd; color: #856404;
    border-bottom: 1px solid #ffc107;
    flex-shrink: 0;
}
.conn-bar.connected { background: #d4edda; color: #155724; border-color: #28a745; }
.conn-bar.error     { background: #fde8e8; color: #721c24; border-color: #dc3545; }

/* ── Universal workspace panel ───────────────────────────────────────────── */
.workspace-panel {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* Left: session list column */
.workspace-list {
    width: 280px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 12px;
    border-right: 1px solid #dee2e6;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Right: tabbed chat area */
.workspace-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Session cards ───────────────────────────────────────────────────────── */
.empty-state { color: #6c757d; font-size: .88rem; text-align: center; padding: 32px 0; }

.session-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    padding: 12px 14px;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}
.session-card:hover   { box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.session-card.selected { border-color: #C4E435; }
.sc-top {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.sc-id    { font-size: .78rem; color: #6c757d; font-family: monospace; margin-right: auto; }
.sc-state {
    font-size: .68rem; font-weight: 700; border-radius: 10px;
    padding: 2px 7px; text-transform: uppercase;
}
.sc-preview {
    font-size: .82rem; color: #495057;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-meta { font-size: .72rem; color: #868e96; display: flex; gap: 10px; flex-wrap: wrap; }

.escalation-summary-banner {
    background: #fff3cd; color: #856404; border-bottom: 1px solid #ffe69c;
    font-size: .82rem; line-height: 1.4; padding: 8px 14px;
}
.escalation-summary-banner strong { font-weight: 700; }

/* Session state colours */
.state-ai_active          { background: #d4edda; color: #155724; }
.state-pending_escalation { background: #fff3cd; color: #856404; }
.state-assigned           { background: #e8d5ff; color: #5a189a; }
.state-human_active       { background: #cce5ff; color: #004085; }
.state-closed             { background: #e2e3e5; color: #495057; }
.sc-assigned-to           { color: #5a189a; font-weight: 600; }

/* ── Chat tab bar ─────────────────────────────────────────────────────────── */
.chat-tab-bar {
    display: flex;
    flex-direction: row;
    background: #f0f2f5;
    border-bottom: 1px solid #dee2e6;
    overflow-x: auto;
    min-height: 40px;
    flex-shrink: 0;
}
.chat-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 40px;
    font-size: .85rem;
    cursor: pointer;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    color: #495057;
}
.chat-tab:hover { background: #e9ecef; }
.chat-tab.active {
    background: #fff;
    border-bottom-color: #C4E435;
    font-weight: 600;
    color: #212529;
}
.tab-unread {
    background: #dc3545;
    color: #fff;
    border-radius: 10px;
    font-size: .7rem;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
}
.chat-tab-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: .9rem;
    padding: 0 2px;
    line-height: 1;
}
.chat-tab-close:hover { color: #dc3545; }

/* ── Chat panes container ────────────────────────────────────────────────── */
.chat-panes-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.chat-pane {
    display: none;
    flex-direction: column;
    height: 100%;
}
.chat-pane.active { display: flex; }
.chat-area-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #adb5bd;
    font-size: .95rem;
}

/* ── Per-pane header (session info + action buttons) ─────────────────────── */
.pane-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.pane-meta {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.pane-sid     { font-size: .82rem; font-family: monospace; color: #6c757d; }
.pane-channel { font-size: .78rem; color: #6c757d; }
.pane-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Chat messages ───────────────────────────────────────────────────────── */
.transcript-messages {
    flex: 1; overflow-y: auto;
    padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    background: #f8f9fa;
}
.tm-bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: .88rem;
    line-height: 1.45;
    word-break: break-word;
}
.tm-user  { background: #C4E435; color: #1a1a1a; align-self: flex-end; border-bottom-right-radius: 4px; }
.tm-bot   { background: #e9ecef; color: #212529; align-self: flex-start; border-bottom-left-radius: 4px; }
.tm-agent {
    background: #e8f5e9; color: #1b5e20;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border-left: 3px solid #4caf50;
}
.tm-agent-label { font-size: .72rem; font-weight: 700; color: #388e3c; display: block; margin-bottom: 3px; }
.tm-status {
    align-self: center; color: #868e96; font-size: .76rem;
    font-style: italic; text-align: center;
}
.tm-ts { font-size: .68rem; color: #adb5bd; margin-top: 2px; display: block; }

/* ── Reply box (shared by all panes) ─────────────────────────────────────── */
.reply-box {
    display: flex; gap: 8px; padding: 12px 16px;
    background: #fff; border-top: 1px solid #dee2e6;
    align-items: flex-end; flex-shrink: 0;
}
.pane-reply-input {
    flex: 1; padding: 9px 12px;
    border: 1px solid #ced4da; border-radius: 7px;
    font-size: .88rem; resize: none; outline: none;
    transition: border-color .2s; font-family: inherit;
}
.pane-reply-input:focus { border-color: #C4E435; }

/* ── Assignment row (inside pane actions) ────────────────────────────────── */
.assignment-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pane-assign-select {
    max-width: 150px;
    padding: 6px 10px;
    font-size: .82rem;
    border: 1px solid #ced4da; border-radius: 7px;
    outline: none; background: #fff; cursor: pointer;
}
.pane-assign-select:focus { border-color: #C4E435; }

/* ── Ticket panels (unchanged layout) ────────────────────────────────────── */
.tickets-panel {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.tickets-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: #fff; border-bottom: 1px solid #dee2e6;
    flex-shrink: 0; gap: 12px;
}
.tickets-title { font-size: 1rem; font-weight: 600; color: #212529; }
.tickets-filters { display: flex; gap: 8px; align-items: center; }
.ticket-filter-select {
    padding: 7px 10px;
    border: 1px solid #ced4da; border-radius: 7px;
    font-size: .85rem; outline: none; background: #fff;
    cursor: pointer;
}
.ticket-filter-select:focus { border-color: #C4E435; }
.tickets-list {
    flex: 1; overflow-y: auto;
    padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
}

.ticket-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    padding: 14px 16px;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
    border: 2px solid transparent;
    display: flex; flex-direction: column; gap: 5px;
}
.ticket-card:hover    { box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.ticket-card.selected { border-color: #6f42c1; }
.tc-customer { font-size: .9rem; font-weight: 600; color: #212529; }

.ticket-status-badge {
    font-size: .72rem; font-weight: 700; border-radius: 10px;
    padding: 2px 8px; text-transform: uppercase;
}
.status-open        { background: #fff3cd; color: #856404; }
.status-in_progress { background: #cce5ff; color: #004085; }
.status-resolved    { background: #d4edda; color: #155724; }
.status-closed      { background: #e2e3e5; color: #495057; }

/* ── Ticket detail panel ──────────────────────────────────────────────────── */
.ticket-detail-panel {
    flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.transcript-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: #fff; border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}
.btn-back {
    background: none; border: 1px solid #ced4da;
    border-radius: 6px; padding: 5px 12px;
    font-size: .85rem; cursor: pointer; color: #495057;
    transition: background .15s;
}
.btn-back:hover { background: #f8f9fa; }
.transcript-meta { flex: 1; display: flex; align-items: center; gap: 8px; }
.transcript-meta strong { font-size: .95rem; }
.tc-badge {
    font-size: .72rem; font-weight: 700; border-radius: 10px;
    padding: 2px 8px; text-transform: uppercase;
}
.tc-channel { font-size: .78rem; color: #6c757d; }
.transcript-actions { display: flex; gap: 8px; }

.ticket-detail-body {
    flex: 1; overflow-y: auto;
    padding: 20px; background: #f8f9fa;
    display: flex; flex-direction: column; gap: 16px;
}
.td-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    padding: 16px 18px;
}
.td-section-title {
    font-size: .8rem; font-weight: 700; color: #6c757d;
    text-transform: uppercase; letter-spacing: .05em;
    margin-bottom: 8px;
}
.td-row   { display: flex; flex-wrap: wrap; gap: 16px; }
.td-field { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.td-label { font-size: .72rem; font-weight: 600; color: #868e96; text-transform: uppercase; }
.td-value { font-size: .88rem; color: #212529; }
.td-source { color: #6f42c1; font-weight: 600; }
.td-block-text {
    font-size: .88rem; color: #212529; line-height: 1.55;
    white-space: pre-wrap; word-break: break-word; margin: 0;
}

/* ── Ticket creation modal ────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.modal-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,.2);
    width: 560px; max-width: 95vw;
    max-height: 90vh;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: #212529; }
.modal-close {
    background: none; border: none; font-size: 1.4rem;
    color: #6c757d; cursor: pointer; line-height: 1; padding: 0 4px;
}
.modal-close:hover { color: #212529; }
.modal-body {
    padding: 18px 20px;
    overflow-y: auto; flex: 1;
    display: flex; flex-direction: column; gap: 12px;
}
.modal-error {
    background: #fde8e8; color: #c0392b;
    border-radius: 6px; padding: 8px 12px; font-size: .85rem;
}
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.modal-body .form-group { margin-bottom: 0; }
.modal-body .form-group textarea {
    width: 100%; padding: 9px 12px;
    border: 1px solid #ced4da; border-radius: 7px;
    font-size: .88rem; outline: none; resize: vertical;
    transition: border-color .2s; font-family: inherit;
}
.modal-body .form-group textarea:focus { border-color: #C4E435; }
.modal-body .form-group select {
    width: 100%; padding: 9px 12px;
    border: 1px solid #ced4da; border-radius: 7px;
    font-size: .88rem; outline: none; background: #fff; cursor: pointer;
}
.modal-body .form-group select:focus { border-color: #C4E435; }
.req { color: #dc3545; }

/* ── Tickets: types, outcomes, timeline ──────────────────────────────────── */
.badge-lead { background: #fd7e14; color: #fff; }

.ticket-type-badge {
    font-size: .72rem; font-weight: 700; border-radius: 10px; padding: 2px 8px;
    background: #e9ecef; color: #495057;
}
.type-return             { background: #fde2e4; color: #9b2c3a; }
.type-vendor_reject_swap { background: #fff0d6; color: #8a5300; }
.type-warranty_claim     { background: #e3e8ff; color: #2f3fa0; }
.type-website_app_issue  { background: #dff5f2; color: #0b6b5d; }

.resolution-badge { font-size: .72rem; font-weight: 700; border-radius: 10px; padding: 2px 8px; }
.res-resolved   { background: #d4edda; color: #155724; }
.res-unresolved { background: #f8d7da; color: #842029; }

.td-muted { font-size: .78rem; color: #868e96; font-weight: normal; text-transform: none; letter-spacing: 0; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-success {
    padding: 9px 18px; background: #198754; color: #fff;
    border: none; border-radius: 7px; font-size: .9rem; cursor: pointer;
    white-space: nowrap;
}
.btn-success:hover { background: #146c43; }

.summary-card { border-left: 4px solid #C4E435; }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.summary-head .td-section-title { margin-bottom: 0; }
.summary-card .td-block-text { margin-top: 8px; }

.outcome-card.res-resolved   { border-left: 4px solid #198754; background: #f3fbf5; color: inherit; }
.outcome-card.res-unresolved { border-left: 4px solid #dc3545; background: #fdf3f4; color: inherit; }
.outcome-card .td-muted { margin-top: 6px; display: block; }

.log-event-form, .close-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.log-event-form textarea, .close-form textarea {
    flex: 1 1 100%; padding: 8px 10px; border: 1px solid #ced4da; border-radius: 7px;
    font-family: inherit; font-size: .88rem; resize: vertical; outline: none;
}
.log-event-form textarea:focus, .close-form textarea:focus { border-color: #C4E435; }
.close-card { border-left: 4px solid #dc3545; }
.radio-pill {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    border: 1px solid #ced4da; border-radius: 20px; padding: 5px 14px; font-size: .85rem;
}
.radio-pill:has(input:checked) { border-color: #212529; background: #f1f3f5; font-weight: 600; }

.timeline { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.tl-item { display: flex; gap: 10px; align-items: flex-start; }
.tl-icon {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    background: #f1f3f5; display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.tl-content { flex: 1; border-bottom: 1px solid #f1f3f5; padding-bottom: 8px; }
.tl-head { display: flex; gap: 8px; align-items: baseline; font-size: .82rem; color: #6c757d; }
.tl-head strong { color: #212529; }
.tl-time { margin-left: auto; font-size: .75rem; }
.tl-body { font-size: .86rem; color: #212529; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.tl-phone_call .tl-icon { background: #e3e8ff; }
.tl-closed .tl-icon     { background: #d4edda; }

.td-transcript { max-height: 420px; overflow-y: auto; margin-top: 10px; background: #f8f9fa; border-radius: 8px; }
details > summary { cursor: pointer; }

.modal-hint { font-size: .82rem; color: #6c757d; margin-bottom: 14px; }
.form-group select {
    width: 100%; padding: 9px 12px; border: 1px solid #ced4da; border-radius: 7px;
    font-size: .9rem; background: #fff; outline: none;
}

/* ── Session pane links (ticket / lead) ──────────────────────────────────── */
.sc-chip { font-size: .8rem; margin-left: 2px; }
.pane-links { display: flex; gap: 8px; padding: 6px 14px; background: #fafbfc; border-bottom: 1px solid #eef0f2; }
.link-chip {
    border: 1px solid #ced4da; background: #fff; border-radius: 14px;
    padding: 3px 12px; font-size: .78rem; cursor: pointer;
}
.link-chip.chip-ticket:hover { border-color: #2f3fa0; }
.link-chip.chip-lead { border-color: #fd7e14; color: #a14a00; }
.link-chip.chip-lead:hover { background: #fff4e8; }

/* ── Leads ───────────────────────────────────────────────────────────────── */
.stage-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-chip {
    border: 1px solid #ced4da; background: #fff; border-radius: 16px;
    padding: 5px 12px; font-size: .82rem; cursor: pointer;
}
.stage-chip span { font-weight: 700; margin-left: 4px; color: #6c757d; }
.stage-chip.active { background: #212529; color: #fff; border-color: #212529; }
.stage-chip.active span { color: #C4E435; }

.lead-stage-badge { font-size: .72rem; font-weight: 700; border-radius: 10px; padding: 2px 8px; text-transform: uppercase; }
.stage-created    { background: #fff0d6; color: #8a5300; }
.stage-in_contact { background: #cce5ff; color: #004085; }
.stage-sold       { background: #d4edda; color: #155724; }
.stage-lost       { background: #e2e3e5; color: #495057; }
.stage-chip.stage-created, .stage-chip.stage-in_contact, .stage-chip.stage-sold, .stage-chip.stage-lost { background: #fff; color: inherit; }
.stage-chip.active.stage-created, .stage-chip.active.stage-in_contact,
.stage-chip.active.stage-sold, .stage-chip.active.stage-lost { background: #212529; color: #fff; }

.lead-card { border-left: 4px solid #fd7e14; }
.lead-contact { font-size: .78rem; color: #495057; margin-left: auto; }
.lead-contact.muted { color: #adb5bd; font-style: italic; }

.lead-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 8px; }
.lead-form label { display: flex; flex-direction: column; gap: 3px; font-size: .72rem; font-weight: 600; color: #868e96; text-transform: uppercase; }
.lead-form input {
    padding: 7px 10px; border: 1px solid #ced4da; border-radius: 7px; font-size: .88rem;
    min-width: 170px; outline: none; text-transform: none; color: #212529; font-weight: normal;
}
.lead-form input:focus { border-color: #C4E435; }
.lead-products { list-style: none; display: flex; flex-direction: column; gap: 5px; margin-top: 8px; font-size: .86rem; }
.lead-products a { color: #2f3fa0; font-weight: 600; text-decoration: none; }
.lead-products a:hover { text-decoration: underline; }
.tl-compact .tl-icon { width: 20px; height: 20px; font-size: .7rem; background: transparent; margin-left: 4px; }
.tl-compact .tl-content { padding-bottom: 4px; }
.tl-compact .tl-head { font-size: .76rem; color: #adb5bd; }

/* ── Return outcome (Return tickets) ─────────────────────────────────────── */
.return-card { border-left: 4px solid #9b2c3a; }
.return-form { display: flex; flex-direction: column; gap: 10px; }
.return-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.return-group-label { font-size: .78rem; font-weight: 700; color: #6c757d; min-width: 120px; text-transform: uppercase; }
.ret-note { padding: 7px 10px; border: 1px solid #ced4da; border-radius: 7px; font-size: .86rem; outline: none; max-width: 520px; }
.ret-note:focus { border-color: #C4E435; }
.return-form .btn-sm { align-self: flex-start; }
.close-hint { margin-bottom: 8px; }
.return-badge { font-size: .72rem; font-weight: 700; border-radius: 10px; padding: 2px 8px; }
.ret-replacement_offered   { background: #e3e8ff; color: #2f3fa0; }
.ret-replacement_not_found { background: #fff0d6; color: #8a5300; }
.ret-refund_processing     { background: #fff3cd; color: #856404; }
.ret-refunded              { background: #d4edda; color: #155724; }

/* ── Lead source chip ────────────────────────────────────────────────────── */
.lead-source { font-size: .7rem; border-radius: 10px; padding: 2px 8px; background: #f1f3f5; color: #6c757d; }
.lead-source.src-manual { background: #e7f1ff; color: #1d4f91; }
.form-group textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #ced4da; border-radius: 7px;
    font-family: inherit; font-size: .9rem; outline: none; resize: vertical;
}

/* ── Verified widget customer ────────────────────────────────────────────── */
.sc-customer { color: #146c43; font-weight: 600; }
.pane-customer { font-size: .8rem; color: #146c43; font-weight: 600; background: #e8f5ec; border-radius: 10px; padding: 2px 9px; }

/* ── Google sign-in ──────────────────────────────────────────────────────── */
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 11px; border: 1px solid #dadce0; border-radius: 7px;
    background: #fff; color: #3c4043; font-size: .95rem; font-weight: 600;
    text-decoration: none; transition: background .15s, box-shadow .15s;
}
.btn-google:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.login-hint { font-size: .78rem; color: #6c757d; text-align: center; margin-top: 10px; line-height: 1.4; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: #adb5bd; font-size: .8rem; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid #e9ecef; }

/* ── Team tab ────────────────────────────────────────────────────────────── */
.team-add { display: flex; gap: 8px; align-items: center; }
.team-add input[type=email] { padding: 7px 10px; border: 1px solid #ced4da; border-radius: 7px; font-size: .88rem; min-width: 260px; outline: none; }
.team-add input[type=email]:focus { border-color: #C4E435; }
.team-check { font-size: .85rem; display: flex; align-items: center; gap: 5px; color: #495057; }
.team-error { margin: 10px 16px 0; }
.team-hint { font-size: .82rem; color: #6c757d; margin-bottom: 4px; }
.team-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.team-table th { text-align: start; font-size: .72rem; text-transform: uppercase; color: #868e96; padding: 10px 14px; background: #f8f9fa; }
.team-table td { padding: 10px 14px; border-top: 1px solid #f1f3f5; font-size: .88rem; }
.team-table tr.team-inactive td { color: #adb5bd; }
.team-actions { display: flex; gap: 6px; justify-content: flex-end; }
.role-badge { font-size: .72rem; font-weight: 700; border-radius: 10px; padding: 2px 8px; background: #e9ecef; color: #495057; }
.role-manager { background: #e3e8ff; color: #2f3fa0; }
