/* Shared NPDO page layout, navigation, dashboard shell, and loading overlay styles. */
.page-shell {
    width: 100%;
    min-height: 100vh;
}

.page-container {
    width: min(1400px, calc(100% - 24px));
    margin: 0 auto;
}

.section-card {
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

/* NPDO HEADER STYLE */
.npdo-header {
    position: sticky;
    top: 0;
    z-index: 1200;
    background: rgba(255, 255, 255, 0.98);
    pointer-events: auto;
    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);
}

.npdo-header__accent {
    height: 8px;
    width: 100%;
    background: linear-gradient(90deg, #072f63 0%, #063d75 22%, #05b8c6 51%, #ff8a2a 100%);
}

.npdo-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: 92px;
    width: min(1920px, 100%);
    margin: 0 auto;
    padding: 14px clamp(18px, 3.4vw, 64px);
}

.npdo-header__brand,
.npdo-header__center,
.npdo-header__actions {
    min-width: 0;
}

.npdo-header__brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.npdo-header__logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}

.npdo-header__logo {
    width: min(178px, 100%);
    height: auto;
    max-height: 72px;
    object-fit: contain;
}

.npdo-header__center {
    text-align: center;
}

.npdo-header__title {
    margin: 0;
    color: #07366c;
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.npdo-header__actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    color: #07366c;
    font-size: clamp(0.92rem, 1vw, 1.05rem);
    font-weight: 700;
    white-space: nowrap;
}

.npdo-header__user-text {
    max-width: 160px;
    overflow: hidden;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.npdo-header__divider {
    width: 2px;
    height: 28px;
    border-radius: 999px;
    background: #d8dee8;
}

.npdo-header__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 4px;
    border-radius: 12px;
    color: #07366c;
    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;
}

.npdo-header__link:hover,
.npdo-header__link.is-active {
    color: #05aebc;
}

.npdo-header__link:focus-visible {
    outline: 3px solid rgba(5, 184, 198, 0.35);
    outline-offset: 4px;
}

.npdo-header__link--button {
    min-width: 104px;
    padding: 0 18px;
    color: #ffffff;
    background: linear-gradient(135deg, #05b8c6, #03a8b6);
    box-shadow: 0 10px 22px rgba(5, 184, 198, 0.24);
}

.npdo-header__link--button:hover,
.npdo-header__link--button.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, #04aeba, #0396a3);
    box-shadow: 0 12px 26px rgba(5, 184, 198, 0.3);
    transform: translateY(-1px);
}

/* NPDO NAVIGATION STYLE */
.npdo-app-nav {
    position: sticky;
    top: 100px;
    z-index: 1100;
    background: rgba(248, 250, 252, 0.92);
    border-bottom: 1px solid #dbe4ee;
    padding: 10px 16px;
    backdrop-filter: blur(10px);
}

.npdo-app-nav__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: min(1400px, 100%);
    margin: 0 auto;
}

.npdo-app-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;
}

.npdo-app-nav__link:hover {
    border-color: rgba(5, 184, 198, 0.45);
    color: #07366c;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.npdo-app-nav__link.is-active {
    background: #07366c;
    border-color: #07366c;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(7, 54, 108, 0.18);
}

.npdo-app-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    flex: 0 0 auto;
}

.npdo-app-nav__label {
    display: inline-block;
    line-height: 1;
}

.npdo-app-nav__empty {
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
}

/* FOOTER STYLE */
.npdo-footer {
    width: 100%;
    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;
}

.npdo-footer__inner {
    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;
}

.npdo-footer__brand,
.npdo-footer__links,
.npdo-footer__contact {
    min-width: 0;
}

.npdo-footer__logo-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.npdo-footer__logo {
    width: 128px;
    height: auto;
    max-height: 52px;
    object-fit: contain;
}

.npdo-footer__description {
    max-width: 430px;
    margin: 8px 0 10px;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.35;
}

.npdo-footer__heading {
    margin: 0 0 8px;
    color: #07366c;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.npdo-footer__social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.npdo-footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid #dbe4ee;
    border-radius: 999px;
    background: #f8fafc;
    color: #07366c;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.npdo-footer__social-link svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex: 0 0 auto;
}

.npdo-footer__social-link:hover,
.npdo-footer__social-link:focus-visible {
    border-color: rgba(5, 184, 198, 0.55);
    background: #eefcff;
    color: #05aebc;
    box-shadow: 0 7px 16px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.npdo-footer__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.npdo-footer__list--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 0;
    max-width: 520px;
}

.npdo-footer__list--inline li {
    display: inline-flex;
    align-items: center;
}

.npdo-footer__list--inline li:not(:last-child)::after {
    content: "|";
    margin: 0 8px;
    color: #94a3b8;
    font-weight: 500;
}

.npdo-footer a:not(.npdo-footer__logo-link):not(.npdo-footer__social-link) {
    color: #334155;
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
    transition: color 0.16s ease;
}

.npdo-footer a:not(.npdo-footer__logo-link):not(.npdo-footer__social-link):hover,
.npdo-footer a:not(.npdo-footer__logo-link):not(.npdo-footer__social-link):focus-visible {
    color: #05aebc;
}

