:root {
    --shell-bg: #edf4fb;
    --panel: #ffffff;
    --brand-blue: #006ebd;
    --brand-blue-deep: #003366;
    --brand-blue-dark: #005aa3;
    --brand-orange: #ff6600;
    --text: #20313f;
    --muted: #5f7286;
    --border: #d6e1ec;
    --success: #21875a;
    --header-height: 72px;
    --footer-height: 57px;
    --nav-width: 240px;
    --nav-collapsed-width: 76px;
    --shadow: 0 14px 34px rgba(38, 73, 104, 0.1);
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--shell-bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
    font: inherit;
}

a {
    color: var(--brand-blue);
}

.app-shell {
    min-height: 100vh;
}

.app-header {
    position: fixed;
    z-index: 1030;
    top: 0;
    right: 0;
    left: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px 0 20px;
    border-bottom: 1px solid rgba(0, 51, 102, 0.12);
    background: #fff;
    box-shadow: 0 2px 12px rgba(34, 68, 99, 0.07);
}

.app-header__brand,
.brand-link,
.app-header__tools {
    display: flex;
    align-items: center;
}

.app-header__tools {
    min-width: 0;
    gap: 20px;
}

.menu-toggle {
    width: 42px;
    height: 42px;
    margin-right: 15px;
    padding: 10px;
    border: 1px solid rgba(0, 90, 163, 0.12);
    border-radius: 8px;
    background: #f7fbff;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
    background: #edf5fc;
    outline: none;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 4px 0;
    border-radius: 2px;
    background: var(--brand-blue-deep);
}

.brand-link {
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: auto;
    height: 42px;
    max-width: min(240px, 42vw);
    object-fit: contain;
}

.brand-divider {
    width: 1px;
    height: 31px;
    margin: 0 15px;
    background: var(--border);
}

