:root {
    --bg: #0b141a;
    --bg-elevated: #111b21;
    --panel: #1b2730;
    --panel-soft: #202c33;
    --panel-strong: #23333c;
    --accent: #00a884;
    --accent-soft: rgba(0, 168, 132, 0.2);
    --text: #e9edef;
    --muted: #c5d0d6;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

* { scrollbar-width: thin; scrollbar-color: #41525d transparent; }
body {
    background: linear-gradient(180deg, #081116 0%, #0f171d 100%);
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    min-height: 100vh;
}

a { text-decoration: none; }
.app-shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.app-main { padding: 14px 18px; }
.glass-panel {
    background: linear-gradient(180deg, rgba(32, 44, 51, 0.9), rgba(17, 27, 33, 0.94));
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}
.sidebar {
    padding: 14px 10px;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(9, 18, 23, 0.98), rgba(14, 22, 28, 0.95));
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}
.brand-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.brand-logo, .hero-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(0, 168, 132, 0.25), rgba(64, 128, 255, 0.22));
    color: #fff;
    font-size: 1rem;
}
.brand-title { font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.brand-subtitle, .eyebrow, .text-secondary { color: var(--muted) !important; font-size: 0.75rem; }
.text-muted { color: var(--muted) !important; }
.sidebar .nav-link {
    color: var(--muted);
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 7px 10px;
    border-radius: 8px;
    margin-bottom: 2px;
    font-size: 0.82rem;
    transition: 150ms ease;
}
.sidebar .nav-link i { width: 16px; text-align: center; font-size: 0.85rem; }
.sidebar .nav-link.active, .sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}
.sidebar-foot { margin-top: auto; padding: 8px; }
.tiny-url { word-break: break-all; color: var(--muted); font-size: 0.7rem; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 8px;
    margin-bottom: 14px;
    min-height: 52px;
}
.page-title { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.topbar-actions, .quick-actions, .filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-pill, .user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    font-size: 0.78rem;
}
.hero-banner, .section-head, .stat-card, .metric-row, .action-card, .campaign-card, .status-card, .user-row, .info-card { position: relative; overflow: hidden; }
.hero-banner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 18px 22px;
    margin-bottom: 16px;
}
.hero-banner h2 { margin: 0; font-weight: 700; font-size: 1.1rem; }
.hero-banner p { font-size: 0.8rem; color: var(--muted); margin: 4px 0 0; }
.section-head h3 { margin: 0; font-weight: 700; font-size: 0.95rem; color: #ffffff; }
.panel-title { margin: 0 0 14px; font-weight: 700; font-size: 0.9rem; color: #ffffff; padding: 0; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.stat-card { padding: 12px 14px; }
.stat-card span { font-size: 0.75rem; color: var(--muted); }
.stat-card strong { display: block; font-size: 1.4rem; margin: 4px 0 2px; }
.stat-card small { font-size: 0.72rem; color: var(--muted); }
.dashboard-grid, .content-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 12px;
}
.dashboard-grid > .glass-panel, .content-grid > .glass-panel { padding: 18px; }
.activity-panel { grid-row: span 2; }
.chart-panel canvas { min-height: 220px; }
.metric-stack, .activity-feed, .campaign-list, .user-list { display: grid; gap: 8px; }
.metric-row, .user-row, .info-card, .campaign-card {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.action-card {
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(0,168,132,0.08), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text);
    font-size: 0.82rem;
}
.action-card i { font-size: 1rem; color: var(--accent); }
.activity-item { display: flex; gap: 10px; align-items: flex-start; font-size: 0.8rem; }
.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-top: 4px;
    background: linear-gradient(180deg, #00a884, #46c8a3);
    box-shadow: 0 0 0 3px rgba(0,168,132,0.15);
    flex-shrink: 0;
}

/* Chat */
.chat-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 240px;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}
.chat-sidebar, .chat-center, .contact-sidebar { overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.contact-sidebar { overflow-y: auto; }
.panel-toolbar, .chat-head { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.chat-head { display: flex; justify-content: space-between; align-items: center; }
.chat-head-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.conversation-list { overflow-y: auto; padding: 6px; flex: 1; min-height: 0; }
.conversation-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 3px;
    transition: 150ms ease;
    text-align: left;
    font-size: 0.82rem;
}
.conversation-item:hover, .conversation-item.active { background: rgba(255, 255, 255, 0.06); }
.conversation-avatar, .contact-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0, 168, 132, 0.16);
    color: var(--accent);
    font-size: 0.85rem;
}
.conversation-body { min-width: 0; flex: 1; }
.conversation-top, .conversation-meta { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.conversation-preview { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; font-size: 0.78rem; }
.status-dot { width: 8px; height: 8px; border-radius: 999px; }
.status-online { background: #00a884; }
.status-assigned { background: #53a2ff; }
.status-closed { background: #667781; }

/* ── Conversation status colors ── */
.status-escalated  { background: #0d6efd; animation: pulse-status 1.8s ease-in-out infinite; }
.status-hostile    { background: #ff9500; animation: pulse-status 1.5s ease-in-out infinite; }
.status-appointment { background: #198754; }
.status-no_response { background: #ffc107; }
.status-client_initiated { background: #00d4aa; animation: pulse-status 2s ease-in-out infinite; }
.conversation-item:has(.status-client_initiated) { border-left: 3px solid #00d4aa; background: rgba(0,212,170,0.08); }
.conversation-item:has(.status-client_initiated):hover { background: rgba(0,212,170,0.15); }

@keyframes pulse-status {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,255,255,0.3); }
    50% { opacity: 0.7; box-shadow: 0 0 6px 2px rgba(255,255,255,0.2); }
}

/* Sidebar highlights per status */
.conversation-item:has(.status-escalated)   { border-left: 3px solid #0d6efd; background: rgba(13,110,253,0.08); }
.conversation-item:has(.status-escalated):hover { background: rgba(13,110,253,0.15); }

.conversation-item:has(.status-hostile)     { border-left: 3px solid #ff9500; background: rgba(255,149,0,0.08); }
.conversation-item:has(.status-hostile):hover   { background: rgba(255,149,0,0.15); }

.conversation-item:has(.status-appointment) { border-left: 3px solid #198754; background: rgba(25,135,84,0.08); }
.conversation-item:has(.status-appointment):hover { background: rgba(25,135,84,0.15); }

.conversation-item:has(.status-no_response) { border-left: 3px solid #ffc107; background: rgba(255,193,7,0.06); }
.conversation-item:has(.status-no_response):hover { background: rgba(255,193,7,0.12); }

.conversation-item:has(.status-assigned)    { border-left: 3px solid #7c3aed; background: rgba(124,58,237,0.08); }
.conversation-item:has(.status-assigned):hover  { background: rgba(124,58,237,0.15); }
.status-assigned { background: #7c3aed; }
.unread-badge {
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--accent);
    color: #041b14;
    font-size: 0.68rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}
.chat-messages {
    flex: 1;
    overflow: auto;
    padding: 14px;
    background: linear-gradient(rgba(11,20,26,0.86), rgba(11,20,26,0.92));
}
.message-row { display: flex; margin-bottom: 8px; }
.message-row.own { justify-content: flex-end; }
.message-bubble {
    max-width: min(72%, 520px);
    border-radius: 10px;
    padding: 8px 10px 6px;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.message-bubble.sent {
    background: linear-gradient(180deg, #005c4b, #0a7b63);
    border-bottom-right-radius: 4px;
}
.message-bubble.received {
    background: #202c33;
    border-bottom-left-radius: 4px;
}
.message-meta {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    font-size: 0.68rem;
    margin-top: 4px;
    color: rgba(233, 237, 239, 0.6);
}
.chat-input {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}
.bot-banner {
    display: none;
    padding: 8px 12px;
    background: rgba(0,168,132,0.16);
    color: #7ce5c6;
    font-size: 0.78rem;
    border-bottom: 1px solid rgba(0,168,132,0.26);
}
.bot-banner.show { display: block; }
/* ── Sofia debug/copilot panel ────────────────────────────── */
.sofia-debug-panel {
    background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(59,130,246,0.06));
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 10px;
    margin: 0 12px 6px;
    overflow: hidden;
    font-size: 0.75rem;
    animation: sofiaFadeIn 0.3s ease;
}
@keyframes sofiaFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.sofia-debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(139,92,246,0.1);
    font-weight: 600;
    font-size: 0.72rem;
    color: #c4b5fd;
}
.sofia-debug-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sofia-debug-status.processing { background: rgba(251,191,36,0.2); color: #fbbf24; }
.sofia-debug-status.ready { background: rgba(34,197,94,0.2); color: #22c55e; }
.sofia-debug-status.sent { background: rgba(59,130,246,0.2); color: #3b82f6; }
.sofia-debug-status.idle { background: rgba(148,163,184,0.15); color: #94a3b8; }
.sofia-debug-body {
    padding: 8px 12px;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.5;
}
.sofia-debug-body .dbg-row {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sofia-debug-body .dbg-label {
    color: #94a3b8;
    min-width: 90px;
    flex-shrink: 0;
    font-size: 0.68rem;
}
.sofia-debug-body .dbg-value {
    color: #e2e8f0;
    word-break: break-word;
}
.sofia-debug-body .dbg-value.preview {
    color: #a5f3fc;
    font-style: italic;
    max-height: 60px;
    overflow-y: auto;
}

/* ── Chat sidebar appointments ───────────────────────────── */
.sidebar-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-appt-card {
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 6px;
}
.sidebar-appt-card.past { opacity: 0.5; }
.sidebar-appt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Chat media messages ─────────────────────────────────── */
.msg-media-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    display: block;
}
.msg-media-video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    display: block;
}
.msg-audio-wrap audio {
    width: 100%;
    min-width: 220px;
    max-width: 320px;
    height: 36px;
}
.msg-transcript {
    font-size: 0.78rem;
    color: var(--muted);
    font-style: italic;
    padding: 4px 8px;
    margin-top: 2px;
    border-left: 2px solid rgba(0,168,132,0.4);
    line-height: 1.4;
}
.msg-transcript i { font-size: 0.65rem; color: rgba(0,168,132,0.6); }
.msg-sticker {
    max-width: 150px;
    max-height: 150px;
}
.msg-doc-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    text-decoration: none !important;
    color: var(--text) !important;
    margin-bottom: 4px;
    transition: background 0.15s;
}
.msg-doc-card:hover { background: rgba(255,255,255,0.08); }
.msg-doc-icon { font-size: 1.4rem; color: var(--accent); flex-shrink: 0; }
.msg-doc-info { flex: 1; min-width: 0; }
.msg-doc-name { font-size: 0.8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-doc-ext { font-size: 0.68rem; color: var(--muted); }
.msg-doc-dl { font-size: 0.8rem; color: var(--muted); flex-shrink: 0; }
.msg-doc-dl:hover { color: var(--accent); }

/* ── Chat textarea auto-grow ─────────────────────────────── */
#messageInput {
    resize: none;
    overflow-y: auto;
    min-height: 38px;
    max-height: 150px;
    line-height: 1.4;
    transition: height 0.1s ease;
}

/* ── Context menu ────────────────────────────────────────── */
.chat-context-menu {
    position: fixed;
    z-index: 9999;
    background: #1a2530;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 6px 0;
    min-width: 200px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    display: none;
}
.chat-context-menu.show { display: block; }
.ctx-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    color: #d1d9de;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.1s;
    text-align: left;
}
.ctx-item:hover { background: rgba(255,255,255,0.06); }
.ctx-item i { width: 20px; text-align: center; color: var(--muted); font-size: 0.75rem; }
.ctx-danger { color: #ef4444 !important; }
.ctx-danger i { color: #ef4444 !important; }
.ctx-danger:hover { background: rgba(239,68,68,0.1); }
.ctx-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 0; }

/* ── Sofia config layout ─────────────────────────────────── */
.sofia-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 14px;
    height: calc(100vh - 100px);
}
.sofia-editor-panel { overflow-y: auto; padding: 20px !important; }

/* Config section */
.sofia-config-section {
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.sofia-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.sofia-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.sofia-status-active {
    background: rgba(0, 168, 132, 0.12);
    color: #00e6a0;
    border: 1px solid rgba(0, 168, 132, 0.25);
}
.sofia-status-inactive {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.sofia-status-info {
    background: rgba(255, 255, 255, 0.06);
    color: #c5d0d6;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.active {
    background: #00e6a0;
    box-shadow: 0 0 6px rgba(0, 230, 160, 0.5);
    animation: pulse 2s infinite;
}
.status-dot.inactive {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}
.sofia-assistant-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px !important;
    background: linear-gradient(180deg, rgba(17,27,33,0.95) 0%, rgba(11,20,26,0.98) 100%) !important;
    border: 1px solid rgba(0, 168, 132, 0.15) !important;
}

/* Assistant header */
.assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 168, 132, 0.12);
    margin-bottom: 4px;
}
.assistant-header h3 { margin: 0; }
.assistant-header .assistant-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(0,168,132,0.15), rgba(0,168,132,0.05));
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    color: #7ce5c6;
    border: 1px solid rgba(0,168,132,0.2);
}
.assistant-badge .pulse-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #00a884;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,168,132,0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(0,168,132,0); }
}

/* Messages */
.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}
.assistant-msg { display: flex; align-items: flex-end; gap: 6px; }
.assistant-msg-user { justify-content: flex-end; }
.assistant-msg-bot { justify-content: flex-start; }

.assistant-msg-bot::before {
    content: '✨';
    font-size: 0.65rem;
    flex-shrink: 0;
    margin-bottom: 4px;
}
.assistant-msg-user::after {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #005c4b, #00a884);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.assistant-msg-content {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.8rem;
    line-height: 1.55;
    word-break: break-word;
}
.assistant-msg-user .assistant-msg-content {
    background: linear-gradient(135deg, #005c4b, #004a3d);
    color: #e9edef;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.assistant-msg-bot .assistant-msg-content {
    background: rgba(255,255,255,0.04);
    color: #e1e1e3;
    border: 1px solid rgba(255,255,255,0.06);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.assistant-code {
    background: #060d12;
    color: #7ce5c6;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.74rem;
    margin: 8px 0;
    overflow-x: auto;
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid rgba(0,168,132,0.12);
}
.assistant-msg-content code {
    background: rgba(0,168,132,0.1);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.74rem;
    color: #7ce5c6;
}

/* Input row */
.assistant-input-row {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 168, 132, 0.1);
    margin-top: auto;
}
.assistant-input-row .form-control {
    background: rgba(0,0,0,0.25) !important;
    border-color: rgba(0,168,132,0.15) !important;
    border-radius: 999px !important;
    padding-left: 16px;
    font-size: 0.82rem;
}
.assistant-input-row .form-control:focus {
    border-color: rgba(0,168,132,0.4) !important;
    box-shadow: 0 0 0 2px rgba(0,168,132,0.1);
}
.assistant-input-row .btn {
    border-radius: 50% !important;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Typing indicator */
.typing-indicator .assistant-msg-content {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 12px 18px;
}
.typing-indicator .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #00a884;
    animation: typingBounce 1.2s infinite;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Welcome message */
.assistant-welcome {
    text-align: center;
    padding: 16px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.6;
}
.assistant-welcome .welcome-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}
.assistant-welcome .tip {
    display: inline-block;
    background: rgba(0,168,132,0.08);
    border: 1px solid rgba(0,168,132,0.15);
    border-radius: 8px;
    padding: 6px 12px;
    margin: 3px 2px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
    color: #d1d9de;
}
.assistant-welcome .tip:hover {
    background: rgba(0,168,132,0.15);
    color: #e1e1e3;
    border-color: rgba(0,168,132,0.3);
}

/* ── Settings ────────────────────────────────────────────── */
.settings-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 18px;
}
.settings-layout .glass-panel { padding: 22px !important; }
.settings-left { display: flex; flex-direction: column; gap: 18px; }
.settings-right { min-width: 0; }

/* WhatsApp status */
.wa-status-card { padding: 8px 0; }
.wa-status-row { display: flex; align-items: center; gap: 14px; }
.wa-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.wa-dot.connected { background: #00e6a0; box-shadow: 0 0 8px rgba(0,230,160,0.5); }
.wa-dot.pending { background: #f0ad4e; box-shadow: 0 0 8px rgba(240,173,78,0.4); }
.wa-dot.error { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.4); }

/* System info grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}
.info-label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.info-value { font-size: 0.85rem; color: #fff; font-weight: 500; }

/* User cards */
.users-list { display: flex; flex-direction: column; gap: 10px; }
.user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    transition: background 0.15s;
}
.user-card:hover { background: rgba(255,255,255,0.06); }
.user-card-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,168,132,0.2), rgba(0,168,132,0.05));
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-size: 1rem;
    flex-shrink: 0;
    border: 1px solid rgba(0,168,132,0.2);
}
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-size: 0.85rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-email { font-size: 0.72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.user-card-date { font-size: 0.68rem; color: var(--muted); }
.user-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.badge-role { font-size: 0.68rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.badge-admin { background: rgba(240,173,78,0.15); color: #f0c674; border: 1px solid rgba(240,173,78,0.3); }
.badge-operator { background: rgba(96,165,250,0.12); color: #93bbfd; border: 1px solid rgba(96,165,250,0.25); }

/* ── Calendar ────────────────────────────────────────────── */
.calendar-grid { user-select: none; }
/* Appointments page layout */
.appointments-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 14px;
    height: calc(100vh - 100px);
}
.appointments-layout > .glass-panel {
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.calendar-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.cal-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 2px; }
.cal-day-label { text-align: center; font-size: 0.68rem; font-weight: 600; color: var(--muted); padding: 2px 0; text-transform: uppercase; }
.cal-body { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; flex: 1; }
.cal-cell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    padding: 3px 4px;
    overflow: hidden;
}
.cal-cell:hover { background: rgba(255,255,255,0.06); }
.cal-cell.cal-empty { cursor: default; }
.cal-cell.cal-empty:hover { background: transparent; }
.cal-num { font-size: 0.72rem; font-weight: 500; margin-bottom: 2px; text-align: right; line-height: 1; }

/* Appointment chips inside calendar cells */
.cal-chips { display: flex; flex-direction: column; gap: 1px; overflow: hidden; flex: 1; }
.cal-chip {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 1px 3px;
    border-radius: 3px;
    background: rgba(0, 168, 132, 0.1);
    font-size: 0.55rem;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}
.cal-chip:hover { background: rgba(0, 168, 132, 0.2); }
.cal-chip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cal-chip-time {
    font-weight: 700;
    color: #00e6a0;
    flex-shrink: 0;
}
.cal-chip-name {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-chip-more {
    background: rgba(255,255,255,0.05);
    color: var(--muted);
    font-weight: 600;
    justify-content: center;
    font-size: 0.56rem;
}

.cal-today .cal-num { color: #00a884; font-weight: 700; }
.cal-today { background: rgba(0, 168, 132, 0.08); }
.cal-selected { background: rgba(0, 168, 132, 0.15) !important; border: 1px solid rgba(0, 168, 132, 0.35); }

/* ── Appointment cards ───────────────────────────────────── */
.appointment-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    margin-bottom: 10px;
    border-left: 3px solid var(--accent);
    border: 1px solid rgba(255,255,255,0.06);
    border-left: 3px solid var(--accent);
    transition: background 0.15s;
}
.appointment-card:hover { background: rgba(255,255,255,0.05); }
.appt-card-left { display: flex; gap: 14px; flex: 1; min-width: 0; }
.appt-time-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 50px;
}
.appointment-time-badge {
    font-size: 0.9rem;
    font-weight: 700;
    color: #00e6a0;
}
.appt-info-col { flex: 1; min-width: 0; }
.appt-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 2px;
}
.appt-details i { color: var(--accent); opacity: 0.7; }
.appt-notes {
    margin-top: 6px;
    font-size: 0.74rem;
    color: var(--muted);
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.04);
}
.appt-notes i { color: #f0c674; }
.appt-case-type {
    margin-top: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #a78bfa;
}
.appt-case-type i { color: #a78bfa; }
.appt-case-summary {
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--muted);
    font-style: italic;
    line-height: 1.4;
    max-height: 60px;
    overflow-y: auto;
}
.appt-case-summary i { color: #67e8f9; }
.btn-xs { padding: 2px 6px; font-size: 0.7rem; }

/* ── Campaign cards ──────────────────────────────────────── */
.campaign-list { display: flex; flex-direction: column; gap: 8px; }
.campaign-card {
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.campaign-card:hover { background: rgba(255,255,255,0.06); }
.campaign-card.active { background: rgba(0, 168, 132, 0.1); border-color: rgba(0, 168, 132, 0.3); }

/* ── Nav tabs dark ───────────────────────────────────────── */
.nav-tabs { border-color: rgba(255,255,255,0.1); }
.nav-tabs .nav-link { color: var(--muted); border: none; font-size: 0.82rem; }
.nav-tabs .nav-link.active { color: #e9edef; background: transparent; border-bottom: 2px solid #00a884; }
.nav-tabs .nav-link:hover { color: #e9edef; border-color: transparent; }

/* ── Appointment rows ────────────────────────────────────── */
.appointments-list { display: flex; flex-direction: column; gap: 6px; }
.appointment-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
}
.appointment-time {
    font-size: 0.85rem;
    font-weight: 700;
    color: #00a884;
    white-space: nowrap;
    min-width: 45px;
}
.appointment-info { display: flex; flex-direction: column; gap: 1px; }
.appointment-info strong { font-size: 0.82rem; }
.appointment-info span { font-size: 0.72rem; }

/* ── Dashboard tables ────────────────────────────────────── */
.table-dark { --bs-table-bg: transparent; --bs-table-color: #e1e1e3; --bs-table-border-color: rgba(255,255,255,0.06); }
.table-dark thead th { font-size: 0.72rem; text-transform: uppercase; color: #d1d9de; font-weight: 600; border-bottom-width: 1px; }
.table-dark td { font-size: 0.82rem; vertical-align: middle; }
.table-responsive { max-height: 300px; overflow-y: auto; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 20px 10px; }

/* ── Assignment badges ───────────────────────────────────── */
.conversation-assigned-badge {
    font-size: 0.68rem;
    color: #7ce5c6;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conv-readonly { opacity: 0.5; }
.conv-readonly:hover { opacity: 0.7; }
.assigned-badge-head {
    font-size: 0.75rem;
    color: #7ce5c6;
    background: rgba(0, 168, 132, 0.1);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.assigned-badge-head:empty { display: none; }

/* ── Dark selects & form controls (modals, panels) ─────── */
/* consolidated into global .form-control, .form-select rules */

/* ── Copilot bar ─────────────────────────────────────────── */
.copilot-bar, .copilot-suggestion {
    padding: 10px 14px;
    background: rgba(0, 168, 132, 0.08);
    border-top: 1px solid rgba(0, 168, 132, 0.25);
    flex-shrink: 0;
}
.copilot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.copilot-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #00a884;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.copilot-timer {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 36px;
    text-align: center;
}
.copilot-timer.urgent { color: #ef4444; background: rgba(239, 68, 68, 0.12); }
.copilot-text {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.88rem;
    line-height: 1.4;
    margin-bottom: 8px;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #e1e1e3;
    border: 1px solid transparent;
    transition: border 150ms;
}
.copilot-text[contenteditable="true"] {
    border-color: #00a884;
    outline: none;
    cursor: text;
}
.copilot-text[contenteditable="true"]:focus {
    border-color: #00d49b;
    box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.2);
}
.copilot-actions {
    display: flex;
    gap: 6px;
}
.copilot-suggestion-text {
    font-size: 0.85rem;
    color: #b0b8be;
    padding: 6px 0;
    line-height: 1.4;
    white-space: pre-wrap;
}
.copilot-suggestion { background: rgba(83, 162, 255, 0.06); border-top-color: rgba(83, 162, 255, 0.2); }
.copilot-suggestion .copilot-label { color: #53a2ff; }
.btn-xs { padding: 2px 6px; font-size: 0.7rem; }

.contact-sidebar { padding: 14px; }
.contact-card { text-align: center; }
.contact-card .contact-avatar { margin: 0 auto 10px; width: 52px; height: 52px; }
.contact-empty, .empty-chat, .empty-state {
    min-height: 120px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}
.filter-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 10px 0;
    flex-wrap: wrap;
}
.filter-tabs button, .day-pill span {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--muted);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
}
.filter-tabs button.active {
    background: var(--accent-soft);
    color: #88f0ce;
    border-color: rgba(0,168,132,0.3);
}
.content-grid.two-col { grid-template-columns: 1.6fr 1fr; }
.table-dark { --bs-table-bg: transparent; --bs-table-border-color: rgba(255,255,255,0.06); }
.table > :not(caption) > * > * { padding: 0.5rem 0.5rem; color: var(--text); font-size: 0.82rem; }
.modal-content {
    background-color: #1a2530 !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: var(--text) !important;
}
.form-control, .form-select, .input-group-text {
    background-color: #0d1920 !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: #e9edef !important;
    font-size: 0.85rem;
}
.form-select option {
    background-color: #0d1920;
    color: #e9edef;
}
.form-label { font-size: 0.78rem; color: #eef1f3 !important; margin-bottom: 3px; }
.form-control::placeholder { color: #7d8d97; }
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0,168,132,0.15);
    border-color: rgba(0,168,132,0.4) !important;
}
.btn { font-size: 0.82rem; padding: 6px 14px; }
.btn-lg { font-size: 0.9rem; padding: 8px 18px; }
.btn-success {
    background: linear-gradient(135deg, #00a884, #17c296);
    border-color: transparent;
    color: #061711;
    font-weight: 700;
}
.btn-outline-light, .btn-ghost {
    color: var(--text);
    border-color: rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.03);
}
.progress {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
}
.code-area { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.78rem; }
.day-pill { position: relative; overflow: hidden; }
.day-pill input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.day-pill input:checked + span {
    background: var(--accent-soft);
    color: #8ceacf;
    border-color: rgba(0,168,132,0.32);
}
.status-card, .qr-card { padding: 12px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); }
.status-label { font-size: 1rem; font-weight: 700; }
.toast-stack {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1080;
    display: grid;
    gap: 6px;
}

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: #0b141a; }
.login-shell {
    width: min(900px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 360px;
    gap: 16px;
    align-items: stretch;
}
.login-hero, .login-panel { padding: 24px; border-radius: 14px; }
.login-hero {
    background:
        radial-gradient(circle at top left, rgba(0,168,132,0.18), transparent 16rem),
        linear-gradient(180deg, rgba(17, 27, 33, 0.92), rgba(10, 16, 21, 0.96));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.login-brand { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.login-brand h1 { font-size: 1.6rem; margin: 0 0 8px; line-height: 1.1; font-weight: 700; }
.login-brand p { color: var(--muted); font-size: 0.85rem; }
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hero-metric { padding: 12px; }
.hero-metric span { color: var(--muted); display: block; margin-bottom: 4px; font-size: 0.75rem; }
.hero-metric strong { font-size: 0.9rem; }
.login-panel { display: flex; flex-direction: column; justify-content: center; }
.login-panel-head h2 { font-weight: 700; margin-bottom: 6px; font-size: 1.1rem; }

.alert { font-size: 0.82rem; padding: 8px 12px; border-radius: 8px; }

/* Responsive */
@media (max-width: 1180px) {
    .app-shell, .chat-layout, .dashboard-grid, .content-grid.two-col, .login-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .sidebar .nav-link { margin-bottom: 0; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .stats-grid, .hero-grid, .action-grid { grid-template-columns: 1fr; }
    .chat-layout { min-height: auto; }
    .chat-sidebar, .contact-sidebar { min-height: 260px; }
}

/* Fix overflow / scroll */
html, body { height: 100%; margin: 0; overflow: hidden; }
.app-shell { height: 100vh; overflow: hidden; }
.app-main { overflow-y: auto; height: 100vh; }
.chat-page .app-main {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}
.chat-page .topbar { flex-shrink: 0; }
.chat-page .chat-layout {
    flex: 1;
    height: 0;
    min-height: 0;
    max-height: none;
}
.chat-page .chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}
.chat-page .chat-input {
    flex-shrink: 0;
}
.sidebar { overflow-y: auto; overflow-x: hidden; }
.sidebar-foot .tiny-url { font-size: 0.65rem; overflow: hidden; text-overflow: ellipsis; }
.dashboard-grid { margin-bottom: 14px; }
.activity-feed { max-height: 300px; overflow-y: auto; }

/* Fix chart resize loop */
.chart-panel { position: relative; }
.chart-panel canvas { min-height: 0 !important; max-height: 200px; }

/* ── Campaigns ─────────────────────────────────────────── */
.campaigns-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 10px;
    height: calc(100vh - 70px);
    padding: 10px;
}
.campaigns-sidebar { overflow-y: auto; padding: 12px !important; }
.campaigns-main { overflow: hidden; padding: 14px !important; display: flex; flex-direction: column; }

/* Campaign list items */
.campaign-item {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
    margin-bottom: 4px;
}
.campaign-item:hover { background: rgba(255,255,255,0.04); }
.campaign-item.active { background: rgba(0,200,150,0.08); border-color: rgba(0,200,150,0.25); }
.campaign-item-name { font-weight: 600; font-size: 0.82rem; color: #e9edef; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.campaign-item-meta { font-size: 0.68rem; color: var(--muted); margin-top: 1px; }
.campaign-item-bar { height: 3px; border-radius: 2px; background: #1a2530; margin-top: 4px; overflow: hidden; }
.campaign-item-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.campaign-status-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.badge-draft { background: rgba(255,255,255,0.08); color: var(--muted); }
.badge-running { background: rgba(0,200,100,0.15); color: #4cff9f; }
.badge-paused { background: rgba(255,200,0,0.15); color: #ffd54f; }
.badge-completed { background: rgba(100,100,255,0.15); color: #90caf9; }

/* Stats cards */
.campaign-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
}
.campaigns-main .stat-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 6px 8px;
    text-align: center;
}
.stat-card-value { font-size: 1.1rem; font-weight: 700; color: #e9edef; line-height: 1.2; }
.stat-card-label { font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; line-height: 1.3; }
.stat-card.high .stat-card-value { color: #ff6b6b; }
.stat-card.medium .stat-card-value { color: #ffd54f; }
.stat-card.low .stat-card-value { color: #64b5f6; }
.stat-card.excluded .stat-card-value { color: #666; }
.stat-card.contacted .stat-card-value { color: #4caf50; }
.stat-card.converted .stat-card-value { color: #00e676; }

/* Funnel */
.campaign-funnel {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
}
.funnel-step {
    flex: 1;
    text-align: center;
    padding: 4px 3px;
    border-radius: 4px;
    font-size: 0.65rem;
}
.funnel-step-value { font-weight: 700; font-size: 0.9rem; line-height: 1.2; }
.funnel-step-label { color: var(--muted); font-size: 0.6rem; }
.funnel-arrow { color: rgba(255,255,255,0.12); font-size: 0.9rem; flex-shrink: 0; }

/* Filter bar */
#priorityFilter .btn, #statusFilter .btn {
    margin: 2px 3px !important;
    font-size: 0.68rem !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
}
#targetSearch { font-size: 0.78rem; height: 28px; }

/* Targets table */
#targetsTable { font-size: 0.75rem; margin-bottom: 0; }
#targetsTable thead th {
    background: #141e28;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.68rem;
    padding: 5px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
#targetsTable td {
    vertical-align: middle;
    border-color: rgba(255,255,255,0.03);
    padding: 4px 6px;
    line-height: 1.3;
}
#targetsTable tr:hover { background: rgba(255,255,255,0.02); }
#targetsTable .btn-sm {
    padding: 1px 5px !important;
    font-size: 0.65rem !important;
    line-height: 1.4;
}
.targets-table-wrap { flex: 1; overflow-y: auto; min-height: 0; }
#campaignDetail { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.priority-badge {
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}
.priority-high { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.priority-medium { background: rgba(255,213,79,0.15); color: #ffd54f; }
.priority-low { background: rgba(100,181,246,0.15); color: #64b5f6; }
.priority-excluded { background: rgba(255,255,255,0.05); color: #666; }
.status-badge-sm {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}
.status-pending { background: rgba(255,255,255,0.06); color: var(--muted); }
.status-contacted { background: rgba(76,175,80,0.15); color: #4caf50; }
.status-responded { background: rgba(33,150,243,0.15); color: #2196f3; }
.status-converted { background: rgba(0,230,118,0.2); color: #00e676; }
.status-no_response { background: rgba(255,152,0,0.15); color: #ff9800; }
.status-not_interested { background: rgba(244,67,54,0.1); color: #ef5350; }
.status-wrong_person { background: rgba(156,39,176,0.1); color: #ab47bc; }
.status-angry { background: rgba(244,67,54,0.2); color: #f44336; }
.status-excluded { background: rgba(255,255,255,0.04); color: #555; }
.status-qualified { background: rgba(0,200,150,0.15); color: #4cff9f; }

/* Bulk actions bar */
#bulkActions { padding: 4px 0; }
#bulkActions .btn { font-size: 0.7rem; padding: 3px 10px; }

/* Campaign header */
#campaignDetail .panel-title { font-size: 0.95rem; }
#campaignDetail > .d-flex:first-child { margin-bottom: 8px !important; }
#detailStatus { font-size: 0.72rem; height: 28px; padding: 2px 6px; }
#btnStartCampaign { font-size: 0.72rem; padding: 3px 10px; white-space: nowrap; }

/* New campaign form */
#campaignNew .form-label { font-size: 0.78rem; margin-bottom: 3px; }
#campaignNew .form-control, #campaignNew .form-select { font-size: 0.8rem; }
#campaignNew textarea { font-size: 0.78rem; }

/* Target detail modal */
.target-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.target-detail-item { padding: 4px 0; }
.target-detail-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 1px; }
.target-detail-value { font-size: 0.82rem; color: #e9edef; }

/* Empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; }

/* Checkbox alignment */
#targetsTable input[type="checkbox"] { width: 14px; height: 14px; accent-color: #00c896; }

@media (max-width: 768px) {
    .campaigns-layout { grid-template-columns: 1fr; height: auto; }
    .campaign-stats { grid-template-columns: repeat(3, 1fr); }
}

/* ── Message delete button ─────────────────────────────────────────── */
.msg-delete-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0 2px;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    margin-left: 4px;
}
.message-bubble:hover .msg-delete-btn {
    opacity: 0.6;
}
.msg-delete-btn:hover {
    opacity: 1 !important;
    color: #e74c3c;
}
.message-bubble.deleted {
    opacity: 0.5;
    font-style: italic;
}
.message-bubble.deleted .message-text {
    color: var(--muted);
}
