:root {
    --kb-ink: #132f3b;
    --kb-ink-soft: #526873;
    --kb-primary: #10685f;
    --kb-primary-dark: #0c514b;
    --kb-primary-soft: #e7f4f0;
    --kb-navy: #103845;
    --kb-navy-deep: #0a2934;
    --kb-line: #dce7ea;
    --kb-bg: #f4f8f9;
    --kb-white: #ffffff;
    --kb-success: #157347;
    --kb-success-bg: #e7f5ed;
    --kb-warning: #866313;
    --kb-warning-bg: #fff5d8;
    --kb-danger: #a23932;
    --kb-danger-bg: #fff0ee;
    --kb-shadow: 0 14px 45px rgba(19, 47, 59, .08);
    --kb-shadow-soft: 0 5px 22px rgba(19, 47, 59, .06);
    --kb-radius-xl: 24px;
    --kb-radius-lg: 16px;
    --kb-radius-md: 11px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--kb-ink);
    background: var(--kb-bg);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* -----------------------------------------------------
   BRAND
----------------------------------------------------- */

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

.kb-brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 20px;
    font-weight: 850;
    letter-spacing: -.05em;
    background:
        linear-gradient(
            145deg,
            #179b87,
            #0c514b
        );
    box-shadow:
        0 8px 20px
        rgba(15, 118, 110, .26);
}

.kb-brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.kb-brand-name {
    font-size: 18px;
    font-weight: 820;
    letter-spacing: .02em;
}

.kb-brand-subtitle {
    margin-top: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .16em;
    opacity: .66;
}

/* -----------------------------------------------------
   LOGIN
----------------------------------------------------- */

.kb-login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns:
        minmax(380px, .95fr)
        minmax(520px, 1.05fr);
    background: #edf4f5;
}

.kb-login-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    padding: 48px clamp(34px, 6vw, 82px);
    color: white;
    background:
        radial-gradient(
            circle at 20% 12%,
            rgba(58, 205, 181, .22),
            transparent 27%
        ),
        radial-gradient(
            circle at 90% 78%,
            rgba(54, 146, 167, .18),
            transparent 32%
        ),
        linear-gradient(
            150deg,
            #123f4c 0%,
            #0d3542 46%,
            #082832 100%
        );
}

.kb-login-hero::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    right: -160px;
    top: 23%;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 50%;
    box-shadow:
        0 0 0 55px rgba(255,255,255,.025),
        0 0 0 110px rgba(255,255,255,.018);
}

.kb-login-hero .kb-brand {
    position: relative;
    z-index: 1;
}

.kb-login-hero-content {
    position: relative;
    z-index: 1;
    max-width: 590px;
    margin: 80px 0;
}

.kb-login-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 999px;
    background: rgba(255,255,255,.07);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.kb-login-kicker-dot {
    width: 7px;
    height: 7px;
    background: #6ae1bf;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(106,225,191,.12);
}

.kb-login-hero h1 {
    max-width: 650px;
    margin: 25px 0 16px;
    font-size: clamp(38px, 4.8vw, 67px);
    line-height: 1.01;
    letter-spacing: -.047em;
}

.kb-login-hero-copy {
    max-width: 525px;
    margin: 0;
    color: rgba(255,255,255,.72);
    font-size: 17px;
    line-height: 1.7;
}

.kb-login-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 35px;
}

.kb-login-feature {
    min-height: 95px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.055);
    backdrop-filter: blur(9px);
}

.kb-login-feature strong {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.kb-login-feature span {
    color: rgba(255,255,255,.60);
    font-size: 12px;
    line-height: 1.45;
}

.kb-login-foot {
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,.48);
    font-size: 12px;
}

.kb-login-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 48px;
}

.kb-login-box {
    width: min(460px, 100%);
}

.kb-login-mobile-brand {
    display: none;
    margin-bottom: 34px;
}

.kb-login-main h2 {
    margin: 0;
    color: var(--kb-ink);
    font-size: 34px;
    letter-spacing: -.035em;
}

.kb-login-intro {
    margin: 10px 0 31px;
    color: var(--kb-ink-soft);
    line-height: 1.65;
}

.kb-alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border: 1px solid #f0c9c4;
    border-radius: var(--kb-radius-md);
    color: var(--kb-danger);
    background: var(--kb-danger-bg);
    font-size: 14px;
}

.kb-field {
    margin-bottom: 19px;
}

.kb-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 7px;
}

.kb-label {
    display: block;
    color: #294550;
    font-size: 13px;
    font-weight: 730;
}

.kb-input-wrap {
    position: relative;
}

.kb-input {
    width: 100%;
    min-height: 50px;
    padding: 0 15px;
    border: 1px solid #c9d8dc;
    border-radius: 11px;
    outline: none;
    color: var(--kb-ink);
    background: #fff;
    transition:
        border-color .15s,
        box-shadow .15s;
}

.kb-input:focus {
    border-color: #2a8b7d;
    box-shadow:
        0 0 0 4px
        rgba(42,139,125,.10);
}

