:root {
    --wa-green: #25d366;
    --wa-teal: #128c7e;
    --wa-dark: #075e54;
    --wa-light: #dcf8c6;
    --wa-bg: #ece5dd;
    --wa-chat: #e5ddd5;
    --white: #ffffff;
    --surface: #f8faf8;
    --surface2: #f0f4f0;
    --border: #e2ede2;
    --border2: #c8dcc8;
    --text: #111b11;
    --text-mid: #3d5a3e;
    --text-muted: #8a9e8a;
    --danger: #ff4b4b;
    --radius: 12px;
    --font: "Plus Jakarta Sans", sans-serif;
    --mono: "IBM Plex Mono", monospace;
    --shadow-sm: 0 1px 3px rgba(7, 94, 84, 0.08), 0 1px 2px rgba(7, 94, 84, 0.04);
    --shadow: 0 4px 16px rgba(7, 94, 84, 0.10), 0 1px 4px rgba(7, 94, 84, 0.06);
    --shadow-lg: 0 12px 40px rgba(7, 94, 84, 0.14);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--wa-bg);
    color: var(--text);
}

a { color: inherit; text-decoration: none; }

button, .button-link, .btn {
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.btn,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 16px;
}

.btn-primary,
.button-link,
button[type="submit"] {
    background: var(--wa-green);
    color: white;
}

.btn-primary:hover,
.button-link:hover,
button[type="submit"]:hover {
    background: #1eb85b;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border2);
    color: var(--text-mid);
}

.btn-outline:hover {
    border-color: var(--wa-green);
    color: var(--wa-green);
    background: #f0fbf4;
}

input, select, textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: white;
    font: inherit;
    color: var(--text);
    outline: none;
}

input, select {
    height: 42px;
    padding: 0 12px;
}

textarea {
    padding: 12px;
    resize: vertical;
}

input[type="checkbox"] {
    width: auto;
    height: auto;
}

label span {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--wa-dark);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 20;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 18px 18px;
    pointer-events: none;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--wa-green);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37,211,102,0.4);
    font-weight: 800;
    color: white;
}

.logo-text {
    font-size: 18px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.4px;
}

.logo-text span { color: var(--wa-green); }

.sidebar-section {
    padding: 8px 10px 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    font-family: var(--mono);
    position: relative;
}

.nav {
    padding-top: 4px;
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: 2px 8px;
    border-radius: 10px;
    color: rgba(255,255,255,0.6);
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
}

.nav-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: white;
}

.nav-link.active {
    background: rgba(37,211,102,0.18);
    color: var(--wa-green);
    font-weight: 600;
}

.nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--wa-green);
    border-radius: 0 2px 2px 0;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 14px 12px;
    position: relative;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--wa-green), var(--wa-teal));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

.app-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.topbar {
    height: 56px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.topbar-title {
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    color: var(--text);
}

.topbar-title span { color: var(--wa-teal); }

.api-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-family: var(--mono);
    color: var(--wa-teal);
    background: #e8f5ef;
    border: 1px solid #b8e0c8;
    padding: 5px 12px;
    border-radius: 20px;
}

.dot-live {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--wa-green);
    animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

