/* Shared Red Tape page layout, adapted from the NPDO global header, app nav, and footer patterns. */
.redtape-site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--rt-page);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1200;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(219, 228, 238, 0.9);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.site-header__accent {
    height: 6px;
    width: 100%;
    background: linear-gradient(90deg, #072f63 0%, #063d75 22%, #b42318 52%, #ff8a2a 100%);
}

.site-header__inner {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(240px, 1fr) minmax(170px, 280px);
    align-items: center;
    gap: clamp(14px, 2.5vw, 40px);
    min-height: 76px;
    width: min(1920px, 100%);
    margin: 0 auto;
    padding: 10px clamp(18px, 3.4vw, 64px);
}

.site-header__brand-wrap,
.site-header__title-block,
.site-header__account {
    min-width: 0;
}

.site-header__brand-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
}

.site-header__logo {
    width: min(160px, 100%);
    height: auto;
    max-height: 58px;
    object-fit: contain;
}

.site-header__title-block {
    text-align: center;
    line-height: 1.08;
}

.site-header__title {
    margin: 0;
    color: #7b2c37;
    background: linear-gradient(90deg, #58314a 0%, #7b2c37 28%, #9d2725 58%, #c1351b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: clamp(1.25rem, 1.8vw, 1.85rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.site-header__subtitle {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-header__account {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    color: #07366c;
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
}

.site-header__user {
    max-width: 150px;
    overflow: hidden;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-header__divider {
    width: 2px;
    height: 28px;
    border-radius: 999px;
    background: #d8dee8;
}

.site-header__profile-link,
.site-header__logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 12px;
    line-height: 1;
    text-decoration: none;
    transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.site-header__profile-link {
    padding: 0 4px;
    color: #07366c;
}

.site-header__profile-link:hover {
    color: #b42318;
}

.site-header__logout {
    min-width: 96px;
    padding: 0 18px;
    color: #ffffff;
    background: linear-gradient(135deg, #b42318, #8f1d15);
    box-shadow: 0 10px 22px rgba(180, 35, 24, 0.22);
}

.site-header__logout:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #a22117, #7a1c14);
    box-shadow: 0 12px 26px rgba(180, 35, 24, 0.28);
    transform: translateY(-1px);
}

.site-nav-shell {
    position: sticky;
    top: 82px;
    z-index: 1100;
    background: rgba(248, 250, 252, 0.94);
    border-bottom: 1px solid #dbe4ee;
    padding: 10px 16px;
    backdrop-filter: blur(10px);
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: min(1400px, 100%);
    margin: 0 auto;
}

.site-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #dbe4ee;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.site-nav__link:hover {
    border-color: rgba(180, 35, 24, 0.38);
    color: #07366c;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.site-nav__link.is-active {
    background: #07366c;
    border-color: #07366c;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(7, 54, 108, 0.18);
}

.site-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    flex: 0 0 auto;
}

.site-main {
    flex: 1 0 auto;
    min-height: 0;
}

.site-footer {
    width: 100%;
    flex-shrink: 0;
    margin-top: 18px;
    background: #ffffff;
    border-top: 1px solid rgba(219, 228, 238, 0.95);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.04);
    color: #334155;
    overflow: hidden;
}

.site-footer__wrap {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr) minmax(260px, 0.95fr);
    align-items: start;
    gap: clamp(18px, 3vw, 44px);
    width: min(1920px, 100%);
    margin: 0 auto;
    padding: 18px clamp(18px, 3.4vw, 64px) 16px;
}

.site-footer__brand,
.site-footer__resources,
.site-footer__contact {
    min-width: 0;
}

.site-footer__logo-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    text-decoration: none;
}

.site-footer__logo {
    width: min(150px, 100%);
    max-height: 60px;
    height: auto;
    object-fit: contain;
}

.site-footer__description {
    max-width: 500px;
    margin: 10px 0 12px;
    color: #334155;
    font-size: 0.88rem;
    line-height: 1.5;
}

.site-footer__social {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.site-footer__social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dbe4ee;
    border-radius: 999px;
    background: #f8fafc;
    color: #07366c;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.site-footer__social-link:hover {
    border-color: rgba(180, 35, 24, 0.35);
    background: #ffffff;
    color: #b42318;
    transform: translateY(-1px);
}

.site-footer__social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 0.78rem;
    font-weight: 900;
}

