:root {
    --ks-navy: #151b49;
    --ks-navy-soft: #252b59;
    --ks-teal: #34b0a2;
    --ks-mint: #37e0c1;
    --ks-line: #dfe7ea;
    --ks-bg: #f4f8f8;
    --ks-text: #172033;
    --ks-muted: #687584;
    --ks-danger: #bd3341;
    --ks-success: #26885d;
    --radius: 8px;
    --shadow: 0 14px 40px rgba(21, 27, 73, .08);
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--ks-bg);
    color: var(--ks-text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0;
}

a {
    color: var(--ks-teal);
    text-decoration: none;
}

.landing-page {
    background: #fff;
}

.landing-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    min-height: 78px;
    padding: 14px clamp(18px, 4vw, 58px);
    background: rgba(255, 255, 255, .95);
    border-bottom: 1px solid rgba(223, 231, 234, .86);
}

.landing-brand img {
    display: block;
    width: 178px;
    max-width: 46vw;
}

.landing-nav nav {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.landing-nav nav a:not(.button) {
    color: var(--ks-navy);
    font-weight: 750;
    font-size: .95rem;
}

.landing-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 118px);
    padding: clamp(46px, 8vw, 96px) clamp(18px, 7vw, 96px);
    overflow: hidden;
    color: #fff;
    background-image: url("../img/landing-partner-hero.jpg");
    background-size: cover;
    background-position: center right;
}

.landing-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(12, 18, 44, .54);
}

.landing-hero-copy {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
}

.landing-hero .eyebrow {
    color: #8ff2df;
}

.landing-hero h1 {
    margin: 14px 0 20px;
    font-size: clamp(3rem, 7vw, 6.4rem);
    line-height: .92;
    max-width: 780px;
}

.landing-hero p {
    max-width: 640px;
    margin: 0;
    color: rgba(255, 255, 255, .88);
    font-size: clamp(1.05rem, 2vw, 1.28rem);
    line-height: 1.65;
}

.landing-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.button.ghost.light {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border-color: rgba(255, 255, 255, .62);
}

.landing-section {
    padding: clamp(54px, 7vw, 92px) clamp(18px, 7vw, 96px);
    scroll-margin-top: 96px;
}

.section-heading {
    max-width: 760px;
    margin-bottom: 30px;
}

.section-heading.compact {
    margin-bottom: 0;
}

.section-heading h2,
.landing-band h2,
.landing-cta h2 {
    margin: 8px 0 12px;
    color: var(--ks-navy);
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.08;
}

.section-heading p,
.landing-band p,
.landing-cta p {
    color: var(--ks-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.benefit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.benefit-card {
    min-height: 248px;
    padding: 22px;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.benefit-card span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(52, 176, 162, .14);
    color: #14776d;
    font-weight: 850;
    font-size: .82rem;
}

.benefit-card h3 {
    margin: 22px 0 10px;
    color: var(--ks-navy);
    font-size: 1.25rem;
}

.benefit-card p {
    margin: 0;
    color: var(--ks-muted);
    line-height: 1.62;
}

.landing-band {
    display: grid;
    grid-template-columns: minmax(260px, 520px) minmax(260px, 620px);
    gap: 32px;
    align-items: center;
    padding: clamp(42px, 6vw, 68px) clamp(18px, 7vw, 96px);
    background: #f2f7f7;
    border-top: 1px solid var(--ks-line);
    border-bottom: 1px solid var(--ks-line);
}

.split-section {
    display: grid;
    grid-template-columns: minmax(260px, 520px) minmax(280px, 1fr);
    gap: clamp(28px, 6vw, 80px);
    align-items: start;
}

.process-list {
    display: grid;
    gap: 12px;
}

.process-step {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--ks-line);
}

.process-step strong {
    color: var(--ks-navy);
    font-size: 1.08rem;
}

.process-step p {
    margin: 0;
    color: var(--ks-muted);
    line-height: 1.65;
}

.proof-section {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding-top: 0;
}

.proof-item {
    padding: 24px;
    border-left: 4px solid var(--ks-teal);
    background: #f9fbfb;
}

.proof-item strong {
    display: block;
    color: var(--ks-navy);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.proof-item span {
    color: var(--ks-muted);
    line-height: 1.55;
}

.landing-cta {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 28px;
    align-items: center;
    margin: 0 clamp(18px, 7vw, 96px) clamp(54px, 7vw, 92px);
    padding: clamp(28px, 5vw, 46px);
    border-radius: var(--radius);
    background: var(--ks-navy);
    color: #fff;
    scroll-margin-top: 96px;
}

.landing-cta img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius);
    background: #fff;
    padding: 3px;
}