.kb-password-input {
    padding-right: 72px;
}

.kb-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    padding: 8px 9px;
    color: #3b6570;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.kb-login-options {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin: 3px 0 24px;
    font-size: 13px;
}

.kb-check {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--kb-ink-soft);
}

.kb-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--kb-primary);
}

.kb-link {
    color: var(--kb-primary);
    font-weight: 690;
    text-decoration: none;
}

.kb-link:hover {
    text-decoration: underline;
}

.kb-primary-button {
    width: 100%;
    min-height: 51px;
    border: 0;
    border-radius: 11px;
    color: white;
    background:
        linear-gradient(
            135deg,
            #13796d,
            #0d5b55
        );
    font-weight: 770;
    cursor: pointer;
    box-shadow:
        0 10px 25px
        rgba(15,118,110,.20);
    transition:
        transform .15s,
        box-shadow .15s;
}

.kb-primary-button:hover {
    transform: translateY(-1px);
    box-shadow:
        0 14px 30px
        rgba(15,118,110,.26);
}

.kb-login-activation {
    margin-top: 26px;
    padding-top: 23px;
    border-top: 1px solid var(--kb-line);
    text-align: center;
    color: var(--kb-ink-soft);
    font-size: 13px;
}

/* -----------------------------------------------------
   APPLICATION SHELL
----------------------------------------------------- */

.kb-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 258px minmax(0, 1fr);
}

.kb-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 25px 18px 18px;
    color: #fff;
    background:
        linear-gradient(
            180deg,
            #113b49 0%,
            #0c303b 58%,
            #092832 100%
        );
    z-index: 40;
}

.kb-sidebar .kb-brand {
    padding: 0 9px 24px;
}

.kb-sidebar-section {
    margin-top: 18px;
}

.kb-sidebar-title {
    padding: 0 12px 7px;
    color: rgba(255,255,255,.42);
    font-size: 10px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .13em;
}

.kb-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kb-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 43px;
    padding: 0 12px;
    border-radius: 9px;
    color: rgba(255,255,255,.70);
    text-decoration: none;
    font-size: 13px;
    font-weight: 640;
    transition:
        color .14s,
        background .14s;
}

.kb-nav-link:hover,
.kb-nav-link.is-active {
    color: #fff;
    background: rgba(255,255,255,.095);
}

.kb-nav-icon {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 7px;
    color: rgba(255,255,255,.76);
    background: rgba(255,255,255,.07);
    font-size: 11px;
    font-weight: 850;
}

.kb-sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
}

.kb-user-mini {
    padding: 13px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: rgba(255,255,255,.05);
}

.kb-user-mini-name {
    overflow: hidden;
    font-size: 13px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-user-mini-role {
    margin-top: 3px;
    color: rgba(255,255,255,.50);
    font-size: 11px;
}

.kb-logout-button {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    color: rgba(255,255,255,.72);
    background: rgba(255,255,255,.06);
    cursor: pointer;
}

.kb-logout-button:hover {
    color: #fff;
    background: rgba(255,255,255,.10);
}

/* -----------------------------------------------------
   MAIN
----------------------------------------------------- */

.kb-main {
    min-width: 0;
}

.kb-topbar {
    position: sticky;
    top: 0;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 32px;
    border-bottom: 1px solid rgba(210,225,229,.85);
    background: rgba(250,252,252,.91);
    backdrop-filter: blur(14px);
    z-index: 25;
}

.kb-mobile-menu {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--kb-line);
    border-radius: 10px;
    background: white;
    cursor: pointer;
}

.kb-topbar-title {
    font-size: 13px;
    color: var(--kb-ink-soft);
}

.kb-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kb-role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 0 10px;
    border: 1px solid #cde3df;
    border-radius: 999px;
    color: #12675e;
    background: #edf8f5;
    font-size: 11px;
    font-weight: 780;
    letter-spacing: .04em;
}

.kb-content {
    max-width: 1480px;
    margin: 0 auto;
    padding: 32px;
}

.kb-page-header {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: end;
    margin-bottom: 25px;
}

.kb-eyebrow {
    margin-bottom: 6px;
    color: var(--kb-primary);
    font-size: 11px;
    font-weight: 820;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.kb-page-header h1 {
    margin: 0;
    font-size: clamp(29px, 3vw, 39px);
    line-height: 1.1;
    letter-spacing: -.04em;
}

.kb-page-subtitle {
    max-width: 690px;
    margin: 8px 0 0;
    color: var(--kb-ink-soft);
    line-height: 1.6;
}

.kb-date-pill {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid var(--kb-line);
    border-radius: 9px;
    color: var(--kb-ink-soft);
    background: white;
    font-size: 12px;
}

/* -----------------------------------------------------
   DASHBOARD CARDS
----------------------------------------------------- */

.kb-hero-card {
    position: relative;
    overflow: hidden;
    padding: 29px;
    border-radius: var(--kb-radius-xl);
    color: #fff;
    background:
        radial-gradient(
            circle at 92% 15%,
            rgba(93,218,196,.18),
            transparent 24%
        ),
        linear-gradient(
            135deg,
            #123f4c,
            #0b5c57
        );
    box-shadow: var(--kb-shadow);
}

.kb-hero-card::after {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    right: -90px;
    bottom: -130px;
    border-radius: 50%;
    border: 34px solid rgba(255,255,255,.035);
}

.kb-hero-label {
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,.64);
    font-size: 11px;
    font-weight: 780;
    text-transform: uppercase;
    letter-spacing: .11em;
}