.site-footer__title {
    margin: 0 0 10px;
    color: #07366c;
    font-size: 0.95rem;
    font-weight: 800;
}

.site-footer__links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 0;
    margin: 0;
    padding: 0;
    font-size: 0.86rem;
    font-weight: 700;
}

.site-footer__links li { display: inline-flex; align-items: center; }
.site-footer__links li:not(:last-child)::after {
    content: '';
    width: 1px;
    height: 16px;
    margin: 0 10px;
    background: #cbd5e1;
}

.site-footer__links a,
.site-footer__contact a {
    color: inherit;
    text-decoration: none;
}

.site-footer__links a:hover,
.site-footer__contact a:hover {
    color: #b42318;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-footer__contact-list {
    display: grid;
    gap: 10px;
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
}

.site-footer__contact-list dt {
    margin: 0 0 2px;
    color: #07366c;
    font-weight: 800;
}

.site-footer__contact-list dd { margin: 0; }

.site-footer__copyright {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: linear-gradient(90deg, #072f63 0%, #063d75 26%, #b42318 62%, #ff8a2a 100%);
    color: #ffffff;
    text-align: center;
}

.site-footer__copyright p {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
}

@media (max-width: 1100px) {
    .site-footer__wrap { grid-template-columns: 1fr 1fr; }
    .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    :root {
        --rt-header-height: 170px;
        --rt-nav-height: 58px;
        --rt-sticky-offset: 228px;
    }

    .site-header__inner {
        min-height: 112px;
        grid-template-columns: 1fr;
        gap: 8px;
        justify-items: center;
        padding: 10px 16px 12px;
    }

    .site-header__brand-wrap,
    .site-header__account { justify-content: center; }
    .site-header__logo { max-height: 42px; }
    .site-header__title { font-size: 1.25rem; }
    .site-header__subtitle { display: none; }
    .site-nav-shell { top: 170px; }
    .site-nav { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
    .site-nav__link { flex: 0 0 auto; }
}

@media (max-width: 560px) {
    .site-header__title { font-size: 1.05rem; }
    .site-header__profile-link,
    .site-header__divider { display: none; }
    .site-footer__wrap { grid-template-columns: 1fr; padding: 22px 18px 18px; gap: 22px; }
    .site-footer__links { display: grid; gap: 10px; }
    .site-footer__links li:not(:last-child)::after { display: none; }
}

.site-header__logout-form {
    display: inline-flex;
    margin: 0;
}

.site-header__logout-form .site-header__logout {
    font: inherit;
    cursor: pointer;
    border: 0;
}

/* Sticky hierarchy: global header first, main app navigation second. */
.site-header {
    top: 0;
    z-index: 3000;
}

.site-nav-shell {
    top: var(--rt-header-height);
    z-index: 2900;
}

.site-main {
    position: relative;
    z-index: 1;
}

/* NPDO-style sticky shell correction: keep the header and app navigation
   sticky while they remain in normal document flow. Do not use fixed chrome or
   compensate with artificial main padding, because that changes the page's
   natural scroll height and can make the footer appear too early. */
html {
    scroll-padding-top: calc(var(--rt-sticky-offset, 140px) + 12px);
}

body.redtape-site {
    min-height: 100vh;
    overflow-x: hidden;
}

body.redtape-site .site-header {
    position: sticky !important;
    top: 0 !important;
    left: auto;
    right: auto;
    width: 100%;
    z-index: 5000;
}

body.redtape-site .site-nav-shell {
    position: sticky !important;
    top: var(--rt-header-height, 82px) !important;
    left: auto;
    right: auto;
    width: 100%;
    z-index: 4900;
}

body.redtape-site .site-main {
    flex: 1 0 auto;
    min-width: 0;
    min-height: 0;
    padding-top: 0 !important;
    position: relative;
    z-index: 1;
    overflow: visible;
}

body.redtape-site .site-footer {
    position: relative !important;
    z-index: 1;
    flex-shrink: 0;
}

/* 2026-05 proper dashboard footer correction.
   Keep the footer in the document. The footer must sit after the full dashboard
   content and must not be hidden as a workaround. */
body.redtape-dashboard-page .site-footer {
    display: block !important;
    position: relative !important;
    z-index: 1;
    flex-shrink: 0;
    clear: both;
}