.landing-cta .eyebrow,
.landing-cta h2,
.landing-cta p {
    color: #fff;
}

.landing-cta p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, .82);
}

.landing-cta .button {
    white-space: nowrap;
    background: var(--ks-mint);
    border-color: var(--ks-mint);
    color: #0b2b34;
}

.landing-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px clamp(18px, 7vw, 96px);
    border-top: 1px solid var(--ks-line);
    color: var(--ks-muted);
}

.landing-footer div {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.landing-footer .footer-contact {
    gap: 12px 18px;
}

.footer-contact a {
    color: var(--ks-navy);
    font-weight: 750;
}

.legal-page {
    background: #f8fbfb;
}

.legal-hero {
    padding: clamp(54px, 7vw, 92px) clamp(18px, 7vw, 96px) clamp(34px, 5vw, 58px);
    background: #fff;
    border-bottom: 1px solid var(--ks-line);
}

.legal-hero h1 {
    margin: 10px 0 14px;
    color: var(--ks-navy);
    font-size: clamp(2.5rem, 6vw, 5.2rem);
    line-height: .96;
}

.legal-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--ks-muted);
    font-size: 1.12rem;
    line-height: 1.7;
}

.legal-layout {
    max-width: 1120px;
    margin: 0 auto;
    padding: clamp(34px, 6vw, 74px) clamp(18px, 7vw, 96px);
}

.legal-content {
    padding: clamp(24px, 5vw, 42px);
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.legal-content h2 {
    margin: 34px 0 12px;
    color: var(--ks-navy);
    font-size: 1.45rem;
}

.legal-content h2:first-of-type {
    margin-top: 0;
}

.legal-content p,
.legal-content li {
    color: #3f4b5c;
    line-height: 1.72;
}

.legal-content ul {
    padding-left: 22px;
}

.legal-updated,
.legal-note {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: #f1f7f7;
    color: var(--ks-muted);
}

.legal-note {
    margin-top: 30px;
    border-left: 4px solid var(--ks-teal);
}

.login-body {
    display: grid;
    grid-template-columns: minmax(320px, 460px) 1fr;
    min-height: 100vh;
}

.login-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    background: #fff;
}

.login-card {
    width: min(100%, 380px);
}

.login-card img {
    width: 230px;
    max-width: 100%;
    margin-bottom: 34px;
}

.login-legal-links {
    position: absolute;
    right: 28px;
    bottom: 24px;
    left: 28px;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--ks-muted);
    font-size: .86rem;
}

.login-legal-links a {
    color: var(--ks-muted);
    font-weight: 700;
}

.login-legal-links a:hover {
    color: var(--ks-navy);
}

.login-visual {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #151b49 0%, #17415b 52%, #2d9187 100%);
    background-size: cover;
}

.login-motion-mark {
    position: absolute;
    right: 9%;
    bottom: 8%;
    width: min(52vw, 590px);
    aspect-ratio: 1.72;
    border: 9px solid rgba(255, 255, 255, .72);
    border-radius: 7px;
    transform: skewX(-9deg);
    overflow: visible;
}

.login-motion-mark span {
    position: absolute;
    bottom: var(--bottom);
    left: var(--x);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: rgba(143, 242, 223, .18);
    opacity: var(--opacity);
    transform: translateX(-50%) skewX(9deg);
}

.login-motion-mark span:nth-child(1) {
    --x: -68%;
    --size: clamp(132px, 13vw, 190px);
    --opacity: .07;
    --bottom: 15%;
}

.login-motion-mark span:nth-child(2) {
    --x: -25%;
    --size: clamp(112px, 11vw, 160px);
    --opacity: .08;
    --bottom: 15%;
}

