/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
}

/* ── Root layout ──────────────────────────────────────────────────────────── */
.lsi-root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.lsi-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
    border-bottom: 1px solid #bfdbfe;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.lsi-logo { display: flex; align-items: center; gap: 12px; }

.lsi-logo-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff; letter-spacing: -0.5px;
}

.lsi-logo-text {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.3px;
}
.lsi-logo-sub  { font-size: 11px; color: #64748b; letter-spacing: 0.5px; text-transform: uppercase; }

.elig-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 20px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
}
.elig-yes { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.elig-no  { background: rgba(239,68,68,0.15);  color: #ef4444;  border: 1px solid rgba(239,68,68,0.3); }

/* ── Tab bar ──────────────────────────────────────────────────────────────── */
.tab-bar-wrap {
    max-width: 1200px; margin: 16px auto 0; width: 100%; padding: 0 24px;
}
.tab-bar {
    display: flex;
    gap: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px;
}
.tab {
    flex: 1; padding: 8px 0; border-radius: 7px; border: none;
    cursor: pointer; font-size: 12px; font-weight: 600; letter-spacing: 0.3px;
    background: transparent; color: #64748b; transition: all 0.2s;
    font-family: inherit;
}
.tab-active {
    background: linear-gradient(135deg, #2563eb, #0891b2);
    color: #fff;
}

/* ── Body ─────────────────────────────────────────────────────────────────── */
.lsi-body {
    flex: 1; display: flex; gap: 0;
    max-width: 1200px; margin: 0 auto; width: 100%;
    padding: 24px; box-sizing: border-box;
}

/* ── Chat column ──────────────────────────────────────────────────────────── */
.chat-col {
    flex: 1; display: flex; flex-direction: column;
    min-width: 0; padding-right: 24px;
}

.messages {
    flex: 1; overflow-y: auto;
    display: flex; flex-direction: column; gap: 16px;
    padding-bottom: 16px; min-height: 400px;
    max-height: calc(100vh - 280px);
}

.welcome {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; flex: 1; gap: 20px;
    padding: 60px 20px; text-align: center;
}
.welcome-icon { font-size: 40px; }
.welcome h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.5px;
}
.welcome p  { font-size: 14px; color: #64748b; max-width: 400px; line-height: 1.6; }

.start-btn {
    padding: 12px 28px; border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border: none; color: #fff; font-family: inherit;
    font-size: 14px; font-weight: 600; cursor: pointer; letter-spacing: -0.2px;
    transition: opacity 0.2s;
}
.start-btn:hover { opacity: 0.9; }

.bubble {
    max-width: 82%; padding: 12px 16px;
    font-size: 14px; line-height: 1.6;
    animation: fadeUp 0.3s ease forwards;
}
.bubble-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 18px 18px 4px 18px; color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.bubble-ai {
    align-self: flex-start;
    background: #f1f5f9;
    color: #1e293b;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Typing indicator */
.typing { display: flex; gap: 5px; align-items: center; padding: 14px 18px !important; }
.dot {
    width: 7px; height: 7px; border-radius: 50%; background: #3b82f6;
    animation: bounce 1.2s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

/* Input row */
.input-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    ;
    border-radius: 14px;
    padding: 8px 8px 8px 16px;
    align-items: flex-end;
}
.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    font-family: inherit;
    max-height: 120px;
    min-height: 24px;
}
.send-btn {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border: none; cursor: pointer; color: #fff;
    font-size: 16px; transition: all 0.2s; flex-shrink: 0;
}
.send-disabled { background: #1e2535 !important; cursor: default !important; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.side-col {
    width: 300px; display: flex; flex-direction: column;
    gap: 16px; flex-shrink: 0;
}

.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
}
.card-title {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* Score */
.score-ring { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; }
.score-num {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -2px;
    color: #1e293b;
}
.score-label { font-size: 12px; color: #64748b; margin-top: 4px; }
.score-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}
.score-fill { height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.score-hint { font-size: 12px; color: #475569; text-align: center; margin-top: 8px; }

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
}
.breakdown-label { color: #94a3b8; }
.breakdown-val   { color: #3b82f6; font-weight: 600; font-size: 13px; }

/* Fields */
.field-row { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid #1e2535; }
.field-key { font-size: 10px; color: #475569; text-transform: uppercase; letter-spacing: 0.5px; }
.field-val { font-size: 12px; color: #cbd5e1; }

/* ── Admin tab ────────────────────────────────────────────────────────────── */
.admin-col { flex: 1; }

.empty-state { text-align: center; padding: 48px; color: #475569; font-size: 14px; }
.empty-state div { font-size: 32px; margin-bottom: 12px; }

.admin-grid { display: flex; gap: 20px; }
.admin-grid > .card { flex: 1; }

.score-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #1e2535;
}
.score-summary-label { font-size: 13px; font-weight: 600; color: #94a3b8; display: block; margin-bottom: 8px; }
.score-summary-num   { font-size: 28px; font-weight: 700; color: #3b82f6; letter-spacing: -1px; flex-shrink: 0; }
.score-summary-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    padding: 3px 8px; border-radius: 6px;
    background: rgba(59,130,246,0.15); color: #60a5fa;
    font-size: 11px; font-weight: 600;
}

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.summary-cell { background: #f8fafc; border-radius: 8px; padding: 10px 12px; }

.text-block { margin-top: 12px; }
.text-block p { font-size: 13px; color: #94a3b8; line-height: 1.6; background: #0f1117; border-radius: 8px; padding: 10px 12px; margin-top: 4px; }

/* Flags */
.flags-col { width: 340px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }
.flags-note { font-size: 11px; color: #475569; margin-bottom: 14px; line-height: 1.5; }

.flag-item { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #1e2535; }
.flag-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.flag-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.flag-section { font-size: 12px; font-weight: 600; color: #cbd5e1; }
.flag-note    { font-size: 12px; color: #64748b; line-height: 1.5; }

.flag-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 6px;
    font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.flag-ok    { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.flag-warn  { background: rgba(245,158,11,0.15);  color: #f59e0b;  border: 1px solid rgba(245,158,11,0.3); }
.flag-error { background: rgba(239,68,68,0.15);   color: #ef4444;  border: 1px solid rgba(239,68,68,0.3); }

/* PDF card */
.pdf-card { background: rgba(59,130,246,0.08) !important; border: 1px solid rgba(59,130,246,0.2) !important; }
.pdf-title { font-size: 12px; color: #60a5fa; font-weight: 600; margin-bottom: 6px; }
.pdf-card p { font-size: 12px; color: #64748b; line-height: 1.5; margin-bottom: 12px; }
.pdf-btn {
    display: inline-block; padding: 8px 16px; border-radius: 8px;
    background: linear-gradient(135deg, #2563eb, #0891b2);
    color: #fff; font-size: 12px; font-weight: 600;
    text-decoration: none; transition: opacity 0.2s;
}
.pdf-btn:hover { opacity: 0.9; }

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(-6px); }
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3348; border-radius: 2px; }
