:root {
    --brand-blue: #1f5fbf;
    --brand-blue-strong: #164a96;
    --bg: #f6f8fc;
    --surface: #ffffff;
    --surface-muted: #f0f3fa;
    --text: #0f1c3f;
    --muted: #5b6680;
    --border: #d8deeb;
    --shadow: 0 10px 30px rgba(15, 28, 63, 0.08);
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--brand-blue);
    text-decoration: none;
}

a:hover {
    color: var(--brand-blue-strong);
}

.shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #0f1c3f;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.brand__mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    color: var(--brand-blue);
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.2);
}

.brand__text {
    display: flex;
    flex-direction: column;
}

.brand__name {
    font-weight: 700;
    font-size: 1rem;
    color: inherit;
}

.brand__tagline {
    font-size: 0.9rem;
    color: #dce4ff;
}

.brand--footer .brand__name {
    color: var(--text);
}

.brand--footer .brand__tagline {
    color: var(--muted);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.nav__link {
    color: inherit;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.nav__link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.page {
    padding-top: 2rem;
}

.section {
    padding: 3rem 0;
}

.section--with-header {
    padding-top: 4rem;
}

.section--alt {
    background: var(--surface);
}

.hero {
    padding: 4rem 0 3.5rem;
    background: linear-gradient(135deg, #eef4ff, #f8fbff 50%, #ffffff);
}

.hero__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-items: center;
}

.hero__copy h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 3vw + 1rem, 3.2rem);
    line-height: 1.2;
}

.lead {
    color: var(--muted);
    max-width: 640px;
    margin-bottom: 1.4rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--brand-blue);
    margin-bottom: 0.35rem;
}

.actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn--primary {
    background: linear-gradient(120deg, var(--brand-blue), #3a7be0);
    color: #fff;
    box-shadow: 0 10px 24px rgba(31, 95, 191, 0.2);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(31, 95, 191, 0.24);
}

.btn--ghost {
    background: #fff;
    color: var(--brand-blue);
    border-color: var(--border);
}

.btn--ghost:hover {
    border-color: var(--brand-blue);
}

.btn--secondary {
    background: var(--surface-muted);
    color: var(--text);
    border-color: var(--border);
}

.hero__bullets {
    margin: 0 0 0.5rem;
    padding-left: 1.2rem;
    color: var(--muted);
    display: grid;
    gap: 0.4rem;
}

.hero__card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(31, 95, 191, 0.08);
    color: var(--brand-blue);
    font-weight: 700;
    font-size: 0.85rem;
}

.pill--soft {
    background: var(--surface-muted);
    color: var(--text);
}

.metric {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 1rem 0;
}

.metric__value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--brand-blue);
}

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

.list {
    display: grid;
    gap: 0.8rem;
    margin: 1rem 0;
}

.list__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.list__item:last-child {
    border-bottom: none;
}

.list__title {
    font-weight: 700;
}

.list__meta {
    color: var(--muted);
    font-size: 0.95rem;
}

.cards {
    display: grid;
    gap: 1.2rem;
}

.cards--three {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.cards--list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.card--lined {
    box-shadow: none;
}

.section__header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
}

.section__header--split {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

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

.table {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table__row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr repeat(4, 0.7fr);
    gap: 0.4rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}

.table__row:last-child {
    border-bottom: none;
}

.table__row--head {
    background: var(--surface-muted);
    font-weight: 700;
    color: var(--text);
}

.table__cell {
    text-align: left;
    color: var(--text);
    border: none;
    background: transparent;
    font: inherit;
    cursor: default;
}

.table__cell button,
.table__row--head button {
    all: unset;
    cursor: pointer;
    color: var(--text);
    font-weight: 700;
}

.table__cell--right {
    text-align: right;
}

.table__note {
    margin-top: 0.8rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 0.35rem 0.6rem;
    border-radius: 10px;
    background: rgba(31, 95, 191, 0.12);
    color: var(--brand-blue);
    font-weight: 800;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--brand-blue);
    font-weight: 700;
}

.text-link:hover {
    color: var(--brand-blue-strong);
}

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

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

.news-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: var(--shadow);
}

.news-card__meta {
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.news-card__title {
    margin: 0 0 0.5rem;
}

.news-card__tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 0.6rem 0 0.4rem;
}

.tag {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    color: var(--text);
}

.load-more {
    margin-top: 1.2rem;
    text-align: center;
}

.filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filters label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
}

.filters select {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    min-width: 140px;
}

.chat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: grid;
    gap: 1rem;
}

.chat-layout {
    display: grid;
    grid-template-columns: 2fr minmax(260px, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.chat-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: grid;
    gap: 0.75rem;
    grid-template-rows: 1fr auto auto;
    min-height: 520px;
}

.chat-panel__messages {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-y: auto;
    display: grid;
    gap: 0.85rem;
    align-content: start;
}

.chat-panel__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.chat-panel__status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-weight: 600;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(31, 95, 191, 0.15);
    border-top-color: var(--brand-blue);
    border-radius: 999px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.chat__panel {
    min-height: 320px;
    max-height: 520px;
    overflow-y: auto;
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.bubble {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    max-width: 80%;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.bubble--user {
    justify-self: end;
    background: rgba(31, 95, 191, 0.1);
    border-color: rgba(31, 95, 191, 0.4);
}

.bubble--assistant {
    justify-self: start;
}

.bubble--muted {
    color: var(--muted);
    font-style: italic;
}

.chat__input {
    display: grid;
    gap: 0.75rem;
}

.chat__input textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    font: inherit;
    resize: vertical;
    background: #fff;
}

.chat__input textarea:focus {
    outline: 2px solid rgba(31, 95, 191, 0.25);
    border-color: var(--brand-blue);
}

.chat__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.chat__hint {
    font-size: 0.9rem;
}

.chat__helper {
    background: var(--surface-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.chat-helper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: grid;
    gap: 0.75rem;
    align-self: stretch;
}

.chat-helper ul {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.4rem;
}

.chat-helper h4 {
    margin: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: #e9f2ff;
    color: var(--brand-blue-strong);
    font-weight: 700;
}

.status__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
}

.chat-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.1rem;
    background: linear-gradient(135deg, var(--brand-blue), #3a7be0);
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 16px 30px rgba(31, 95, 191, 0.35);
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.chat-fab:hover,
.chat-fab:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 20px 36px rgba(31, 95, 191, 0.4);
    outline: none;
}

.chat-fab__icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    font-weight: 800;
}

.status.is-error {
    background: #fff1f0;
    color: #a11a1a;
}

.status.is-error .status__dot {
    background: #f97316;
}

.alert {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
}

.alert--error {
    background: #fff5f5;
    border: 1px solid #fcb3b3;
    color: #a11a1a;
}

.footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 2.5rem 0 2rem;
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.footer__links {
    display: grid;
    gap: 0.4rem;
    align-content: start;
}

.footer__meta {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-weight: 600;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .table__row {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        width: 100%;
    }

    .hero__grid {
        grid-template-columns: 1fr;
    }

    .table__row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .chat-panel {
        min-height: 420px;
    }

    .chat-fab {
        right: 1rem;
        bottom: 1rem;
        font-size: 0.95rem;
    }
}