.login-motion-mark span:nth-child(3) {
    --x: 13%;
    --size: clamp(92px, 9vw, 132px);
    --opacity: .09;
    --bottom: 15%;
}

.login-motion-mark span:nth-child(4) {
    --x: 46%;
    --size: clamp(72px, 7vw, 104px);
    --opacity: .1;
    --bottom: 15%;
}

.login-motion-mark span:nth-child(5) {
    --x: 76%;
    --size: clamp(66px, 6vw, 94px);
    --opacity: .11;
    --bottom: 15%;
}

.login-visual-copy {
    position: relative;
    z-index: 1;
    width: min(560px, 70%);
    margin: 11vh 0 0 9vw;
    color: #fff;
}

.login-visual-copy h1 {
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: .95;
    margin: 0 0 22px;
}

.login-visual-copy p {
    color: rgba(255, 255, 255, .82);
    font-size: 1.12rem;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 7px;
    color: var(--ks-muted);
    font-size: .9rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 43px;
    padding: 10px 12px;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ks-text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(52, 176, 162, .2);
    border-color: var(--ks-teal);
}

.checkbox-line {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 10px 0;
    color: var(--ks-muted);
    font-size: .95rem;
}

.checkbox-line input {
    width: 18px;
    min-height: 18px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 10px 16px;
    border: 1px solid var(--ks-navy);
    border-radius: var(--radius);
    background: var(--ks-navy);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button:hover,
button:hover {
    background: #20275b;
    color: #fff;
}

.button.ghost {
    background: #fff;
    color: var(--ks-navy);
    border-color: var(--ks-line);
}

.button.small {
    min-height: 34px;
    padding: 7px 11px;
    font-size: .9rem;
}

button.small {
    min-height: 34px;
    padding: 7px 11px;
    font-size: .9rem;
}

.icon-button {
    gap: 7px;
}

.button-eye-icon {
    width: 23px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button.full {
    width: 100%;
}

button.danger {
    background: #fff;
    color: var(--ks-danger);
    border-color: rgba(189, 51, 65, .36);
}

button.danger:hover {
    background: #fff0f2;
    color: var(--ks-danger);
}

button:disabled,
.button.disabled {
    opacity: .45;
    pointer-events: none;
    cursor: not-allowed;
}

.app-shell {
    display: grid;
    grid-template-columns: 254px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    overflow-y: auto;
    min-height: 100vh;
    max-height: 100vh;
    background: var(--ks-navy);
    color: #fff;
    padding: 20px 14px;
}

.sidebar-toggle {
    display: none;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 10px;
    color: #fff;
}

.brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #fff;
    border-radius: 7px;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: rgba(255, 255, 255, .68);
}

.sidebar-nav {
    display: grid;
    gap: 6px;
    margin-top: 28px;
}

.sidebar-nav a {
    padding: 12px 13px;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, .8);
    font-weight: 700;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    background: rgba(52, 176, 162, .18);
    color: #fff;
}

.sidebar-nav a.disabled {
    opacity: .5;
    cursor: default;
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    min-height: 92px;
    padding: 22px 30px;
    background: #fff;
    border-bottom: 1px solid var(--ks-line);
}

.topbar h1 {
    margin: 3px 0 0;
    font-size: 1.75rem;
}