.brand-app-name {
    color: var(--brand-blue-deep);
    font-size: 1.1rem;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.account-menu {
    display: grid;
    grid-template-columns: 38px minmax(0, auto) auto;
    align-items: center;
    gap: 10px;
    max-width: min(510px, 48vw);
    padding: 5px 6px 5px 5px;
    border: 1px solid rgba(0, 110, 189, 0.14);
    border-radius: 999px;
    background: linear-gradient(135deg, #fff, #eef6ff);
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.08);
}

.account-menu__avatar {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.account-menu__identity {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}

.account-menu__identity span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.account-menu__identity strong {
    max-width: 26ch;
    overflow: hidden;
    color: var(--brand-blue-deep);
    font-size: 0.86rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu__action,
.account-menu__sign-in {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: 1px solid rgba(255, 102, 0, 0.12);
    border-radius: 999px;
    color: #b74800;
    background: rgba(255, 102, 0, 0.09);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
    transition: color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.account-menu__sign-in {
    border-color: rgba(0, 110, 189, 0.14);
    color: var(--brand-blue-deep);
    background: linear-gradient(135deg, #fff, #eef6ff);
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.08);
}

.account-menu__action:hover,
.account-menu__action:focus-visible,
.account-menu__sign-in:hover,
.account-menu__sign-in:focus-visible {
    color: #fff;
    background: var(--brand-orange);
    outline: none;
    transform: translateY(-1px);
}

.app-navigation {
    position: fixed;
    z-index: 1020;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    width: var(--nav-width);
    overflow: hidden;
    color: #fff;
    background: linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-blue-dark) 68%, #004b88 100%);
    box-shadow: 8px 0 24px rgba(0, 65, 118, 0.13);
    transition: width 180ms ease, transform 180ms ease;
}

.app-navigation__inner {
    padding-top: 32px;
}

.app-navigation__label {
    display: block;
    margin: 0 24px 10px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-navigation .nav-link {
    position: relative;
    display: flex;
    min-height: 50px;
    align-items: center;
    padding: 12px 24px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.96rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: color 150ms ease, background 150ms ease;
}

.app-navigation .nav-link:hover,
.app-navigation .nav-link:focus-visible,
.app-navigation .nav-link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

.app-navigation .nav-link.is-active::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 7px;
    background: var(--brand-orange);
    content: "";
}

.app-navigation .nav-link svg {
    width: 22px;
    min-width: 22px;
    height: 22px;
    margin-right: 14px;
    fill: currentColor;
}

.app-navigation__footer {
    position: absolute;
    right: 24px;
    bottom: 78px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.78rem;
    white-space: nowrap;
}

.app-navigation__footer svg {
    width: 21px;
    min-width: 21px;
    height: 21px;
    fill: currentColor;
}

.app-content {
    display: flex;
    min-height: calc(100vh - var(--footer-height));
    margin-left: var(--nav-width);
    padding: calc(var(--header-height) + 28px) clamp(20px, 2vw, 34px) calc(var(--footer-height) + 28px);
    transition: margin-left 180ms ease;
}

.app-footer {
    position: fixed;
    z-index: 1010;
    right: 0;
    bottom: 0;
    left: var(--nav-width);
    height: var(--footer-height);
    display: flex;
    align-items: center;
    padding: 0 28px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.96);
    font-size: 0.8rem;
    transition: left 180ms ease;
}

.app-footer__separator {
    width: 3px;
    height: 3px;
    margin: 0 10px;
    border-radius: 50%;
    background: #9aabba;
}

.navigation-backdrop {
    display: none;
}

body.menu-collapsed .app-navigation {
    width: var(--nav-collapsed-width);
}

body.menu-collapsed .app-navigation__label {
    display: none;
}

body.menu-collapsed .app-navigation .nav-link {
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
}

body.menu-collapsed .app-navigation .nav-link svg {
    margin-right: 0;
}

body.menu-collapsed .app-navigation__footer {
    right: 0;
    left: 0;
    justify-content: center;
}

body.menu-collapsed .app-navigation__footer span,
body.menu-collapsed .app-navigation .nav-link span {
    display: none;
}

body.menu-collapsed .app-content {
    margin-left: var(--nav-collapsed-width);
}

body.menu-collapsed .app-footer {
    left: var(--nav-collapsed-width);
}

.public-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 82% 16%, rgba(0, 110, 189, 0.12), transparent 28rem),
        linear-gradient(145deg, #f7fbff 0%, #e9f2fa 100%);
}

.public-header {
    display: flex;
    min-height: 92px;
    align-items: center;
    padding: 16px 30px;
    border-bottom: 1px solid rgba(0, 51, 102, 0.1);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 2px 12px rgba(34, 68, 99, 0.06);
}

.public-header__brand {
    display: flex;
    align-items: center;
    color: var(--brand-blue-deep);
    text-decoration: none;
}

.public-header__logo {
    display: block;
    width: auto;
    height: 54px;
    max-width: min(260px, 48vw);
    object-fit: contain;
}

.public-header__divider {
    width: 1px;
    height: 38px;
    margin: 0 18px;
    background: var(--border);
}

.public-header__title {
    font-size: 1.15rem;
    font-weight: 700;
}

.public-main {
    display: grid;
    min-height: calc(100vh - 92px);
    padding: 36px 24px;
    place-items: center;
}

.sign-in-hero {
    display: grid;
    width: 100%;
    place-items: center;
}

.sign-in-card {
    position: relative;
    width: min(620px, 100%);
    overflow: hidden;
    padding: 48px 44px 40px;
    border: 1px solid rgba(0, 90, 163, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 60px rgba(31, 70, 105, 0.14);
    text-align: center;
}

.sign-in-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-orange));
    content: "";
}

.sign-in-card__icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 20px;
    place-items: center;
    border-radius: 15px;
    color: var(--brand-blue);
    background: #e8f3fc;
}

