:root {
    --app-bg: #f4f7fb;
    --sidebar-bg: #0f1d35;
    --brand-blue: #123a7a;
    --brand-green: #25d366;
    --brand-muted: #7b8ba7;
    --card-radius: 18px;
    --soft-shadow: 0 14px 40px rgba(15, 29, 53, 0.08);
}

body {
    background: linear-gradient(180deg, #eef3fb 0%, #f7f9fc 100%);
    color: #24324a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #142949 100%);
    color: #fff;
    position: sticky;
    top: 0;
}

.sidebar .brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand h1 {
    font-size: 1.25rem;
    margin: 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.78);
    border-radius: 12px;
    margin-bottom: 0.35rem;
    padding: 0.85rem 1rem;
    font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: rgba(37, 211, 102, 0.14);
}

.content-shell {
    min-height: 100vh;
}

.topbar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid #dbe5f1;
}

.card-soft,
.chat-card,
.metric-card {
    border: 0;
    border-radius: var(--card-radius);
    box-shadow: var(--soft-shadow);
}

.metric-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 58, 122, 0.12);
    color: var(--brand-blue);
}

.badge-soft {
    background: rgba(37, 211, 102, 0.12);
    color: #128c4b;
}

.page-title {
    font-size: 1.55rem;
    font-weight: 700;
}

.table thead th {
    color: var(--brand-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chat-shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1rem;
}

.conversation-list {
    max-height: 72vh;
    overflow-y: auto;
}

.conversation-item {
    border: 1px solid #e8eef7;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.conversation-item.active,
.conversation-item:hover {
    border-color: rgba(37, 211, 102, 0.3);
    transform: translateY(-1px);
}

.message-bubble {
    max-width: 78%;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    margin-bottom: 0.8rem;
}

.message-in {
    background: #fff;
    border: 1px solid #dde6f2;
}

.message-out {
    background: rgba(37, 211, 102, 0.16);
    margin-left: auto;
}

.chat-thread {
    background: linear-gradient(180deg, #f8fbff 0%, #eef6f2 100%);
    min-height: 62vh;
}

.status-pill {
    font-size: 0.76rem;
    border-radius: 999px;
}

.form-section {
    border: 1px solid #e3eaf3;
    border-radius: 18px;
    padding: 1.2rem;
    background: #fff;
}

@media (max-width: 991.98px) {
    .sidebar {
        min-height: auto;
        position: static;
    }

    .chat-shell {
        grid-template-columns: 1fr;
    }
}