.topbar-partner {
    max-width: min(760px, 58vw);
    margin: 6px 0 0;
    overflow: hidden;
    color: var(--ks-muted);
    font-size: .95rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eyebrow {
    color: var(--ks-teal);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.user-menu {
    display: flex;
    gap: 12px;
    align-items: center;
    text-align: right;
}

.user-menu small {
    display: block;
    color: var(--ks-muted);
}

.content {
    flex: 1;
    padding: 30px;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    padding: 16px 30px;
    border-top: 1px solid var(--ks-line);
    background: #ffffff;
    color: var(--ks-muted);
    font-size: .86rem;
}

.app-footer nav {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.app-footer a {
    color: var(--ks-muted);
    font-weight: 700;
}

.app-footer a:hover {
    color: var(--ks-navy);
}

.grid {
    display: grid;
    gap: 18px;
}

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

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

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

.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.partner-workspace,
.dashboard-grid {
    display: grid;
    gap: 18px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.work-action {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    min-height: 132px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(21, 27, 73, .10);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(21, 27, 73, .07);
    color: var(--ks-text);
    align-content: start;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.work-action::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ks-teal), rgba(52, 176, 162, .15));
    opacity: .82;
}

.work-action:hover,
.work-action:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(52, 176, 162, .42);
    background: #fbfefd;
    box-shadow: 0 18px 38px rgba(21, 27, 73, .11);
    text-decoration: none;
}

.work-action:focus-visible {
    outline: 3px solid rgba(52, 176, 162, .24);
    outline-offset: 3px;
}

.work-action.primary {
    border-color: rgba(52, 176, 162, .26);
    background: #fafdfe;
}

.work-action.primary::after {
    background: linear-gradient(90deg, var(--ks-navy), var(--ks-teal));
}

.work-action-icon {
    position: relative;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(52, 176, 162, .24);
    border-radius: 8px;
    background: #eff9f7;
}

.work-action-icon::before,
.work-action-icon::after {
    content: "";
    position: absolute;
}

.icon-calendar::before {
    left: 8px;
    top: 11px;
    width: 24px;
    height: 24px;
    border: 2px solid var(--ks-teal);
    border-radius: 5px;
    background:
        linear-gradient(var(--ks-teal), var(--ks-teal)) 0 7px / 100% 2px no-repeat,
        radial-gradient(circle, rgba(52, 176, 162, .78) 1.8px, transparent 2px) 6px 14px / 8px 8px repeat;
}

.icon-calendar::after {
    left: 13px;
    top: 8px;
    width: 4px;
    height: 7px;
    background: var(--ks-teal);
    border-radius: 2px;
    box-shadow: 13px 0 0 var(--ks-teal);
}

.icon-document::before {
    inset: 10px 13px 9px 12px;
    border: 2px solid var(--ks-teal);
    border-radius: 4px;
}

.icon-document::after {
    left: 17px;
    right: 17px;
    top: 21px;
    height: 2px;
    background: var(--ks-teal);
    box-shadow: 0 7px 0 rgba(52, 176, 162, .35);
}

.icon-search::before {
    width: 16px;
    height: 16px;
    left: 12px;
    top: 12px;
    border: 2px solid var(--ks-teal);
    border-radius: 50%;
}

.icon-search::after {
    width: 11px;
    height: 2px;
    left: 25px;
    top: 29px;
    background: var(--ks-teal);
    border-radius: 2px;
    transform: rotate(45deg);
}

.icon-extension::before {
    left: 12px;
    top: 10px;
    width: 21px;
    height: 25px;
    border: 2px solid var(--ks-teal);
    border-radius: 5px;
    background:
        linear-gradient(var(--ks-teal), var(--ks-teal)) 5px 8px / 11px 2px no-repeat,
        linear-gradient(rgba(52, 176, 162, .42), rgba(52, 176, 162, .42)) 5px 14px / 9px 2px no-repeat;
}

.icon-extension::after {
    left: 23px;
    top: 23px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background:
        linear-gradient(#ffffff, #ffffff) center / 8px 2px no-repeat,
        linear-gradient(#ffffff, #ffffff) center / 2px 8px no-repeat,
        var(--ks-teal);
    box-shadow: 0 0 0 3px #eff9f7;
}

.work-action-text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.work-action-label {
    color: var(--ks-teal);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.work-action strong {
    color: var(--ks-navy);
    font-size: 1.13rem;
    line-height: 1.25;
}

.work-action small {
    color: var(--ks-muted);
    font-size: .9rem;
    line-height: 1.35;
}

.card {
    background: #fff;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header,
.card-body {
    padding: 18px;
}

form.card-body {
    padding: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid var(--ks-line);
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.stat {
    padding: 18px;
}

.stat span {
    color: var(--ks-muted);
    font-size: .88rem;
    font-weight: 700;
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    color: var(--ks-navy);
}

.admin-stats-grid {
    margin-bottom: 24px;
}

.statistics-summary {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.stat.compact strong {
    font-size: 1.55rem;
}

.work-list {
    display: grid;
    gap: 10px;
}

.work-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #ffffff;
}

.work-row > div:first-child {
    display: grid;
    gap: 4px;
}

.work-row span {
    color: var(--ks-muted);
    font-size: .9rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--ks-muted);
    font-size: .82rem;
    text-transform: uppercase;
}

th a {
    color: var(--ks-muted);
}

.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(52, 176, 162, .12);
    color: #16756c;
    font-size: .8rem;
    font-weight: 800;
}

.badge.dark {
    background: rgba(21, 27, 73, .12);
    color: var(--ks-navy);
}

.badge.error {
    background: rgba(189, 51, 65, .12);
    color: var(--ks-danger);
}

.alert {
    margin: 18px 30px 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: #eef8f6;
    color: #146b63;
    border: 1px solid rgba(52, 176, 162, .22);
}

.login-card .alert {
    margin: 14px 0;
}

.alert.error {
    background: #fff0f2;
    color: var(--ks-danger);
    border-color: rgba(189, 51, 65, .25);
}

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

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

form.card-body > .actions {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--ks-line);
}

.list-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(170px, 220px) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 16px;
}

.list-toolbar.users-toolbar {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1.15fr) minmax(0, .9fr) minmax(0, .78fr) max-content;
}

.list-toolbar.activity-toolbar {
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, .72fr) minmax(0, .72fr) max-content;
}