.npdo-footer a:focus-visible {
    outline: 3px solid rgba(5, 184, 198, 0.32);
    outline-offset: 3px;
}

.npdo-footer__contact-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.npdo-footer__contact-list div {
    display: grid;
    gap: 2px;
}

.npdo-footer__contact-list dt {
    margin: 0;
    color: #07366c;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.25;
}

.npdo-footer__contact-list dd {
    margin: 0;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
}

.npdo-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px clamp(18px, 3.4vw, 64px);
    background: linear-gradient(90deg, #072f63 0%, #063d75 24%, #05b8c6 58%, #ff8a2a 100%);
    color: #ffffff;
    text-align: center;
}

.npdo-footer__bottom p {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 650;
    line-height: 1.25;
}

.app-page {
    padding: 12px 12px 20px;
}

.app-placeholder {
    padding: 28px;
}

.app-placeholder h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #0f172a;
}

.app-placeholder p {
    margin: 0;
    color: #475569;
    max-width: 720px;
}

@media (max-width: 1120px) {
    .npdo-footer__inner {
        grid-template-columns: 1fr 1fr;
        padding-inline: 24px;
    }

    .npdo-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .npdo-footer {
        margin-top: 14px;
    }

    .npdo-footer__inner {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px 16px 14px;
    }

    .npdo-footer__description {
        max-width: none;
    }

    .npdo-footer__social {
        gap: 6px;
    }

    .npdo-footer__bottom {
        min-height: 32px;
        padding: 7px 16px;
    }
}

@media (max-width: 1120px) {
    .npdo-header__inner {
        grid-template-columns: minmax(140px, 210px) minmax(220px, 1fr) minmax(170px, 250px);
        min-height: 92px;
        padding: 14px 24px;
    }

    .npdo-header__logo {
        width: 170px;
        max-height: 70px;
    }

    .npdo-app-nav {
        top: 100px;
    }
}

@media (max-width: 820px) {
    .npdo-header {
        position: relative;
    }

    .npdo-header__inner {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 14px;
        min-height: auto;
        padding: 14px 16px 16px;
        text-align: center;
    }

    .npdo-header__brand,
    .npdo-header__actions {
        justify-content: center;
    }

    .npdo-header__logo {
        width: 154px;
        max-height: 66px;
    }

    .npdo-header__actions {
        flex-wrap: wrap;
        gap: 10px;
        white-space: normal;
    }

    .npdo-header__divider {
        display: none;
    }

    .npdo-header__link--button {
        min-width: 104px;
    }

    .npdo-app-nav {
        position: sticky;
        top: 0;
        padding: 10px 12px;
    }

    .npdo-app-nav__inner {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .npdo-app-nav__link {
        flex: 0 0 auto;
    }
}

@media (max-width: 520px) {
    .npdo-header__accent {
        height: 7px;
    }

    .npdo-header__title {
        font-size: 1.32rem;
    }

    .npdo-header__user-text {
        flex-basis: 100%;
        max-width: min(280px, 100%);
        text-align: center;
    }
}

/* Shared dashboard loading overlay used by Crime, Water, and Service Delivery.
   The loader is fixed to the viewport so it is always visible without scrolling. */
.npdo-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;

    /*
     * Keep the dashboard visually clear while loading.
     * The overlay is transparent, but it still captures pointer events
     * so users cannot click filters, charts, maps, or buttons while
     * a meaningful dashboard refresh is running.
     */
    background: transparent;
    backdrop-filter: none;
    pointer-events: auto;

    display: flex;
    align-items: center;
    justify-content: center;
}

.npdo-loading-overlay[hidden] {
    display: none !important;
}

.npdo-loading-overlay__card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: min(90%, 360px);
    min-width: 180px;
    padding: 18px 22px 16px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    pointer-events: auto;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    color: #07366c;
    font-size: 0.9rem;
    font-weight: 750;
    text-align: center;
    transform: translateY(-4vh);
}

/* Branded NPDO loader.
   The image is the NPDO O/network mark; CSS handles the animation so no GIF is required. */
.npdo-loading-spinner {
    position: relative;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    display: inline-block;
    border-radius: 50%;
    background-image: url("/static/users/img/npdo-o-mark.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    filter: drop-shadow(0 10px 18px rgba(7, 54, 108, 0.22));
    animation: npdo-loading-spin 1.35s linear infinite;
}

.npdo-loading-spinner::before,
.npdo-loading-spinner::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    pointer-events: none;
}

.npdo-loading-spinner::before {
    border: 3px solid rgba(5, 184, 198, 0.16);
    border-top-color: rgba(5, 184, 198, 0.72);
    border-right-color: rgba(247, 128, 29, 0.72);
    animation: npdo-loading-orbit 0.95s linear infinite reverse;
}

.npdo-loading-spinner::after {
    inset: -14px;
    border: 2px solid rgba(7, 54, 108, 0.08);
    border-bottom-color: rgba(5, 184, 198, 0.34);
    border-left-color: rgba(247, 128, 29, 0.34);
    animation: npdo-loading-orbit 1.9s linear infinite;
}

@keyframes npdo-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes npdo-loading-orbit {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {

    .npdo-loading-spinner,
    .npdo-loading-spinner::before,
    .npdo-loading-spinner::after {
        animation-duration: 3s;
    }
}