.kb-hero-value {
    position: relative;
    z-index: 1;
    margin-top: 9px;
    font-size: clamp(31px, 4vw, 47px);
    font-weight: 830;
    letter-spacing: -.045em;
}

.kb-hero-meta {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 27px;
}

.kb-hero-meta-item {
    padding-top: 13px;
    border-top: 1px solid rgba(255,255,255,.12);
}

.kb-hero-meta-item span {
    display: block;
    color: rgba(255,255,255,.55);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.kb-hero-meta-item strong {
    display: block;
    margin-top: 5px;
    font-size: 14px;
}

.kb-stats-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.kb-stat-card,
.kb-card {
    border: 1px solid var(--kb-line);
    border-radius: var(--kb-radius-lg);
    background: var(--kb-white);
    box-shadow: var(--kb-shadow-soft);
}

.kb-stat-card {
    min-height: 143px;
    padding: 19px;
}

.kb-stat-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.kb-stat-icon {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--kb-primary);
    background: var(--kb-primary-soft);
    font-size: 11px;
    font-weight: 850;
}

.kb-stat-label {
    margin-top: 17px;
    color: var(--kb-ink-soft);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.kb-stat-value {
    margin-top: 5px;
    font-size: 24px;
    font-weight: 820;
    letter-spacing: -.025em;
}

.kb-stat-note {
    margin-top: 5px;
    color: #7a8d95;
    font-size: 11px;
}

.kb-dashboard-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.35fr)
        minmax(290px, .65fr);
    gap: 18px;
    margin-top: 18px;
}

.kb-card {
    padding: 23px;
}

.kb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 17px;
}

.kb-card-title {
    margin: 0;
    font-size: 17px;
    letter-spacing: -.02em;
}

.kb-card-subtitle {
    margin: 5px 0 0;
    color: var(--kb-ink-soft);
    font-size: 12px;
}

.kb-action-list {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.kb-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 78px;
    padding: 14px;
    border: 1px solid #e1eaed;
    border-radius: 12px;
    background: #fbfdfd;
    text-decoration: none;
    transition:
        transform .14s,
        border-color .14s,
        box-shadow .14s;
}

.kb-action:hover {
    transform: translateY(-1px);
    border-color: #bed8d4;
    box-shadow: 0 8px 20px rgba(19,47,59,.06);
}

.kb-action-copy strong {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
}

.kb-action-copy span {
    display: block;
    color: var(--kb-ink-soft);
    font-size: 11px;
}

.kb-action-count {
    min-width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    padding: 0 8px;
    border-radius: 9px;
    color: var(--kb-primary);
    background: var(--kb-primary-soft);
    font-size: 12px;
    font-weight: 820;
}

.kb-quick-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kb-quick-link {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f3;
    text-decoration: none;
    font-size: 13px;
    font-weight: 680;
}

.kb-quick-link:last-child {
    border-bottom: 0;
}

.kb-quick-arrow {
    color: #88a0a8;
}

.kb-next-due {
    padding: 17px;
    border-radius: 13px;
    background:
        linear-gradient(
            135deg,
            #f0f8f6,
            #f8fbfb
        );
    border: 1px solid #d8ebe7;
}

.kb-next-due-label {
    color: var(--kb-ink-soft);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 750;
    letter-spacing: .06em;
}

.kb-next-due-amount {
    margin-top: 5px;
    font-size: 23px;
    font-weight: 820;
}

.kb-next-due-date {
    margin-top: 5px;
    color: #567079;
    font-size: 12px;
}

.kb-empty {
    padding: 22px;
    border: 1px dashed #cfdee1;
    border-radius: 13px;
    color: var(--kb-ink-soft);
    background: #fbfdfd;
    font-size: 13px;
}

/* -----------------------------------------------------
   RESPONSIVE
----------------------------------------------------- */

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