.list-toolbar.booking-toolbar {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.12fr) minmax(0, .9fr) minmax(0, .95fr) max-content;
}

.list-toolbar.cost-estimate-toolbar {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(160px, 210px) auto;
}

.list-toolbar.cases-toolbar {
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.15fr) minmax(0, .9fr) max-content;
}

.list-toolbar.interface-toolbar {
    grid-template-columns: minmax(0, 1.8fr) minmax(0, .95fr) minmax(0, .85fr) max-content;
}

.list-toolbar.compact-toolbar {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, .9fr) minmax(0, .9fr) max-content;
}

.list-toolbar.cost-estimate-toolbar.compact-toolbar {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, .9fr) max-content;
}

.list-toolbar.cases-toolbar.compact-toolbar {
    grid-template-columns: minmax(0, 1.9fr) minmax(0, .9fr) max-content;
}

.list-toolbar .form-group {
    min-width: 0;
    margin-bottom: 0;
}

.list-toolbar-actions,
.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.list-toolbar-actions {
    min-width: max-content;
    flex-wrap: nowrap;
}

.table-actions {
    min-width: 190px;
}

.table-actions form {
    margin: 0;
}

.table-meta {
    display: flex;
    gap: 14px;
    color: var(--ks-muted);
    font-size: .9rem;
    font-weight: 700;
    flex-wrap: wrap;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-top: 18px;
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.form-card {
    width: 100%;
}

.wide-form-card {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid .wide {
    grid-column: 1 / -1;
}

.form-grid > .checkbox-line {
    margin-top: 8px;
}

form.card-body > .checkbox-line + .checkbox-line {
    margin-top: 14px;
}

form.card-body > .checkbox-line + .form-group {
    margin-top: 24px;
}

form.card-body > .detail-list {
    margin-top: 18px;
}

.form-divider {
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid var(--ks-line);
    color: var(--ks-navy);
    font-weight: 850;
}

.maintenance-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.maintenance-summary div {
    padding: 14px;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #f8fbfc;
}

.maintenance-summary span {
    display: block;
    margin-bottom: 6px;
    color: var(--ks-muted);
    font-size: .88rem;
    font-weight: 750;
}

.maintenance-summary strong {
    color: var(--ks-navy);
    font-size: 1.25rem;
}

.warning-box {
    margin-bottom: 18px;
    padding: 13px 14px;
    border: 1px solid rgba(189, 51, 65, .22);
    border-radius: var(--radius);
    background: #fff7f8;
    color: #7f2430;
    line-height: 1.55;
}

.notice-box {
    margin-bottom: 18px;
    padding: 13px 14px;
    border: 1px solid rgba(52, 176, 162, .22);
    border-radius: var(--radius);
    background: #f0faf7;
    color: #146b63;
    line-height: 1.55;
}

.choice-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.radio-line,
.checkbox-line {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    color: var(--ks-text);
    font-weight: 750;
}

.radio-line input,
.checkbox-line input {
    width: auto;
}

.booking-form-card {
    width: 100%;
}

.booking-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(320px, .75fr);
    gap: 22px;
    align-items: start;
}

.booking-partner-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(52, 176, 162, .26);
    border-radius: var(--radius);
    background: #f0faf7;
}

