/* PumpFlow Simulator — Ultra-minimal monochrome UI */
:root {
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --bg: #FFFFFF;
    --bg-alt: #FAFAFA;
    --bg-sidebar: #FAFAFA;
    --text: #0a0a0a;
    --text-2: #525252;
    --text-3: #a1a1a1;
    --border: rgba(0,0,0,0.08);
    --accent: #0a0a0a;
    --green: #25D366;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app {
    display: flex;
    height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
    width: 300px;
    min-width: 300px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 24px 20px;
}

.sidebar-header { margin-bottom: 32px; }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-icon svg {
    width: 16px;
    height: 16px;
}

.brand-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.brand-badge {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-3);
    text-transform: uppercase;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.sidebar-select,
.sidebar-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.sidebar-select:focus,
.sidebar-input:focus {
    border-color: var(--text-3);
}

.state-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-2);
    text-transform: capitalize;
}

/* Lead Panel */
.lead-panel {
    background: var(--bg);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border);
}

.lead-info {
    font-size: 0.78rem;
    line-height: 1.6;
}

.lead-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.lead-row-label {
    color: var(--text-3);
    font-size: 0.72rem;
}

.lead-row-value {
    font-weight: 600;
    color: var(--text);
    text-align: right;
    font-size: 0.72rem;
}

.lead-score {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.lead-score-bar {
    flex: 1;
    height: 4px;
    background: rgba(0,0,0,0.06);
    border-radius: 2px;
    overflow: hidden;
}

.lead-score-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.lead-appointment {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--bg-alt);
    border-radius: 8px;
    font-size: 0.72rem;
    border: 1px solid var(--border);
    color: var(--text-2);
}

.lead-appointment strong {
    color: var(--text);
}

.sidebar-actions {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-2);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-sidebar:hover {
    border-color: var(--text-3);
    color: var(--text);
}

/* ─── Chat Area ─── */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

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

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
}

.chat-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.72rem;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.chat-header-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
}

.chat-header-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-3);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}

/* ─── Messages ─── */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-alt);
}

.welcome-card {
    margin: auto;
    text-align: center;
    padding: 48px 32px;
    max-width: 380px;
}

.welcome-icon {
    margin-bottom: 20px;
    color: var(--text-3);
}

.welcome-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.welcome-card p {
    color: var(--text-3);
    font-size: 0.85rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

.welcome-start {
    padding: 12px 32px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.welcome-start:hover {
    opacity: 0.85;
}

/* Message bubbles */
.msg {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.82rem;
    line-height: 1.55;
    animation: msgSlide 0.25s ease;
    position: relative;
}

@keyframes msgSlide {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-user {
    background: var(--accent);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg-bot {
    background: var(--bg);
    color: var(--text);
    align-self: flex-start;
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.msg-body { margin-bottom: 2px; }
.msg-body strong { font-weight: 600; }
.msg-user .msg-body strong { color: #fff; }
.msg-bot .msg-body strong { color: var(--text); }
.msg-body em { font-style: italic; color: var(--text-3); }
.msg-user .msg-body em { color: rgba(255,255,255,0.7); }
.msg-body .msg-bullet { display: block; padding-left: 14px; position: relative; margin: 3px 0; }
.msg-body .msg-bullet::before { content: '·'; position: absolute; left: 2px; font-weight: 700; }
.msg-body .msg-num { display: block; margin: 3px 0; }
.msg-body .msg-num .msg-num-n { font-weight: 700; }

.msg-time {
    font-size: 0.62rem;
    text-align: right;
    margin-top: 4px;
}

.msg-user .msg-time {
    color: rgba(255,255,255,0.5);
}

.msg-bot .msg-time {
    color: var(--text-3);
}

.msg-user .msg-time::after {
    content: ' ✓✓';
    opacity: 0.7;
}

/* Date separator */
.date-sep {
    text-align: center;
    margin: 16px 0;
}

.date-sep span {
    background: var(--bg);
    color: var(--text-3);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

/* Typing indicator */
.typing-indicator {
    align-self: flex-start;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 12px 18px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.typing-indicator .dots { display: flex; gap: 5px; }
.typing-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-3);
    animation: dotPulse 1.4s infinite ease-in-out;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
    40% { opacity: 1; transform: scale(1); }
}

/* Quick replies */
.quick-replies {
    padding: 8px 24px 4px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
}

.chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-2);
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chip:hover {
    border-color: var(--text-3);
    color: var(--text);
}

/* Input bar */
.input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.input-bar input {
    flex: 1;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-bar input:focus {
    border-color: var(--text-3);
}

.input-bar input::placeholder { color: var(--text-3); }

.input-bar button {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.input-bar button:hover { opacity: 0.8; }
.input-bar button:disabled { opacity: 0.25; cursor: not-allowed; }

/* Scrollbar */
.messages::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.messages::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.15);
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: left 0.3s ease;
        width: 85%;
        max-width: 300px;
        box-shadow: var(--shadow-md);
    }

    .sidebar.open { left: 0; }

    .hamburger { display: flex; }

    .msg { max-width: 85%; }

    .chat-header { padding: 14px 16px; }
    .messages { padding: 16px; }
    .quick-replies { padding: 8px 16px 4px; }
    .input-bar { padding: 12px 16px; }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.2);
        z-index: 99;
    }

    .sidebar-overlay.visible { display: block; }
}