@media (max-width: 1100px) {
    .kb-stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .kb-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .kb-login-page {
        grid-template-columns: 1fr;
    }

    .kb-login-hero {
        display: none;
    }

    .kb-login-main {
        padding: 30px 20px;
    }

    .kb-login-mobile-brand {
        display: flex;
    }

    .kb-app {
        display: block;
    }

    .kb-sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-105%);
        width: 258px;
        transition: transform .18s ease;
        box-shadow: 18px 0 45px rgba(0,0,0,.16);
    }

    body.kb-menu-open .kb-sidebar {
        transform: translateX(0);
    }

    .kb-sidebar-backdrop {
        position: fixed;
        inset: 0;
        display: block;
        visibility: hidden;
        opacity: 0;
        background: rgba(5,25,32,.40);
        transition:
            opacity .18s,
            visibility .18s;
        z-index: 35;
    }

    body.kb-menu-open .kb-sidebar-backdrop {
        visibility: visible;
        opacity: 1;
    }

    .kb-mobile-menu {
        display: grid;
        place-items: center;
    }

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

    .kb-content {
        padding: 24px 18px;
    }
}

@media (max-width: 650px) {
    .kb-page-header {
        align-items: start;
        flex-direction: column;
    }

    .kb-stats-grid,
    .kb-action-list,
    .kb-hero-meta {
        grid-template-columns: 1fr;
    }

    .kb-stat-card {
        min-height: auto;
    }

    .kb-hero-card {
        padding: 23px;
    }

    .kb-role-badge {
        display: none;
    }
}

/* =====================================================
   DESIGN PASS 1B — OPERATIONAL PAGES
===================================================== */

.kb-content > h1,
.kb-content > h2 {
    margin-top: 0;
    letter-spacing: -.035em;
}

.kb-content > h1 {
    margin-bottom: 7px;
    font-size: clamp(28px, 3vw, 38px);
}

.kb-content > h2 {
    margin-bottom: 18px;
    font-size: clamp(25px, 2.5vw, 34px);
}

.kb-content > p {
    color: var(--kb-ink-soft);
}

.card {
    margin-bottom: 17px;
    padding: 22px;
    border: 1px solid var(--kb-line);
    border-radius: var(--kb-radius-lg);
    background: var(--kb-white);
    box-shadow: var(--kb-shadow-soft);
}

.card h1,
.card h2,
.card h3 {
    margin-top: 0;
    letter-spacing: -.025em;
}

.card h1 {
    font-size: 26px;
}

.card h2 {
    font-size: 19px;
}

.card h3 {
    font-size: 15px;
}

.muted {
    color: var(--kb-ink-soft);
}

.grid,
.details {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.grid > div,
.details > div {
    min-width: 0;
}

.details small,
.grid small,
.kb-content small {
    display: block;
    margin-bottom: 4px;
    color: #6c8189;
    font-size: 11px;
    font-weight: 670;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 18px;
    flex-wrap: wrap;
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.kb-content label {
    display: block;
    margin: 13px 0 6px;
    color: #294550;
    font-size: 12px;
    font-weight: 730;
}

.kb-content input:not([type="checkbox"]):not([type="radio"]),
.kb-content select,
.kb-content textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c8d7db;
    border-radius: 9px;
    outline: none;
    color: var(--kb-ink);
    background: #fff;
    transition:
        border-color .14s,
        box-shadow .14s;
}

.kb-content input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 44px;
}

.kb-content textarea {
    min-height: 86px;
    resize: vertical;
}

.kb-content input:focus,
.kb-content select:focus,
.kb-content textarea:focus {
    border-color: #2a8b7d;
    box-shadow:
        0 0 0 4px
        rgba(42,139,125,.09);
}

.kb-content input[type="checkbox"],
.kb-content input[type="radio"] {
    accent-color: var(--kb-primary);
}

.kb-content button,
.kb-content .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 14px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--kb-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 730;
    text-decoration: none;
    cursor: pointer;
    transition:
        background .14s,
        transform .14s;
}

.kb-content button:hover,
.kb-content .button:hover {
    transform: translateY(-1px);
    background: var(--kb-primary-dark);
}

.kb-content button.secondary,
.kb-content .button.secondary,
.secondary {
    background: #8a6a1e;
}

.kb-content button.danger,
.kb-content .button.danger,
.danger {
    background: var(--kb-danger);
}

.kb-content a:not(.kb-action):not(.kb-quick-link):not(.button) {
    color: var(--kb-primary);
    font-weight: 660;
    text-decoration: none;
}

.kb-content a:not(.kb-action):not(.kb-quick-link):not(.button):hover {
    text-decoration: underline;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #45606a;
    background: #eaf1f3;
    font-size: 11px;
    font-weight: 760;
}

.badge.available,
.available,
.ready {
    color: var(--kb-success);
    background: var(--kb-success-bg);
}

.badge.waiting,
.waiting,
.emergency {
    color: var(--kb-warning);
    background: var(--kb-warning-bg);
}

.notice {
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid #cce5d6;
    border-radius: 10px;
    color: var(--kb-success);
    background: var(--kb-success-bg);
}

.notice.error,
.error {
    border-color: #f0c9c4;
    color: var(--kb-danger);
    background: var(--kb-danger-bg);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--kb-line);
    border-radius: 12px;
}

.kb-content table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: #fff;
    font-size: 12px;
}

.kb-content table[border] {
    border: 0;
}