.booking-partner-box strong {
    color: var(--ks-navy);
}

.booking-partner-box span,
.booking-selected span,
.booking-selected small {
    color: var(--ks-muted);
}

.booking-scheduler {
    display: grid;
    grid-template-columns: minmax(320px, 440px) minmax(360px, 1fr);
    gap: 18px;
    align-items: stretch;
}

.booking-mode-toggle {
    margin-bottom: 18px;
}

.booking-calendar {
    padding: 14px;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #ffffff;
}

.booking-calendar-head,
.booking-weekdays,
.booking-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.booking-calendar-head {
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
    margin-bottom: 12px;
}

.booking-calendar-head strong {
    text-align: center;
    color: var(--ks-navy);
    font-size: 1.05rem;
}

.booking-weekdays {
    margin-bottom: 6px;
    color: var(--ks-muted);
    font-size: .78rem;
    font-weight: 850;
    text-align: center;
}

.booking-day,
.time-choice {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--ks-line);
    border-radius: 7px;
    background: #ffffff;
    color: var(--ks-text);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.time-choice {
    aspect-ratio: 1;
    min-height: 0;
    padding: 0;
}

.booking-day:hover,
.time-choice:hover {
    background: #eef8f6;
    border-color: rgba(52, 176, 162, .55);
    color: #146b63;
}

.booking-day.selected,
.time-choice.selected {
    border-color: #007ec9;
    background: #007ec9;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(0, 126, 201, .22);
}

.booking-day.selected:hover,
.time-choice.selected:hover {
    border-color: #006fb2;
    background: #006fb2;
    color: #ffffff;
}

.booking-day.today:not(.selected) {
    color: #007ec9;
    border-color: rgba(0, 126, 201, .34);
}

.booking-day:disabled,
.booking-day.muted-day {
    color: #c6ced6;
    background: #f8fafb;
    cursor: not-allowed;
}

.booking-day.weekend-day {
    color: #c6ced6;
    background: #f5f7f8;
}

.booking-day.holiday-day {
    color: #b98b1f;
    background: #fff8df;
    border-color: #f0d88a;
    cursor: help;
}

.booking-day.holiday-day:disabled {
    opacity: .85;
}

.booking-day.holiday-day::after {
    content: attr(data-holiday-name);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: 20;
    display: none;
    width: max-content;
    max-width: 220px;
    padding: 7px 9px;
    border-radius: 7px;
    background: var(--ks-navy);
    color: #ffffff;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    transform: translateX(-50%);
    box-shadow: 0 10px 24px rgba(21, 27, 73, .22);
    pointer-events: none;
}

.booking-day.holiday-day::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    z-index: 21;
    display: none;
    width: 9px;
    height: 9px;
    background: var(--ks-navy);
    transform: translateX(-50%) rotate(45deg);
    pointer-events: none;
}

.booking-day.holiday-day:hover::after,
.booking-day.holiday-day:hover::before {
    display: block;
}

.booking-time-panel {
    display: flex;
    flex-direction: column;
    padding: 14px;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #ffffff;
}

.booking-time-panel h3 {
    margin: 0 0 12px;
    color: var(--ks-navy);
    font-size: 1rem;
}

.booking-time-picker {
    display: grid;
    grid-template-columns: max-content 18px max-content;
    gap: 10px;
    align-items: center;
    justify-content: start;
    flex: 1;
}

.booking-time-grid {
    display: grid;
    grid-template-columns: repeat(2, 44px);
    gap: 6px;
}

.booking-time-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ks-muted);
    font-weight: 900;
}

.booking-minute-row {
    display: grid;
    grid-template-columns: repeat(4, 44px);
    gap: 6px;
    align-content: center;
}

.booking-side {
    padding: 16px;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #f8fbfc;
}