.sign-in-card__icon svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.sign-in-card__eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--brand-blue);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.sign-in-card__title {
    margin: 0;
    color: var(--brand-blue-deep);
    font-size: clamp(1.85rem, 4vw, 2.55rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sign-in-card__subtitle {
    max-width: 490px;
    margin: 14px auto 26px;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.65;
}

.sign-in-card__actions {
    display: flex;
    justify-content: center;
}

.sign-in-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 20px;
    border: 1px solid var(--brand-blue);
    border-radius: 8px;
    color: #fff;
    background: var(--brand-blue);
    box-shadow: 0 9px 20px rgba(0, 110, 189, 0.2);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.sign-in-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.sign-in-button:hover,
.sign-in-button:focus-visible {
    border-color: var(--brand-blue-dark);
    color: #fff;
    background: var(--brand-blue-dark);
    outline: none;
    transform: translateY(-1px);
}

.sign-in-card__notice {
    margin: 24px 0 0;
    color: #7a8b9a;
    font-size: 0.76rem;
}

.page-card {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 90, 163, 0.1);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.solar-page {
    display: flex;
    min-height: calc(100vh - var(--header-height) - var(--footer-height) - 56px);
    flex-direction: column;
}

.solar-page .application-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.solar-page #solar-applications-grid {
    min-height: 475px;
    flex: 1 1 auto;
}

.page-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 23px 32px 22px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #fff 0%, #f7fbff 100%);
}

.application-count-card {
    display: grid;
    min-width: 196px;
    padding: 15px 20px;
    place-items: center;
    border-radius: 9px;
    color: var(--brand-blue-deep);
    background: #edf5fc;
    text-align: center;
}