.content {
    padding: 20px 24px;
    overflow: auto;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-head h2 {
    margin: 0.35rem 0 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    letter-spacing: -0.03em;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

.muted { color: var(--text-muted); }

.stats-grid,
.grid-two,
.form-grid {
    display: grid;
    gap: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 1rem;
}

.grid-two {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin-bottom: 1rem;
}

.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.panel,
.stat-card,
.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.panel {
    padding: 18px;
}

.panel-chat {
    padding: 0;
    overflow: hidden;
}

.panel-head {
    margin-bottom: 1rem;
}

.panel-head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.stat-card {
    padding: 1.2rem;
}

.stat-card span {
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.stat-card strong {
    font-size: 1.9rem;
}

.stack {
    display: grid;
    gap: 1rem;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.toggle-row span {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}

.inner-grid {
    margin: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.95rem 0.7rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #dcf8c6;
    color: #166534;
}

.flash {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.flash-success {
    background: #e8f5ef;
    color: var(--wa-teal);
    border: 1px solid #b8e0c8;
}

.flash-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.log-list {
    display: grid;
    gap: 0.8rem;
}

.log-item {
    display: grid;
    gap: 0.2rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--surface);
}

.chat-panel {
    display: flex;
    min-height: 74vh;
    overflow: hidden;
}

.conv-list {
    width: 320px;
    min-width: 320px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.conv-search {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 7px 12px;
}

.search-box input {
    border: none;
    background: transparent;
    height: auto;
    padding: 0;
}

.conv-filter {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.filter-chip {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-muted);
}

.filter-chip.active {
    background: var(--wa-green);
    border-color: var(--wa-green);
    color: white;
}

.conv-items {
    flex: 1;
    overflow-y: auto;
}

.conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
}

.conv-item:hover { background: var(--surface); }
.conv-item.active { background: #e8f5ef; }

.conv-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a8e6cf, #3d9970);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.conv-body {
    flex: 1;
    min-width: 0;
}

.conv-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.conv-preview {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.conv-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.conv-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

.conv-tag {
    font-size: 9.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.conv-tag.new { background: #dcf8c6; color: #166534; }
.conv-tag.cold { background: #ede9fe; color: #6d28d9; }

.leads-toolbar {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-select,
.search-input,
.form-input,
.form-select {
    height: 34px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 12.5px;
    background: white;
}

.search-input { width: 220px; }

.tag-filter,
.audience-pills {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.tag-btn,
.aud-pill {
    height: 30px;
    padding: 0 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    background: white;
    color: var(--text-muted);
}

.tag-btn.hot.active, .badge.hot { background: #fef3cd; border-color: #fcd34d; color: #b45309; }
.tag-btn.new.active, .badge.new { background: #dcf8c6; border-color: #86efac; color: #15803d; }
.tag-btn.cold.active, .badge.cold { background: #ede9fe; border-color: #c4b5fd; color: #6d28d9; }
.tag-btn.vip.active, .badge.vip { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.badge.follow { background: #e0f2fe; color: #0369a1; }

.leads-table-wrap { overflow: auto; padding: 16px 20px; }
.leads-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.leads-table tr:hover td { background: #f6fbf6; }

.lead-name-cell { display: flex; align-items: center; gap: 8px; }
.lead-av {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}
.lead-av.a { background: linear-gradient(135deg, #a8e6cf, #27ae60); }
.lead-av.b { background: linear-gradient(135deg, #ffd3b6, #e67e22); }
.lead-av.c { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.lead-av.d { background: linear-gradient(135deg, #fd79a8, #e84393); }
.lead-av.e { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.checkbox-cell input { accent-color: var(--wa-green); width: 14px; height: 14px; cursor: pointer; }

.followup-panel,
.broadcast-panel,
.api-panel {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
    gap: 16px;
    background: var(--surface);
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .icon {
    width: 28px;
    height: 28px;
    background: var(--wa-green);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.seq-card,
.bc-form-card,
.bc-preview-card,
.api-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.seq-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.seq-title { font-size: 14px; font-weight: 700; flex: 1; }
.seq-stats { display: flex; gap: 14px; }
.seq-stat { text-align: center; }
.seq-stat-val { font-size: 18px; font-weight: 800; color: var(--wa-teal); font-family: var(--mono); }
.seq-stat-lbl { font-size: 10px; color: var(--text-muted); }

.toggle-switch {
    width: 40px; height: 22px; border-radius: 11px; background: var(--wa-green); position: relative;
}
.toggle-switch::after {
    content: ""; position: absolute; top: 3px; left: 21px; width: 16px; height: 16px; border-radius: 50%; background: white;
}

.seq-steps { padding: 12px 16px; display: flex; flex-direction: column; }
.seq-step { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; position: relative; }
.seq-step::before { content: ""; position: absolute; left: 17px; top: 36px; bottom: -10px; width: 2px; background: var(--border); }
.seq-step:last-child::before { display: none; }
.step-num {
    width: 34px; height: 34px; border-radius: 50%; background: var(--surface2); border: 2px solid var(--border2);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--wa-teal); flex-shrink: 0; z-index: 1;
}
.step-num.done { background: var(--wa-green); border-color: var(--wa-green); color: white; }
.step-body { flex: 1; }
.step-delay { font-size: 11px; font-family: var(--mono); color: var(--text-muted); margin-bottom: 4px; }
.step-msg { background: var(--wa-light); border-radius: 4px 12px 12px 12px; padding: 8px 12px; font-size: 12.5px; line-height: 1.5; max-width: 480px; }
.step-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.step-tag { font-size: 10.5px; font-family: var(--mono); padding: 2px 7px; border-radius: 4px; background: var(--surface2); color: var(--text-muted); }

.bc-layout,
.api-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
    align-items: start;
}

.api-layout { grid-template-columns: 1fr 1fr; }

.bc-form-card,
.api-card { padding: 20px; }

.form-group { margin-bottom: 16px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.schedule-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

.preview-header {
    background: var(--wa-dark);
    color: white;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
}

.preview-phone {
    background: var(--wa-chat);
    padding: 16px;
    min-height: 200px;
}

.preview-bubble {
    background: var(--wa-light);
    border-radius: 4px 12px 12px 12px;
    padding: 10px 12px;
    max-width: 85%;
    font-size: 13px;
    line-height: 1.5;
}

.preview-meta {
    display: flex;
    gap: 4px;
    margin-top: 5px;
    justify-content: flex-end;
}

.preview-meta span,
.campaign-sub,
.status-val,
.webhook-url,
.api-input {
    font-family: var(--mono);
}

.bc-stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 12px; }
.bc-stat { text-align: center; padding: 8px; background: var(--surface2); border-radius: 8px; }
.bc-stat-val { font-size: 20px; font-weight: 800; color: var(--wa-teal); font-family: var(--mono); }
.bc-stat-lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.api-card-title {
    font-size: 14px; font-weight: 700; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

.api-card-title svg {
    width: 18px;
    height: 18px;
    color: var(--wa-teal);
}

.api-field { margin-bottom: 14px; }
.api-field label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
.api-input-wrap { position: relative; }
.api-input { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px; background: var(--surface2); font-size: 12.5px; }
.api-input[type="password"] {
    letter-spacing: 0.02em;
}
.status-card { background: var(--surface2); border: 1.5px solid var(--border); border-radius: 10px; padding: 14px; margin-top: 12px; }
.status-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.status-row:last-child { margin-bottom: 0; }
.status-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-indicator.ok { background: var(--wa-green); }
.status-indicator.warn { background: #f59e0b; }
.status-indicator.err { background: var(--danger); }
.status-label { font-size: 12.5px; flex: 1; }
.webhook-url { background: var(--surface2); border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 11.5px; word-break: break-all; color: var(--wa-teal); }
.test-btn { width: 100%; margin-top: 14px; padding: 10px; background: var(--wa-green); color: white; border-radius: 8px; font-size: 13.5px; font-weight: 600; }
.campaign-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.campaign-row:last-child { border-bottom: none; }
.campaign-title { font-size: 13.5px; font-weight: 700; }
.campaign-sub { font-size: 11px; color: var(--text-muted); }
.campaign-metrics { font-size: 12px; color: var(--wa-teal); font-family: var(--mono); }

.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--wa-chat);
    position: relative;
    overflow: hidden;
}

.chat-window::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23128C7E' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.chat-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1;
    box-shadow: var(--shadow-sm);
}

.chat-header-info { flex: 1; }
.chat-header-name { font-size: 14.5px; font-weight: 700; }
.chat-header-sub { font-size: 11.5px; color: var(--wa-teal); }

.template-pills {
    display: flex;
    gap: 6px;
    padding: 6px 14px;
    background: white;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    z-index: 1;
}

.tpill {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--surface2);
    color: var(--wa-teal);
    border: 1.5px solid var(--border2);
}

.tpill:hover {
    background: var(--wa-green);
    color: white;
    border-color: var(--wa-green);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.msg {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.msg.out { align-self: flex-end; }
.msg.in { align-self: flex-start; }

.msg-bubble {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.msg.in .msg-bubble {
    background: white;
    border-radius: 2px 10px 10px 10px;
}

.msg.out .msg-bubble {
    background: var(--wa-light);
    border-radius: 10px 2px 10px 10px;
}

.msg-meta {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 3px;
}

.msg-time {
    font-size: 10.5px;
    font-family: var(--mono);
    color: var(--text-muted);
}

.msg-tick {
    font-size: 11px;
    color: var(--wa-teal);
}

.auto-tag {
    font-size: 9.5px;
    font-weight: 600;
    font-family: var(--mono);
    color: var(--wa-teal);
    text-align: right;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-input-bar {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.chat-input {
    flex: 1;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13.5px;
    color: var(--text);
    resize: none;
    max-height: 100px;
}

.chat-input:focus { border-color: var(--wa-green); }

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wa-green);
    color: white;
    box-shadow: 0 2px 8px rgba(37,211,102,0.4);
    flex-shrink: 0;
}

.send-btn:hover { transform: scale(1.05); }

.attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    flex-shrink: 0;
}

.attach-btn:hover { color: var(--wa-teal); background: var(--surface2); }

.chat-empty {
    display: grid;
    place-items: center;
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.auth-card {
    width: min(520px, 100%);
    padding: 2rem;
}

@media (max-width: 900px) {
    .shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
    }

    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 14px;
    }

    .page-head {
        align-items: start;
        flex-direction: column;
    }

    .chat-panel {
        flex-direction: column;
    }

    .bc-layout,
    .api-layout {
        grid-template-columns: 1fr;
    }

    .conv-list {
        width: 100%;
        min-width: 100%;
        max-height: 280px;
    }
}