.booking-selected {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
    padding: 14px;
    border-radius: var(--radius);
    background: #eaf5fb;
}

.booking-selected strong {
    color: #007ec9;
    line-height: 1.35;
}

.booking-free-text-panel {
    width: 100%;
    max-width: none;
}

.booking-free-text-panel textarea {
    min-height: 210px;
}

.mode-toggle {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #ffffff;
}

.mode-toggle button {
    min-height: 34px;
    padding: 7px 14px;
    background: transparent;
    border-color: transparent;
    color: var(--ks-muted);
    box-shadow: none;
}

.mode-toggle button:hover {
    background: #eef8f6;
    color: #146b63;
}

.mode-toggle button.active {
    background: #007ec9;
    border-color: #007ec9;
    color: #ffffff;
}

.inline-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-filter label {
    margin: 0;
}

.inline-filter select {
    min-width: 120px;
}

.case-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: var(--shadow);
}

.case-hero h2 {
    margin: 14px 0 8px;
    color: var(--ks-navy);
    font-size: 1.55rem;
}

.case-hero p {
    margin: 0;
    color: var(--ks-muted);
}

.case-status-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 260px;
    padding: 16px;
    border-radius: var(--radius);
    background: #f0faf7;
}

.case-status-box strong {
    margin: 5px 0;
    color: #146b63;
    font-size: 1.15rem;
}

.case-status-box small {
    color: var(--ks-muted);
}

.case-focus-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1.1fr) minmax(300px, .9fr) minmax(260px, .75fr);
    gap: 18px;
    margin-bottom: 18px;
}

.case-primary-action {
    grid-template-columns: 46px minmax(0, 1fr) 44px;
    min-height: 100%;
    padding: 18px 16px;
    border-color: rgba(21, 27, 73, .28);
    background: #f8fbfc;
    align-content: center;
    box-shadow: var(--shadow);
}

.case-primary-action::after {
    content: ">";
    position: static;
    display: grid;
    place-items: center;
    align-self: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--ks-navy);
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    opacity: 1;
    padding-bottom: 2px;
}

.case-primary-action:hover,
.case-primary-action:focus-visible {
    border-color: rgba(21, 27, 73, .45);
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(21, 27, 73, .14);
}

.case-primary-action .work-action-icon {
    border-color: rgba(21, 27, 73, .16);
    background: #ffffff;
}

.report-card .card-body {
    display: grid;
    gap: 10px;
}

.report-card .card-body > strong {
    color: var(--ks-navy);
    font-size: 1.2rem;
}

.report-card p {
    margin: 0;
}

.key-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
}

.key-facts div {
    display: grid;
    gap: 4px;
    padding: 16px;
    border-bottom: 1px solid var(--ks-line);
}

.key-facts div:nth-child(odd) {
    border-right: 1px solid var(--ks-line);
}

.key-facts div:nth-last-child(-n+2) {
    border-bottom: 0;
}

.key-facts span {
    color: var(--ks-muted);
    font-size: .8rem;
    font-weight: 800;
}

.key-facts strong {
    color: var(--ks-text);
}

.case-detail-grid {
    align-items: start;
}

.case-section {
    margin-top: 18px;
}

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-list div {
    display: grid;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ks-line);
}

.detail-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-list span {
    color: var(--ks-muted);
    font-size: .84rem;
    font-weight: 800;
}

.detail-list strong {
    color: var(--ks-text);
}

.detail-list p {
    margin: 2px 0 0;
    color: var(--ks-muted);
    line-height: 1.5;
}

.document-list {
    display: grid;
    gap: 10px;
}

.document-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--ks-line);
    border-radius: var(--radius);
    background: #ffffff;
}

.document-row div {
    display: grid;
    gap: 4px;
}

.document-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

    .document-row span,
    .document-row small {
        color: var(--ks-muted);
    }

    .muted-document {
        background: #f8fbfc;
        opacity: .78;
    }

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

    .case-primary-action {
        grid-column: 1 / -1;
        min-height: auto;
    }
}