.kb-content th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--kb-line);
    color: #60757d;
    background: #f7fafb;
    font-size: 10px;
    font-weight: 790;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .045em;
    white-space: nowrap;
}

.kb-content td {
    padding: 12px;
    border-bottom: 1px solid #edf2f3;
    vertical-align: top;
}

.kb-content tr:last-child td {
    border-bottom: 0;
}

.kb-content tr:hover td {
    background: #fbfdfd;
}

.kb-content hr {
    height: 1px;
    margin: 18px 0;
    border: 0;
    background: var(--kb-line);
}

.kb-content form.inline {
    min-width: 220px;
    flex: 1;
}

.purpose {
    overflow-wrap: anywhere;
}

.kb-content ul {
    padding-left: 20px;
}

.kb-content nav[role="navigation"] {
    margin-top: 20px;
}

.kb-content nav svg {
    width: 18px;
    height: 18px;
}

.kb-page-intro {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
}

.kb-page-intro h1,
.kb-page-intro h2 {
    margin: 0;
}

.kb-page-intro p {
    margin: 6px 0 0;
    color: var(--kb-ink-soft);
}

.kb-record-row {
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid #e2ebed;
    border-radius: 11px;
    background: #fbfdfd;
}

.kb-finance-note {
    padding: 13px 15px;
    border-left: 3px solid var(--kb-primary);
    border-radius: 0 9px 9px 0;
    color: #45606a;
    background: #edf7f5;
    font-size: 12px;
}

@media (max-width: 900px) {
    .grid,
    .details {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .card {
        padding: 17px;
    }

    .grid,
    .details {
        grid-template-columns: 1fr;
    }

    .kb-content table {
        min-width: 690px;
    }

    .kb-page-intro {
        align-items: start;
        flex-direction: column;
    }
}

/* =====================================================
   DESIGN PASS 1C — AUTHENTICATION JOURNEY
===================================================== */

.kb-auth-progress {
    display: flex;
    gap: 7px;
    margin: 0 0 27px;
}

.kb-auth-progress-step {
    height: 4px;
    flex: 1;
    overflow: hidden;
    border-radius: 999px;
    background: #dce8ea;
}

.kb-auth-progress-step.is-done,
.kb-auth-progress-step.is-current {
    background:
        linear-gradient(
            90deg,
            #179b87,
            #0d6b61
        );
}

.kb-auth-status {
    margin-bottom: 20px;
    padding: 13px 15px;
    border: 1px solid #c9e7d5;
    border-radius: var(--kb-radius-md);
    color: var(--kb-success);
    background: var(--kb-success-bg);
    font-size: 13px;
    line-height: 1.55;
}

.kb-auth-note {
    margin: 20px 0;
    padding: 13px 14px;
    border: 1px solid #d9e9e6;
    border-radius: 11px;
    color: #506970;
    background: #f0f8f6;
    font-size: 12px;
    line-height: 1.6;
}

.kb-auth-note strong {
    color: var(--kb-primary-dark);
}

.kb-auth-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
}

.kb-auth-actions .kb-primary-button {
    flex: 1;
}

.kb-auth-secondary-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid #cbdadd;
    border-radius: 10px;
    color: #48626b;
    background: #fff;
    font-size: 12px;
    font-weight: 720;
    text-decoration: none;
    cursor: pointer;
}

.kb-auth-secondary-button:hover {
    border-color: #a9c8c4;
    color: var(--kb-primary-dark);
    background: #f8fbfb;
}

.kb-auth-footer {
    margin-top: 25px;
    padding-top: 21px;
    border-top: 1px solid var(--kb-line);
    color: var(--kb-ink-soft);
    font-size: 13px;
    text-align: center;
}

.kb-auth-security {
    display: flex;
    gap: 10px;
    align-items: start;
    margin-top: 23px;
    color: #70838a;
    font-size: 11px;
    line-height: 1.55;
}

.kb-auth-security-mark {
    width: 25px;
    height: 25px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--kb-primary);
    background: var(--kb-primary-soft);
    font-size: 10px;
    font-weight: 850;
}

.kb-otp-input {
    min-height: 62px;
    padding: 0 20px !important;
    text-align: center;
    font-size: 25px !important;
    font-weight: 820;
    letter-spacing: .32em;
    font-variant-numeric: tabular-nums;
}

.kb-password-rules {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: -5px 0 21px;
}

.kb-password-rule {
    padding: 8px 10px;
    border: 1px solid #e1eaec;
    border-radius: 9px;
    color: #677c84;
    background: #fafcfc;
    font-size: 11px;
}

.kb-readonly {
    color: #60747c !important;
    background: #f3f7f8 !important;
    cursor: not-allowed;
}

.kb-resend-form {
    margin-top: 12px;
}

.kb-resend-button {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbdadd;
    border-radius: 10px;
    color: var(--kb-primary);
    background: #fff;
    font-size: 12px;
    font-weight: 730;
    cursor: pointer;
}

.kb-resend-button:hover {
    background: #f5faf9;
    border-color: #a8cdc7;
}

