:root {
    --bg: #030507;
    --panel: #0a0d12;
    --panel-2: #121722;
    --bubble: #151b26;
    --bubble-user: #1e2430;
    --muted: #8f98a8;
    --text: #f4f7fb;
    --chip: #242424;
    --accent: #3ea6ff;
    --border: rgba(255,255,255,0.08);
    --shadow: 0 30px 70px rgba(0,0,0,0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: radial-gradient(circle at top, #0b1120 0%, #030507 45%, #020304 100%); color: var(--text); font-family: 'Hind Siliguri', system-ui, sans-serif; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button, input, textarea { font: inherit; }
.hidden { display: none !important; }
.chat-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.chat-shell { width: min(100%, 1180px); min-height: min(94vh, 900px); border: 1px solid var(--border); border-radius: 30px; background: linear-gradient(180deg, rgba(14,18,27,0.96), rgba(6,8,12,0.98)); box-shadow: var(--shadow); display: grid; grid-template-rows: auto auto 1fr auto auto auto auto; overflow: hidden; }
.chat-header, .admin-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 28px 18px; border-bottom: 1px solid var(--border); }
.chat-header h1, .admin-top h1 { margin: 10px 0 8px; font-size: clamp(24px, 3vw, 36px); line-height: 1.05; }
.chat-header p, .admin-top p, .mini-note { margin: 0; color: var(--muted); }
.brand-badge { display: inline-flex; padding: 7px 12px; border-radius: 999px; background: rgba(62,166,255,0.12); color: #9ad2ff; font-size: 14px; }
.admin-link { color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; background: rgba(255,255,255,0.04); display: inline-flex; align-items: center; }
.admin-link-btn { cursor: pointer; }
.phone-bar { padding: 18px 28px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); }
.phone-bar-copy strong { display: block; margin-bottom: 6px; }
.phone-bar-copy span { color: var(--muted); font-size: 14px; }
.phone-bar-form { display: flex; gap: 10px; align-items: center; }
.phone-bar-form input, .auth-form input, .lead-grid input, .lead-grid textarea { background: #0d131d; border: 1px solid var(--border); color: white; border-radius: 14px; padding: 12px 14px; outline: none; }
.phone-bar-form input { min-width: 250px; }
.chat-main { padding: 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 24px; }
.msg-row { display: flex; align-items: flex-end; gap: 14px; max-width: 82%; }
.msg-row.user { align-self: flex-end; flex-direction: row-reverse; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: 0 0 52px; }
.avatar-bot { background: linear-gradient(180deg, #7c8496, #4a5263); color: white; }
.avatar-user { background: #203049; color: white; }
.msg-bubble { background: var(--bubble); border-radius: 24px; border: 1px solid var(--border); padding: 16px 18px; line-height: 1.7; font-size: 20px; }
.msg-row.user .msg-bubble { background: var(--bubble-user); }
.suggestion-wrap { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 28px 18px; }
.suggestion-btn { border: 0; color: #e9edf4; background: #2b2927; border-radius: 999px; padding: 12px 22px; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.suggestion-btn:hover { transform: translateY(-1px); background: #353230; }
.chat-input-bar { margin: 0 28px; display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; background: #2c2928; border-radius: 999px; padding: 14px 18px; border: 1px solid rgba(255,255,255,0.05); }
.chat-input-bar input { border: 0; outline: none; background: transparent; color: white; font-size: 18px; min-width: 0; }
.chat-input-bar input::placeholder { color: #b4b4b4; }
.icon-btn, .send-btn { border: 0; background: transparent; color: white; cursor: pointer; }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; }
.send-btn { padding: 11px 18px; border-radius: 999px; background: var(--accent); color: #07111e; font-weight: 700; }
.mini-note { padding: 14px 28px 24px; font-size: 14px; }
.lead-form-wrap { padding: 0 28px 20px; }
.lead-card, .panel-box, .auth-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 22px; padding: 20px; }
.lead-card h3, .panel-box h3 { margin-top: 0; }
.lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lead-grid textarea { min-height: 110px; grid-column: 1 / -1; }
.form-submit-btn { justify-self: start; }
.admin-page { min-height: 100vh; padding: 24px; }
.admin-card { width: min(100%, 1280px); margin: 0 auto; background: linear-gradient(180deg, rgba(14,18,27,0.96), rgba(6,8,12,0.98)); border: 1px solid var(--border); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow-x: auto; padding: 0 20px 20px; }
.lead-table { width: 100%; border-collapse: collapse; }
.lead-table th, .lead-table td { padding: 16px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.lead-table th { color: #acb7c9; font-weight: 600; }
.status-chip { display: inline-flex; padding: 6px 12px; border-radius: 999px; background: rgba(62,166,255,0.14); color: #9ad2ff; }
.empty-state, .pagination-wrap { color: var(--muted); text-align: center; padding: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 0 20px 20px; }
.stat-box { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 20px; padding: 18px; }
.stat-box span { display: block; color: var(--muted); margin-bottom: 8px; }
.stat-box strong { font-size: 30px; }
.panel-grid, .detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; padding: 0 20px 20px; }
.panel-title-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.admin-conversation { display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow: auto; }
.conv-item { padding: 14px; border-radius: 18px; border: 1px solid var(--border); }
.conv-item.user { background: rgba(62,166,255,0.08); }
.conv-item.assistant { background: rgba(255,255,255,0.03); }
.conv-item.system { background: rgba(255,184,77,0.08); }
.conv-meta { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.lead-stack { display: flex; flex-direction: column; gap: 12px; }
.lead-detail-card { padding: 14px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,0.03); }
.auth-page { display: grid; place-items: center; }
.auth-card { width: min(100%, 520px); margin: 40px auto; }
.auth-form { display: grid; gap: 12px; margin-top: 18px; }
.error-box { background: rgba(255, 77, 77, 0.1); border: 1px solid rgba(255, 77, 77, 0.25); color: #ffb7b7; padding: 12px 14px; border-radius: 14px; }
.auth-btn { width: 100%; justify-content: center; }
.typing-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d7dde8; margin-right: 6px; animation: blink 1.2s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; margin-right: 0; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@media (max-width: 900px) { .phone-bar, .panel-grid, .detail-grid, .stat-grid { grid-template-columns: 1fr; display: grid; } .phone-bar { flex-direction: column; } .lead-grid { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .chat-page, .admin-page { padding: 10px; } .chat-shell { min-height: 100dvh; border-radius: 18px; } .chat-header, .admin-top, .chat-main, .phone-bar { padding-left: 16px; padding-right: 16px; } .chat-header, .admin-top { align-items: flex-start; flex-direction: column; } .msg-row { max-width: 100%; } .msg-bubble { font-size: 18px; } .suggestion-wrap { padding: 8px 16px 14px; overflow-x: auto; flex-wrap: nowrap; } .chat-input-bar { margin: 0 16px; grid-template-columns: 1fr auto auto; padding-left: 14px; } .plus-btn { display: none; } .send-btn { padding: 10px 14px; } .mini-note, .lead-form-wrap { padding-left: 16px; padding-right: 16px; } .phone-bar-form { flex-direction: column; align-items: stretch; } .phone-bar-form input { min-width: 0; width: 100%; } }

.flash-box { margin: 0 20px 20px; background: rgba(62,166,255,0.12); border: 1px solid rgba(62,166,255,0.22); color: #cfe8ff; padding: 14px 16px; border-radius: 16px; }
.form-panel-box { margin: 0 20px 20px; }
.prompt-form-wrap { display: grid; gap: 16px; }
.prompt-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.prompt-form-grid input, .prompt-form-grid select, .prompt-text-box textarea { width: 100%; background: #0d131d; border: 1px solid var(--border); color: white; border-radius: 14px; padding: 12px 14px; outline: none; }
.prompt-text-box textarea { min-height: 220px; }
.field-label { display: block; margin-bottom: 8px; color: #cdd8e8; font-size: 14px; }
.table-subtext { color: var(--muted); font-size: 13px; margin-top: 6px; max-width: 460px; }
.action-stack { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.link-btn-danger { background: transparent; color: #ffb7b7; border: 0; padding: 0; cursor: pointer; }
@media (max-width: 900px) { .prompt-form-grid { grid-template-columns: 1fr; } }
