body {
    background: #f5f8fa;
}

[data-bs-theme="dark"] body {
    background: #0f1218;
}

.btn.btn-primary {
    background-color: var(--ps-primary);
    border-color: var(--ps-primary);
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
    background-color: color-mix(in srgb, var(--ps-primary) 86%, #000);
    border-color: color-mix(in srgb, var(--ps-primary) 86%, #000);
}

.btn.btn-light-primary,
.badge-light-primary {
    color: var(--ps-primary);
}

.text-primary {
    color: var(--ps-primary) !important;
}

.bg-primary {
    background-color: var(--ps-primary) !important;
}

.ci-app-body {
    color: #252f4a;
    min-height: 100vh;
}

.ci-shell {
    display: flex;
    min-height: 100vh;
}

.ci-sidebar {
    background: #ffffff;
    border-right: 1px solid #eef0f4;
    flex: 0 0 286px;
    height: 100vh;
    overflow-y: auto;
    padding: 22px 18px;
    position: sticky;
    top: 0;
    width: 286px;
    z-index: 20;
}

.ci-sidebar-brand {
    margin-bottom: 22px;
}

.ci-brand-link {
    align-items: center;
    color: #071437;
    display: flex;
    gap: 12px;
    text-decoration: none;
}

.ci-brand-icon,
.auth-brand-icon {
    border-radius: 8px;
    height: 42px;
    object-fit: contain;
    width: 42px;
}

.auth-brand-logo {
    max-height: 42px;
    max-width: 180px;
    object-fit: contain;
}

.ci-brand-mark {
    align-items: center;
    background: var(--ps-primary);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 42px;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    letter-spacing: 0;
    text-transform: uppercase;
    width: 42px;
}

.ci-brand-text {
    display: grid;
    font-weight: 800;
    line-height: 1.1;
}

.ci-brand-text small {
    color: #99a1b7;
    font-size: 12px;
    font-weight: 700;
    margin-top: 4px;
    text-transform: uppercase;
}

.ci-client-card {
    align-items: center;
    background: #f8fafd;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    margin-bottom: 26px;
    padding: 14px;
}

.ci-client-icon {
    border-radius: 8px;
    height: 38px;
    object-fit: contain;
    width: 38px;
}

.ci-client-initials {
    align-items: center;
    background: #fff;
    border: 1px solid #dce4f1;
    border-radius: 8px;
    color: var(--ps-primary);
    display: inline-flex;
    flex: 0 0 38px;
    font-weight: 800;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.ci-client-label {
    color: #99a1b7;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.ci-client-name {
    color: #252f4a;
    font-size: 13px;
    font-weight: 800;
    max-width: 178px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ci-nav {
    display: grid;
    gap: 5px;
}

.ci-nav-section {
    color: #a1a5b7;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    margin: 18px 10px 8px;
    text-transform: uppercase;
}

.ci-nav-link {
    align-items: center;
    border-radius: 8px;
    color: #5e6278;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    text-decoration: none;
}

.ci-nav-link i {
    color: #99a1b7;
    font-size: 19px;
    width: 22px;
}

.ci-nav-link:hover,
.ci-nav-link.active {
    background: #f1f7ff;
    color: var(--ps-primary);
}

.ci-nav-link:hover i,
.ci-nav-link.active i {
    color: var(--ps-primary);
}

.ci-nav-note {
    color: #99a1b7;
    display: block;
    font-size: 12px;
    line-height: 1.45;
    padding: 8px 12px;
}

.ci-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.ci-topbar {
    align-items: center;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid #eef0f4;
    display: flex;
    justify-content: space-between;
    min-height: 76px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 15;
}

.ci-topbar-eyebrow {
    color: #99a1b7;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.ci-topbar-title {
    color: #071437;
    font-size: 18px;
    font-weight: 800;
}

.ci-topbar-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.ci-company-pill {
    align-items: center;
    display: inline-flex;
    font-size: 13px;
    min-height: 38px;
    padding: 0 14px;
}

.ci-sidebar-toggle {
    display: none;
}

.ci-sidebar-backdrop {
    display: none;
}

.ci-content {
    padding: 28px;
}

.ci-notification-icon,
.ci-stat-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.ci-notification-icon i,
.ci-stat-icon i {
    font-size: 20px;
}

.ci-theme-option.active {
    background: #f1f7ff;
    color: var(--ps-primary);
    font-weight: 700;
}

.app-logo {
    max-height: 34px;
    width: auto;
}

.app-logo-fallback {
    align-items: center;
    background: var(--ps-primary);
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    height: 34px;
    justify-content: center;
    text-transform: uppercase;
    width: 34px;
}

.app-panel {
    background: #fff;
    border: 1px solid #e6e9ef;
    border-radius: 8px;
    padding: 22px;
}

.panel-header {
    align-items: center;
    border-bottom: 1px solid #eef0f4;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin: -4px 0 18px;
    padding-bottom: 14px;
}

.ci-demo-hero {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e6e9ef;
    border-radius: 8px;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
    margin-bottom: 22px;
    overflow: hidden;
    padding: 28px;
}

.ci-demo-hero-copy {
    max-width: 760px;
}

.ci-demo-hero h1,
.auth-visual-content h1 {
    color: #071437;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.14;
    margin-bottom: 16px;
}

.ci-demo-hero p,
.auth-visual-content p {
    color: #5e6278;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 680px;
}

.ci-demo-hero-visual {
    align-items: center;
    background: #f7fbff;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 250px;
    padding: 14px;
}

.ci-demo-hero-visual img {
    display: block;
    max-height: 280px;
    max-width: 100%;
}

.ci-stat-card {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e6e9ef;
    border-radius: 8px;
    display: flex;
    gap: 16px;
    min-height: 104px;
    padding: 20px;
}

.ci-stat-value {
    color: #071437;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
}

.ci-stat-label {
    color: #99a1b7;
    font-size: 13px;
    font-weight: 700;
    margin-top: 4px;
}

.ci-empty-state {
    align-items: center;
    display: flex;
    flex-direction: column;
    padding: 42px 20px;
    text-align: center;
}

.ci-empty-icon {
    align-items: center;
    background: #f1f7ff;
    border-radius: 8px;
    color: var(--ps-primary);
    display: inline-flex;
    font-size: 28px;
    height: 58px;
    justify-content: center;
    margin-bottom: 16px;
    width: 58px;
}

.ci-empty-state h3 {
    color: #071437;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.ci-empty-state p {
    color: #7e8299;
    margin-bottom: 18px;
    max-width: 440px;
}

.auth-page {
    background: #f3f6f9;
    min-height: 100vh;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) minmax(420px, .58fr);
    min-height: 100vh;
}

.auth-visual {
    background: #f7fbff;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    padding: 42px;
    position: relative;
}

.auth-brand {
    align-items: center;
    color: #071437;
    display: inline-flex;
    font-size: 22px;
    font-weight: 800;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.auth-visual-content {
    align-self: center;
    max-width: 720px;
    position: relative;
    z-index: 1;
}

.auth-proof-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-proof-row span {
    align-items: center;
    background: #fff;
    border: 1px solid #e6e9ef;
    border-radius: 8px;
    color: #3f4254;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
}

.auth-proof-row i {
    color: var(--ps-accent);
}

.auth-illustration-wrap {
    align-items: flex-end;
    display: flex;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
}

.auth-illustration {
    display: block;
    max-height: 300px;
    max-width: min(620px, 100%);
    width: 100%;
}

.auth-panel {
    align-items: center;
    background: var(--bs-body-bg);
    display: flex;
    justify-content: center;
    padding: 42px;
    position: relative;
}

.auth-toolbar {
    position: absolute;
    right: 28px;
    top: 28px;
}

.auth-form.card {
    border: 1px solid #e6e9ef;
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
    max-width: 440px;
    width: 100%;
}

.auth-form-logo {
    max-height: 58px;
    max-width: 220px;
    object-fit: contain;
}

.auth-security-note {
    align-items: flex-start;
    background: #f8fafd;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    color: #5e6278;
    display: flex;
    font-size: 12px;
    font-weight: 700;
    gap: 10px;
    line-height: 1.45;
    margin-top: 22px;
    padding: 12px;
}

.auth-security-note i {
    color: var(--ps-accent);
    font-size: 18px;
}

.quote-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(320px, .9fr) minmax(520px, 1.5fr) minmax(320px, .8fr);
}

.quote-chat {
    min-height: 640px;
}

.chat-stream {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 440px;
    overflow: auto;
    padding-right: 4px;
}

.chat-bubble {
    border: 1px solid #e6e9ef;
    border-radius: 8px;
    padding: 12px 14px;
}

.chat-bubble-user {
    background: #eef6ff;
    border-color: #d8eaff;
}

.chat-bubble-assistant,
.chat-bubble-system {
    background: #f8fafd;
}

.chat-role {
    color: #7e8299;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.ci-chat-empty,
.ci-preview-empty {
    align-items: center;
    border: 1px dashed #d7dfec;
    border-radius: 8px;
    color: #7e8299;
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 28px 18px;
    text-align: center;
}

.ci-chat-empty span,
.ci-preview-empty i {
    align-items: center;
    background: #f1f7ff;
    border-radius: 8px;
    color: var(--ps-primary);
    display: inline-flex;
    font-size: 24px;
    height: 50px;
    justify-content: center;
    width: 50px;
}

.ci-chat-empty strong {
    color: #252f4a;
}

.ci-chat-empty p {
    margin: 0;
}

.chat-form {
    border-top: 1px solid #eef0f4;
    margin-top: 16px;
    padding-top: 16px;
}

.quote-qty {
    min-width: 86px;
}

.quote-preview {
    align-self: start;
}

.preview-lines {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-line {
    align-items: flex-start;
    border-bottom: 1px solid #eef0f4;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding-bottom: 12px;
}

.preview-totals {
    border-top: 1px solid #dfe3ea;
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
}

.preview-totals div {
    display: flex;
    justify-content: space-between;
}

.preview-totals .total {
    color: #071437;
    font-size: 18px;
}

.setup-grid {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 360px;
}

.setup-main {
    padding: 24px;
}

.setup-section {
    border-top: 1px solid #eef0f4;
    padding-top: 24px;
}

.setup-section + .setup-section {
    margin-top: 28px;
}

.setup-section-title {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
}

.setup-section-title span {
    align-items: center;
    background: #f1f7ff;
    border-radius: 8px;
    color: var(--ps-primary);
    display: inline-flex;
    flex: 0 0 42px;
    font-size: 20px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.setup-section-title h2 {
    color: #071437;
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 4px;
}

.setup-section-title p {
    color: #7e8299;
    margin: 0;
}

.setup-notes {
    background: #fff;
    border: 1px solid #e6e9ef;
    border-radius: 8px;
    padding: 22px;
    position: sticky;
    top: 98px;
}

.setup-preview {
    background: #f8fafd;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    margin-bottom: 22px;
    padding: 16px;
}

.setup-preview-brand {
    align-items: center;
    display: flex;
    gap: 12px;
}

.setup-preview-brand img {
    border-radius: 8px;
    height: 42px;
    object-fit: contain;
    width: 42px;
}

.setup-preview-brand strong,
.setup-preview-brand span {
    display: block;
}

.setup-preview-brand span {
    color: #99a1b7;
    font-size: 12px;
    font-weight: 700;
}

.setup-preview-image {
    border-radius: 8px;
    display: block;
    margin-top: 16px;
    max-height: 180px;
    object-fit: cover;
    width: 100%;
}

.code-note {
    background: #f6f8fb;
    border: 1px solid #e6e9ef;
    border-radius: 8px;
    color: #5e6278;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    margin-top: 8px;
    overflow-wrap: anywhere;
    padding: 10px;
}

[data-bs-theme="dark"] .ci-sidebar,
[data-bs-theme="dark"] .ci-topbar,
[data-bs-theme="dark"] .app-panel,
[data-bs-theme="dark"] .ci-demo-hero,
[data-bs-theme="dark"] .ci-stat-card,
[data-bs-theme="dark"] .setup-notes,
[data-bs-theme="dark"] .auth-form.card {
    background: #151922;
    border-color: #2b3040;
}

[data-bs-theme="dark"] .ci-client-card,
[data-bs-theme="dark"] .ci-demo-hero-visual,
[data-bs-theme="dark"] .auth-security-note,
[data-bs-theme="dark"] .setup-preview,
[data-bs-theme="dark"] .code-note,
[data-bs-theme="dark"] .chat-bubble-assistant,
[data-bs-theme="dark"] .chat-bubble-system {
    background: #1b202b;
    border-color: #2b3040;
}

[data-bs-theme="dark"] .auth-visual {
    background: #111823;
}

[data-bs-theme="dark"] .ci-brand-link,
[data-bs-theme="dark"] .ci-topbar-title,
[data-bs-theme="dark"] .ci-client-name,
[data-bs-theme="dark"] .ci-demo-hero h1,
[data-bs-theme="dark"] .auth-brand,
[data-bs-theme="dark"] .auth-visual-content h1,
[data-bs-theme="dark"] .ci-stat-value,
[data-bs-theme="dark"] .ci-empty-state h3,
[data-bs-theme="dark"] .ci-chat-empty strong,
[data-bs-theme="dark"] .setup-section-title h2,
[data-bs-theme="dark"] .preview-totals .total {
    color: #f5f8fa;
}

[data-bs-theme="dark"] .auth-proof-row span,
[data-bs-theme="dark"] .ci-client-initials {
    background: #151922;
    border-color: #2b3040;
    color: #f5f8fa;
}

[data-bs-theme="dark"] .chat-bubble-user {
    background: #132337;
    border-color: #24476c;
}

@media (max-width: 1280px) {
    .quote-layout,
    .setup-grid,
    .ci-demo-hero {
        grid-template-columns: 1fr;
    }

    .setup-notes {
        position: static;
    }
}

@media (max-width: 992px) {
    .ci-sidebar {
        box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
        left: 0;
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    .ci-shell.ci-sidebar-open .ci-sidebar {
        transform: translateX(0);
    }

    .ci-shell.ci-sidebar-open .ci-sidebar-backdrop {
        background: rgba(15, 23, 42, .35);
        display: block;
        inset: 0;
        position: fixed;
        z-index: 18;
    }

    .ci-sidebar-toggle {
        display: inline-flex;
    }

    .ci-topbar {
        padding: 0 18px;
    }

    .ci-content {
        padding: 18px;
    }

    .ci-company-pill {
        display: none;
    }

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

    .auth-visual {
        min-height: 520px;
        padding: 28px;
    }

    .auth-panel {
        align-items: flex-start;
        min-height: 520px;
        padding: 86px 24px 32px;
    }
}

@media (max-width: 640px) {
    .ci-demo-hero,
    .app-panel,
    .ci-stat-card,
    .setup-main,
    .setup-notes {
        padding: 16px;
    }

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

    .ci-topbar-actions {
        gap: 6px;
    }

    .ci-topbar-actions .btn:not(.btn-icon) {
        padding-left: 10px;
        padding-right: 10px;
    }

    .ci-demo-hero h1,
    .auth-visual-content h1 {
        font-size: 28px;
    }

    .auth-visual {
        min-height: 500px;
    }
}