@media (max-width: 520px) {
    .kb-auth-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .kb-auth-secondary-button {
        width: 100%;
    }

    .kb-password-rules {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   M6.2 — FINANCE DASHBOARD
===================================================== */

.kb-finance-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.kb-finance-two-column {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.kb-finance-breakdown {
    display: grid;
    gap: 0;
}

.kb-finance-breakdown > div,
.kb-finance-reconciliation > div,
.kb-finance-expense-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid var(--kb-line);
}

.kb-finance-breakdown span,
.kb-finance-reconciliation span,
.kb-finance-expense-row span {
    color: var(--kb-ink-soft);
    font-size: 12px;
}

.kb-finance-breakdown-total {
    margin-top: 5px;
    border-bottom: 0 !important;
    font-size: 15px;
}

.kb-finance-breakdown-total strong {
    color: var(--kb-primary);
    font-size: 18px;
}

.kb-finance-reconciliation {
    display: grid;
}

.kb-finance-card-action {
    margin-top: 18px;
}

.kb-finance-ledger-card {
    margin-top: 18px;
}

.kb-finance-filters {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(130px, .8fr))
        minmax(220px, 1.4fr)
        auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 20px;
}

.kb-finance-filters label {
    display: block;
    margin-bottom: 6px;
    color: var(--kb-ink-soft);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.kb-finance-search-field {
    min-width: 0;
}

.kb-finance-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kb-finance-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.kb-finance-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.kb-finance-table th,
.kb-finance-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--kb-line);
    text-align: left;
    vertical-align: top;
}