@media (max-width: 980px) {
    .login-body,
    .app-shell,
    .grid.cols-5,
    .grid.cols-4,
    .grid.cols-2,
    .form-grid,
    .maintenance-summary,
    .booking-layout,
    .booking-scheduler,
    .list-toolbar,
    .case-hero,
    .case-focus-grid,
    .action-grid,
    .benefit-grid,
    .landing-band,
    .split-section,
    .proof-section,
    .landing-cta {
        grid-template-columns: 1fr;
    }

    .booking-time-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .booking-minute-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .booking-time-picker {
        grid-template-columns: 1fr;
    }

    .list-toolbar,
    .list-toolbar.users-toolbar,
    .list-toolbar.activity-toolbar,
    .list-toolbar.booking-toolbar,
    .list-toolbar.cost-estimate-toolbar,
    .list-toolbar.cases-toolbar,
    .list-toolbar.interface-toolbar,
    .list-toolbar.compact-toolbar,
    .list-toolbar.cost-estimate-toolbar.compact-toolbar,
    .list-toolbar.cases-toolbar.compact-toolbar {
        grid-template-columns: 1fr;
    }

    .list-toolbar-actions {
        min-width: 0;
        flex-wrap: wrap;
    }

    .list-toolbar-actions .button,
    .list-toolbar-actions button {
        flex: 1 1 150px;
    }

    .booking-time-separator {
        display: none;
    }

    .landing-nav {
        position: static;
        align-items: flex-start;
        flex-direction: column;
    }

    .landing-nav nav {
        gap: 12px;
    }

    .landing-hero {
        min-height: 82vh;
        background-position: 68% center;
    }

    .process-step {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .landing-cta {
        margin-left: 18px;
        margin-right: 18px;
    }

    .landing-footer,
    .landing-footer div {
        flex-direction: column;
    }

    .login-visual {
        display: none;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 12px;
        align-items: center;
        max-height: none;
        min-height: auto;
        overflow: visible;
        padding: 10px 14px;
    }

    .brand {
        min-height: 48px;
        padding: 4px 0;
    }

    .brand img {
        width: 38px;
        height: 38px;
    }

    .sidebar-toggle {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, .08);
        color: #ffffff;
        cursor: pointer;
    }

    .sidebar-toggle span {
        position: absolute;
        left: 11px;
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform .16s ease, opacity .16s ease;
    }

    .sidebar-toggle span:nth-child(1) {
        transform: translateY(-6px);
    }

    .sidebar-toggle span:nth-child(3) {
        transform: translateY(6px);
    }

    .sidebar.nav-open .sidebar-toggle span:nth-child(1) {
        transform: rotate(45deg);
    }

    .sidebar.nav-open .sidebar-toggle span:nth-child(2) {
        opacity: 0;
    }

    .sidebar.nav-open .sidebar-toggle span:nth-child(3) {
        transform: rotate(-45deg);
    }

    .sidebar-nav {
        grid-column: 1 / -1;
        display: none;
        margin-top: 4px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, .12);
    }

    .sidebar.nav-open .sidebar-nav {
        display: grid;
    }

    .main {
        min-height: auto;
    }

    .topbar,
    .user-menu {
        align-items: flex-start;
        flex-direction: column;
        text-align: left;
    }

    .topbar-partner {
        max-width: 100%;
    }

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

    .case-status-box {
        min-width: 0;
    }

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

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

    .work-action {
        min-height: auto;
        padding: 16px;
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .case-primary-action {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
    }

    .work-action-icon {
        width: 44px;
        height: 44px;
    }

    .document-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .key-facts {
        grid-template-columns: 1fr;
    }

    .key-facts div,
    .key-facts div:nth-child(odd),
    .key-facts div:nth-last-child(-n+2) {
        border-right: 0;
        border-bottom: 1px solid var(--ks-line);
    }

    .key-facts div:last-child {
        border-bottom: 0;
    }
}

.inline-details {
    margin-top: 8px;
    max-width: 520px;
}

.inline-details summary {
    color: var(--ks-teal);
    cursor: pointer;
    font-weight: 700;
}

.inline-details p {
    margin: 8px 0 0;
    padding: 10px 12px;
    border-left: 3px solid var(--ks-teal);
    background: #f8fbfb;
    border-radius: 6px;
    color: var(--ks-text);
    white-space: normal;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