.application-count-card span {
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.application-count-card strong {
    margin-top: 2px;
    font-size: 2rem;
    line-height: 1.05;
}

.section-heading__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--brand-blue);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.page-card__title {
    margin: 0;
    color: var(--brand-blue-deep);
    font-size: clamp(1.65rem, 2.2vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.page-card__subtitle {
    max-width: 780px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.55;
}

.search-panel,
.application-panel,
.document-panel {
    padding: 27px 32px 30px;
}

.search-panel,
.application-panel {
    border-bottom: 1px solid var(--border);
}

.search-panel {
    background: #fbfdff;
}

.solar-page .search-panel {
    padding-bottom: 20px;
}

.solar-page .application-panel {
    padding-top: 10px;
}

.application-grid-meta {
    display: flex;
    min-height: 24px;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 21px;
}

.section-heading h2 {
    margin: 0;
    color: var(--brand-blue-deep);
    font-size: 1.22rem;
    font-weight: 700;
}

.section-heading p {
    max-width: 570px;
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: right;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto auto;
    column-gap: 18px;
    row-gap: 13px;
    align-items: end;
}

.search-panel__heading {
    margin-bottom: 16px;
}

.field-group--search {
    grid-column: 1;
    grid-row: 1;
}

.field-group {
    min-width: 0;
}

.field-group label {
    display: block;
    margin-bottom: 7px;
    color: #41586c;
    font-size: 0.77rem;
    font-weight: 700;
}

.field-group .k-input,
.field-group .k-picker {
    width: 100%;
}

.archive-options {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 0;
    border: 0;
}

.archive-options legend,
.document-filter label {
    display: block;
    width: 100%;
    margin: 0 0 7px;
    color: #41586c;
    font-size: 0.77rem;
    font-weight: 700;
}

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

.archive-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #41586c;
    font-size: 0.8rem;
    white-space: nowrap;
}

.archive-option label {
    cursor: pointer;
}

.search-actions {
    display: flex;
    grid-column: 3;
    grid-row: 1;
    gap: 9px;
}

.search-actions .k-button {
    min-height: 40px;
    white-space: nowrap;
}

.section-heading--documents,
.section-heading--grid {
    align-items: center;
}

.result-count {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 6px;
    color: #486175;
    background: #edf3f8;
    font-size: 0.76rem;
    font-weight: 700;
}

.archive-message {
    margin-top: 17px;
    padding: 11px 13px;
    border: 1px solid #efc6c3;
    border-radius: 7px;
    color: #8f2923;
    background: #fff5f4;
    font-size: 0.82rem;
}

.application-panel .k-grid,
.document-panel .k-grid {
    overflow: hidden;
    border-color: var(--border);
    border-radius: 9px;
}

.application-panel .k-grid-header,
.document-panel .k-grid-header {
    border-color: var(--border);
    background: #edf5fc;
}

.application-panel .k-grid-header .k-table-th,
.document-panel .k-grid-header .k-table-th {
    color: var(--brand-blue-deep);
    font-size: 0.78rem;
    font-weight: 700;
}

.application-panel .k-grid-content,
.document-panel .k-grid-content {
    background: #fff;
}

.application-panel .k-pager,
.document-panel .k-pager {
    border-color: var(--border);
    background: #f8fbfe;
}

.application-panel .k-table-row {
    cursor: pointer;
}

.application-panel .k-table-row.k-selected,
.application-panel .k-table-row.k-selected:hover {
    color: var(--text);
    background: #dceefb;
}

.application-open-link {
    margin: -4px -3px;
    padding: 4px 3px;
    border: 0;
    color: var(--brand-blue-dark);
    background: transparent;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.application-open-link:hover,
.application-open-link:focus-visible {
    color: var(--brand-blue);
    outline: none;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.document-total-cell {
    color: var(--brand-blue-deep);
    font-weight: 700;
    text-align: right;
}

.document-panel__tools {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 12px;
}

.document-filter {
    width: min(290px, 40vw);
}

.document-filter .k-picker {
    width: 100%;
}

.selected-application {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 15px;
    padding: 14px 16px;
    border: 1px solid #cbdfea;
    border-left: 4px solid var(--brand-blue);
    border-radius: 8px;
    background: #f7fbfe;
}

.selected-application[hidden] {
    display: none;
}

.selected-application__label {
    display: block;
    margin-bottom: 3px;
    color: var(--brand-blue);
    font-size: 0.67rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.selected-application strong {
    color: var(--brand-blue-deep);
    font-size: 0.94rem;
}

.selected-application__details {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px 16px;
    color: var(--muted);
    font-size: 0.78rem;
}

.archive-status {
    display: inline-flex;
    max-width: 100%;
    padding: 4px 7px;
    overflow: hidden;
    border-radius: 999px;
    color: #36546b;
    background: #eaf1f6;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archive-status--matched {
    color: #176c47;
    background: #e6f5ee;
}

.archive-status--attention {
    color: #944300;
    background: #fff0e2;
}

.archive-status--missing {
    color: #9b2c2c;
    background: #fdeaea;
}

.document-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.document-actions--unavailable {
    min-height: 28px;
    justify-content: center;
    color: var(--muted);
}

.document-action {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border: 1px solid #9cb8ce;
    border-radius: 5px;
    color: var(--brand-blue-dark);
    background: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
}

.document-action:hover,
.document-action:focus-visible {
    border-color: var(--brand-blue-dark);
    color: var(--brand-blue-dark);
    background: #edf6fc;
}

.document-action--primary,
.document-action--primary:hover,
.document-action--primary:focus-visible {
    border-color: var(--brand-blue);
    color: #fff;
    background: var(--brand-blue);
}

.document-action.is-loading {
    pointer-events: none;
    opacity: 0.72;
}

.grid-empty {
    min-height: 285px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    flex-direction: column;
    color: var(--muted);
    text-align: center;
}

.grid-empty__icon {
    position: relative;
    width: 58px;
    height: 68px;
    margin-bottom: 17px;
    border: 2px solid #9bb6cd;
    border-radius: 6px;
    background: #f4f9fd;
}

.grid-empty__icon::before {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid #9bb6cd;
    border-left: 2px solid #9bb6cd;
    background: #fff;
    content: "";
}

.grid-empty__icon::after {
    position: absolute;
    right: 12px;
    bottom: 15px;
    left: 12px;
    height: 2px;
    background: #bdd0df;
    box-shadow: 0 -9px 0 #bdd0df;
    content: "";
}

.grid-empty strong {
    margin-bottom: 5px;
    color: var(--text);
    font-size: 0.94rem;
}

.grid-empty span:not(.grid-empty__icon) {
    max-width: 530px;
    font-size: 0.82rem;
}

.grid-empty--applications {
    min-height: 300px;
}

.k-button-solid-primary {
    border-color: var(--brand-blue);
    background-color: var(--brand-blue);
}

.k-button-solid-primary:hover,
.k-button-solid-primary:focus {
    border-color: var(--brand-blue-dark);
    background-color: var(--brand-blue-dark);
}

.k-input:focus-within,
.k-picker:focus-within,
.k-focus {
    box-shadow: 0 0 0 0.18rem rgba(0, 110, 189, 0.16);
}

.application-detail-window {
    display: flex;
    min-height: 0;
    padding: 0 !important;
    flex-direction: column;
    overflow: hidden !important;
    background: #f5f8fb;
}

.application-detail-shell {
    overflow: hidden;
    border-color: rgba(0, 90, 163, 0.2);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(24, 58, 87, 0.22);
}

.application-detail-shell > .k-window-titlebar {
    position: relative;
    min-height: 56px;
    padding: 0 18px 0 24px;
    border-bottom: 1px solid var(--border);
    color: var(--brand-blue-deep);
    background: linear-gradient(90deg, #edf6fd 0%, #f8fbfe 52%, #fff 100%);
}

.application-detail-shell > .k-window-titlebar::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--brand-blue), var(--brand-orange));
    content: "";
}

.application-detail-shell .k-window-title {
    color: var(--brand-blue-deep);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.application-detail-shell .k-window-actions .k-button {
    border-radius: 50%;
    color: var(--brand-blue-deep);
}

.application-detail-shell .k-window-actions .k-button:hover,
.application-detail-shell .k-window-actions .k-button:focus-visible {
    color: #fff;
    background: var(--brand-blue);
}

.detail-summary {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.detail-summary h2 {
    margin: 0;
    color: var(--brand-blue-deep);
    font-size: 1.25rem;
    font-weight: 700;
}

.detail-summary__meta {
    display: flex;
    max-width: 62%;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: right;
}

.detail-tabs {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    border: 0;
}

.detail-tabs > .k-tabstrip-items-wrapper {
    flex: 0 0 auto;
    padding: 0 12px;
    background: #fff;
}

.detail-tabs > .k-content,
.detail-tabs > .k-tabstrip-content {
    min-height: 0;
    padding: 20px;
    flex: 1 1 auto;
    overflow: auto;
    border: 0;
    background: #f5f8fb;
}

.detail-loading,
.detail-notice {
    padding: 14px 16px;
    border: 1px solid #cbdfea;
    border-radius: 8px;
    color: #49677e;
    background: #f7fbfe;
    font-size: 0.84rem;
}

.detail-loading {
    min-height: 180px;
    display: grid;
    place-items: center;
}

.detail-notice {
    margin-bottom: 14px;
    border-color: #f0d6bd;
    color: #8b4c16;
    background: #fff8f1;
}

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

.detail-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(25, 70, 103, 0.05);
}

.detail-card--wide {
    grid-column: 1 / -1;
}

.detail-card--standalone {
    min-height: 180px;
}

.detail-card h3 {
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2ebf2;
    color: var(--brand-blue-deep);
    font-size: 0.98rem;
    font-weight: 700;
}

.detail-fields {
    display: grid;
    grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
    gap: 9px 15px;
    margin: 0;
}

.detail-fields--columns {
    grid-template-columns: minmax(120px, 0.35fr) minmax(160px, 1fr) minmax(120px, 0.35fr) minmax(160px, 1fr);
}

.detail-fields dt {
    color: #687d8f;
    font-size: 0.75rem;
    font-weight: 650;
}

.detail-fields dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 0.82rem;
}

.availability-list {
    display: grid;
    gap: 8px;
}

.availability-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 31px;
    color: #4d6578;
    font-size: 0.78rem;
}

.availability-item__marker {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a9b7c2;
}

.availability-item--available .availability-item__marker {
    background: #24865d;
    box-shadow: 0 0 0 3px #e6f5ee;
}

.availability-item--unavailable .availability-item__marker {
    background: #c16a20;
    box-shadow: 0 0 0 3px #fff0e2;
}

.availability-item strong {
    color: inherit;
    font-size: 0.72rem;
}

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

.workflow-item {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #e0e9f0;
    border-radius: 7px;
    background: #f9fbfd;
}

.workflow-item--wide {
    grid-column: 1 / -1;
}

.workflow-item__label {
    display: block;
    margin-bottom: 4px;
    color: #687d8f;
    font-size: 0.7rem;
    font-weight: 650;
}

.workflow-item strong {
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.detail-document-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.docusign-document-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 13px 15px;
    border: 1px solid #cbdfea;
    border-radius: 8px;
    background: #f5f9fc;
}

.docusign-document-action[hidden] {
    display: none;
}

.docusign-document-action strong,
.docusign-document-action span {
    display: block;
}

.docusign-document-action strong {
    color: var(--brand-blue-deep);
}

.docusign-document-action span {
    margin-top: 2px;
    color: #587086;
    font-size: 0.84rem;
}

.docusign-document-action .document-action {
    flex: 0 0 auto;
}

.detail-document-toolbar .document-filter {
    width: min(300px, 55%);
}

.detail-tabs .k-grid {
    overflow: hidden;
    border-color: var(--border);
    border-radius: 8px;
}

.detail-tabs .k-grid-header {
    background: #edf5fc;
}

.detail-tabs .k-grid-header .k-table-th {
    color: var(--brand-blue-deep);
    font-size: 0.77rem;
    font-weight: 700;
}

.application-packet-content {
    overflow: hidden !important;
}

.application-packet-panel {
    display: flex;
    min-height: 480px;
    height: 100%;
    flex-direction: column;
    gap: 10px;
}

.application-packet-status {
    flex: 0 0 auto;
    color: #587086;
    font-size: 0.8rem;
}

.application-packet-status--error {
    color: #a13e35;
}

.application-packet-viewer {
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.note-text {
    padding: 3px 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.detail-empty {
    display: flex;
    min-height: 230px;
    align-items: center;
    justify-content: center;
    padding: 28px;
    flex-direction: column;
    color: var(--muted);
    text-align: center;
}

.detail-empty strong {
    margin-bottom: 5px;
    color: var(--text);
    font-size: 0.92rem;
}

.detail-empty span {
    font-size: 0.8rem;
}

.note-date-cell {
    white-space: nowrap;
}

.access-denied {
    display: grid;
    min-height: calc(100vh - var(--header-height) - var(--footer-height) - 56px);
    place-items: center;
}

.access-denied__card {
    width: min(620px, 100%);
    padding: 42px;
    border: 1px solid rgba(0, 90, 163, 0.12);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
    text-align: center;
}

.access-denied__eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--brand-blue);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.access-denied__card h1 {
    margin: 0;
    color: var(--brand-blue-deep);
    font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.access-denied__card p {
    margin: 12px auto 24px;
    color: var(--muted);
    line-height: 1.6;
}

@media (max-width: 1100px) {
    .search-form {
        grid-template-columns: minmax(320px, 1fr) auto;
    }

    .archive-options {
        grid-column: 1;
        grid-row: 2;
    }

    .search-actions {
        grid-column: 2;
    }
}

@media (max-width: 767px) {
    :root {
        --header-height: 64px;
    }

    .app-header {
        padding: 0 16px 0 10px;
    }

    .menu-toggle {
        margin-right: 8px;
    }

    .brand-logo {
        width: auto;
        height: 38px;
    }

    .brand-divider {
        height: 27px;
        margin: 0 10px;
    }

    .brand-app-name {
        font-size: 0.95rem;
    }

    .account-menu {
        grid-template-columns: 34px auto;
        max-width: none;
        gap: 6px;
        padding: 4px;
    }

    .account-menu__avatar {
        width: 34px;
        height: 34px;
    }

    .account-menu__identity {
        display: none;
    }

    .account-menu__action,
    .account-menu__sign-in {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 0.76rem;
    }

    .app-navigation {
        width: min(280px, 84vw);
        transform: translateX(-105%);
    }

    body.menu-open .app-navigation {
        transform: translateX(0);
    }

    .navigation-backdrop {
        position: fixed;
        z-index: 1015;
        inset: var(--header-height) 0 0;
        display: block;
        visibility: hidden;
        border: 0;
        opacity: 0;
        background: rgba(12, 35, 56, 0.42);
        transition: opacity 180ms ease, visibility 180ms ease;
    }

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

    .app-content,
    body.menu-collapsed .app-content {
        margin-left: 0;
        padding: calc(var(--header-height) + 16px) 12px calc(var(--footer-height) + 16px);
    }

    .app-footer,
    body.menu-collapsed .app-footer {
        left: 0;
        padding: 0 16px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-card__header,
    .search-panel,
    .application-panel,
    .document-panel {
        padding-right: 20px;
        padding-left: 20px;
    }

    .page-card__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
    }

    .application-count-card {
        min-width: 0;
        width: 100%;
        grid-template-columns: 1fr auto;
        place-items: center start;
        text-align: left;
    }

    .application-count-card strong {
        margin-top: 0;
        font-size: 1.45rem;
    }

    .section-heading p {
        text-align: left;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .field-group--search,
    .search-actions {
        grid-column: 1;
        grid-row: auto;
        flex-wrap: wrap;
    }

    .archive-options {
        grid-column: 1;
        grid-row: auto;
        flex-wrap: wrap;
    }

    .document-panel__tools,
    .selected-application {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }

    .document-filter {
        width: 100%;
    }

    .selected-application__details {
        justify-content: flex-start;
    }

    .detail-summary {
        align-items: flex-start;
        padding: 14px 16px;
        flex-direction: column;
        gap: 9px;
    }

    .detail-summary__meta {
        max-width: none;
        justify-content: flex-start;
        text-align: left;
    }

    .detail-tabs > .k-content,
    .detail-tabs > .k-tabstrip-content {
        padding: 12px;
    }

    .detail-card-grid,
    .workflow-grid {
        grid-template-columns: 1fr;
    }

    .detail-card--wide,
    .workflow-item--wide {
        grid-column: auto;
    }

    .detail-fields,
    .detail-fields--columns {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .detail-fields dd {
        margin-bottom: 9px;
    }

    .detail-document-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

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

    .detail-document-toolbar .document-filter {
        width: 100%;
    }

    .access-denied__card {
        padding: 32px 22px;
    }

    .public-header {
        min-height: 76px;
        padding: 12px 16px;
    }

    .public-header__logo {
        height: 44px;
    }

    .public-header__divider {
        height: 30px;
        margin: 0 11px;
    }

    .public-header__title {
        max-width: 150px;
        font-size: 0.88rem;
        line-height: 1.15;
    }

    .public-main {
        min-height: calc(100vh - 76px);
        padding: 20px 14px;
    }

    .sign-in-card {
        padding: 38px 22px 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