.kb-finance-table th {
    color: var(--kb-ink-soft);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.kb-finance-table td {
    font-size: 12px;
}

.kb-finance-table td small {
    display: block;
    margin-top: 4px;
    color: var(--kb-ink-soft);
}

.kb-money-cell {
    text-align: right !important;
    white-space: nowrap;
    font-weight: 800;
}

.kb-money-cell.is-credit {
    color: #167a60;
}

.kb-money-cell.is-debit {
    color: #b34343;
}

.kb-finance-direction {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .04em;
}

.kb-finance-direction.is-credit {
    color: #167a60;
    background: #eaf7f1;
}

.kb-finance-direction.is-debit {
    color: #a63d3d;
    background: #fff0f0;
}

.kb-finance-expense-row:last-child,
.kb-finance-reconciliation > div:last-child {
    border-bottom: 0;
}

.kb-finance-expense-row > div {
    display: grid;
    gap: 4px;
}

.kb-finance-expense-row > div:last-child {
    text-align: right;
}

.kb-finance-empty {
    display: grid;
    gap: 6px;
    padding: 24px;
    border: 1px dashed var(--kb-line);
    border-radius: 14px;
    color: var(--kb-ink-soft);
    text-align: center;
}

.kb-finance-empty strong {
    color: var(--kb-ink);
}

.kb-finance-pagination {
    margin-top: 18px;
}

@media (max-width: 1200px) {
    .kb-finance-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .kb-finance-filters {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .kb-finance-two-column {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 650px) {
    .kb-finance-summary-grid,
    .kb-finance-filters {
        grid-template-columns: 1fr;
    }

    .kb-finance-filter-actions {
        align-items: stretch;
    }

    .kb-finance-filter-actions > * {
        flex: 1;
        text-align: center;
    }

    .kb-finance-breakdown > div,
    .kb-finance-reconciliation > div,
    .kb-finance-expense-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .kb-finance-expense-row > div:last-child {
        text-align: left;
    }

    /*
     * Mobile-first ledger cards.
     * Desktop remains a normal table.
     */
    .kb-finance-table {
        min-width: 0;
    }

    .kb-finance-table thead {
        display: none;
    }

    .kb-finance-table,
    .kb-finance-table tbody,
    .kb-finance-table tr,
    .kb-finance-table td {
        display: block;
        width: 100%;
    }

    .kb-finance-table tr {
        margin-bottom: 12px;
        padding: 9px 14px;
        border: 1px solid var(--kb-line);
        border-radius: 14px;
        background: var(--kb-white);
    }

    .kb-finance-table td {
        display: grid;
        grid-template-columns:
            minmax(105px, .7fr)
            minmax(0, 1.3fr);
        gap: 12px;
        padding: 9px 0;
        border-bottom: 1px solid var(--kb-line);
    }

    .kb-finance-table td:last-child {
        border-bottom: 0;
    }

    .kb-finance-table td::before {
        content: attr(data-label);
        color: var(--kb-ink-soft);
        font-size: 10px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    .kb-money-cell {
        text-align: left !important;
    }
}

/* =====================================================
   M6.2 RESPONSIVE SIDEBAR HOTFIX
   Short laptop viewports + finance overflow containment
===================================================== */

/*
 * Sidebar must remain usable even when its navigation
 * is taller than the physical viewport.
 */
.kb-sidebar {
    box-sizing: border-box;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

/*
 * Flex children must be allowed to shrink naturally.
 * Footer remains after navigation and becomes reachable
 * by scrolling the sidebar instead of disappearing.
 */
.kb-sidebar .kb-brand,
.kb-sidebar-section,
.kb-sidebar-footer {
    flex-shrink: 0;
}

.kb-sidebar-footer {
    padding-bottom: 2px;
}

/*
 * Prevent wide dashboard/finance descendants from
 * forcing the application grid wider than the viewport.
 */
.kb-main,
.kb-content,
.kb-card,
.kb-finance-ledger-card,
.kb-finance-table-wrap {
    min-width: 0;
}

.kb-main {
    max-width: 100%;
    overflow-x: hidden;
}

.kb-content {
    max-width: 100%;
}

/*
 * Keep horizontal scrolling local to genuinely wide
 * transaction tables, not the whole application page.
 */
.kb-finance-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

/*
 * Slightly tighten tall navigation on short laptop
 * screens without changing normal desktop sizing.
 */
@media (min-width: 901px) and (max-height: 800px) {
    .kb-sidebar {
        padding-top: 18px;
        padding-bottom: 14px;
    }

    .kb-sidebar .kb-brand {
        padding-bottom: 16px;
    }

    .kb-sidebar-section {
        margin-top: 12px;
    }

    .kb-nav {
        gap: 2px;
    }

    .kb-nav-link {
        min-height: 38px;
    }

    .kb-sidebar-footer {
        padding-top: 12px;
    }
}

/*
 * Mobile drawer uses the same viewport-safe scrolling.
 */
@media (max-width: 900px) {
    .kb-sidebar {
        top: 0;
        bottom: 0;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* =====================================================
   M6.3 — LIQUIDITY FORECAST
===================================================== */

.kb-liquidity-forecast-card {
    margin-top: 18px;
}

.kb-forecast-advisory {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid var(--kb-line);
    border-radius: 999px;
    color: var(--kb-ink-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.kb-forecast-horizon {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.kb-forecast-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--kb-line);
    border-radius: 999px;
    color: var(--kb-ink-soft);
    background: var(--kb-white);
    font-size: 11px;
    font-weight: 850;
    text-decoration: none;
}

.kb-forecast-pill.is-active {
    border-color: var(--kb-primary);
    color: var(--kb-white);
    background: var(--kb-primary);
}

.kb-forecast-metrics {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.kb-forecast-metrics > div,
.kb-forecast-protected > div {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--kb-line);
    border-radius: 14px;
}

.kb-forecast-metrics span,
.kb-forecast-protected span {
    color: var(--kb-ink-soft);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.kb-forecast-metrics strong {
    font-size: 20px;
}

.kb-forecast-metrics .is-highlight {
    border-color: var(--kb-primary);
}

.kb-forecast-metrics .is-highlight strong {
    color: var(--kb-primary);
}

.kb-forecast-protected {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.kb-forecast-protected small {
    color: var(--kb-ink-soft);
    font-size: 10px;
}

.kb-forecast-target-form {
    display: flex;
    align-items: end;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--kb-line);
}

.kb-forecast-target-form > div {
    flex: 1;
    min-width: 180px;
}

.kb-forecast-target-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--kb-ink-soft);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.kb-forecast-estimate {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--kb-line);
    border-radius: 14px;
}

.kb-forecast-estimate > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.kb-forecast-estimate span {
    color: var(--kb-ink-soft);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.kb-forecast-estimate p {
    margin: 0;
    color: var(--kb-ink-soft);
    font-size: 12px;
}

.kb-forecast-timeline {
    margin-top: 20px;
}

.kb-forecast-event {
    display: grid;
    grid-template-columns:
        70px
        minmax(0, 1fr)
        auto;
    align-items: center;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--kb-line);
}

.kb-forecast-event:last-child {
    border-bottom: 0;
}

.kb-forecast-event-date {
    font-weight: 850;
}

.kb-forecast-event-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.kb-forecast-event-copy span {
    color: var(--kb-ink-soft);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.kb-forecast-event-amount {
    white-space: nowrap;
    font-weight: 850;
}

.kb-forecast-event-amount.is-positive,
.kb-forecast-metrics .is-positive {
    color: #167a60;
}

.kb-forecast-event-amount.is-protected {
    color: var(--kb-ink-soft);
}

.kb-forecast-reservations {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding: 15px;
    border: 1px solid var(--kb-line);
    border-radius: 14px;
}

.kb-forecast-reservations > div {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto
        auto;
    align-items: center;
    gap: 12px;
}

.kb-forecast-reservations small {
    color: var(--kb-ink-soft);
}

.kb-forecast-note {
    margin-top: 18px;
    padding: 13px 15px;
    border: 1px dashed var(--kb-line);
    border-radius: 12px;
    color: var(--kb-ink-soft);
    font-size: 11px;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .kb-forecast-metrics,
    .kb-forecast-protected {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .kb-forecast-target-form {
        align-items: stretch;
        flex-direction: column;
    }

    .kb-forecast-target-form > div,
    .kb-forecast-target-form > * {
        width: 100%;
    }

    .kb-forecast-event {
        grid-template-columns:
            62px
            minmax(0, 1fr);
    }

    .kb-forecast-event-amount {
        grid-column: 2;
    }

    .kb-forecast-reservations > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .kb-forecast-estimate > div {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =====================================================
   M6.3 FORECAST ACTIVE PILL VISIBILITY HOTFIX
===================================================== */

/*
 * Keep the selected horizon label visible across
 * normal, visited, focus and active anchor states.
 */
.kb-forecast-pill.is-active,
.kb-forecast-pill.is-active:link,
.kb-forecast-pill.is-active:visited,
.kb-forecast-pill.is-active:hover,
.kb-forecast-pill.is-active:focus,
.kb-forecast-pill.is-active:active {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
    opacity: 1;
    visibility: visible;
    text-decoration: none;
}

/*
 * Preserve active background/border against generic
 * application anchor/button state rules.
 */
.kb-forecast-pill.is-active,
.kb-forecast-pill.is-active:visited {
    background: var(--kb-primary) !important;
    border-color: var(--kb-primary) !important;
}

/* =====================================================
   M6.4 — WHAT-IF SIMULATOR
===================================================== */

.kb-whatif-card {
    margin-top: 18px;
}

.kb-whatif-form {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.kb-whatif-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--kb-ink-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.kb-whatif-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kb-whatif-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--kb-line);
    border-radius: 14px;
}

.kb-whatif-status span {
    color: var(--kb-ink-soft);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.kb-whatif-status.is-deficit strong {
    color: #b42318;
}

.kb-whatif-status.is-positive strong {
    color: #167a60;
}

.kb-whatif-metrics {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.kb-whatif-metrics > div {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 15px;
    border: 1px solid var(--kb-line);
    border-radius: 14px;
}

.kb-whatif-metrics span {
    color: var(--kb-ink-soft);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.kb-whatif-metrics strong {
    font-size: 18px;
}

.kb-whatif-metrics .is-highlight {
    border-color: var(--kb-primary);
}

.kb-whatif-metrics .is-highlight strong {
    color: var(--kb-primary);
}

.kb-whatif-breakdown {
    display: grid;
    gap: 0;
    margin-top: 18px;
    border: 1px solid var(--kb-line);
    border-radius: 14px;
    overflow: hidden;
}

.kb-whatif-breakdown > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--kb-line);
}

.kb-whatif-breakdown > div:last-child {
    border-bottom: 0;
}

.kb-whatif-breakdown span {
    color: var(--kb-ink-soft);
}

.kb-whatif-release-note {
    margin-top: 14px;
    padding: 13px 15px;
    border: 1px dashed var(--kb-line);
    border-radius: 12px;
    color: var(--kb-ink-soft);
    font-size: 11px;
    line-height: 1.6;
}

@media (max-width: 1000px) {
    .kb-whatif-form,
    .kb-whatif-metrics {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .kb-whatif-form,
    .kb-whatif-metrics {
        grid-template-columns: 1fr;
    }

    .kb-whatif-status,
    .kb-whatif-breakdown > div {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =====================================================
   M6.4 UI CONTINUITY HOTFIX
   Button alignment + anchored return positions
===================================================== */

/*
 * When GET forms reload the page, anchored sections
 * should sit comfortably below the viewport top.
 */
#liquidity-forecast,
#what-if-simulator {
    scroll-margin-top: 20px;
}

/*
 * Keep What-If action controls on a shared baseline.
 */
.kb-whatif-actions {
    align-items: stretch;
}

.kb-whatif-actions > button,
.kb-whatif-actions > .kb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 46px;
    margin: 0;
    padding-top: 10px;
    padding-bottom: 10px;
    line-height: 1.2;
}

/*
 * Secondary Clear action should look deliberate,
 * not like a loose text link.
 */
.kb-whatif-actions > .kb-button-secondary {
    text-decoration: none;
}

@media (max-width: 650px) {
    .kb-whatif-actions > button,
    .kb-whatif-actions > .kb-button {
        width: 100%;
    }
}

/* =====================================================
   FUNDING TARGET ACTION ALIGNMENT HOTFIX
===================================================== */

/*
 * Estimate Date is a <button> while Clear is an <a>.
 * Normalize both into the same visual control geometry.
 */
.kb-forecast-target-form > button,
.kb-forecast-target-form > .kb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    align-self: flex-end;
    min-height: 46px;
    margin: 0;
    padding: 10px 16px;
    line-height: 1.2;
    white-space: nowrap;
}

.kb-forecast-target-form > .kb-button-secondary {
    text-decoration: none;
}

/*
 * Keep Funding Target controls comfortable on mobile.
 */
@media (max-width: 650px) {
    .kb-forecast-target-form > button,
    .kb-forecast-target-form > .kb-button {
        width: 100%;
        align-self: stretch;
    }
}
