/* ======================================================================
   TEGALMAJA UI UPGRADE
   Scope: typography, spacing, sizing, alignment, radius and responsiveness.
   The existing color palette is intentionally left untouched.
   ====================================================================== */

:root {
    --ui-font-body: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
    --ui-font-heading: "Manrope", "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
    --ui-content-width: 1320px;
    --ui-reading-width: 72ch;
    --ui-radius-sm: 10px;
    --ui-radius-md: 16px;
    --ui-radius-lg: 22px;
    --ui-space-section: clamp(3.75rem, 6vw, 5.25rem);
}

html {
    scroll-padding-top: 118px;
}

body {
    font-family: var(--ui-font-body);
    font-size: 15px;
    line-height: 1.65;
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
.section-title,
.admin-page-title,
.admin-page-heading strong,
.public-nav-brand-copy strong,
.auth-card h1,
.auth-card h2,
.auth-visual h1 {
    font-family: var(--ui-font-heading);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.035em;
}

p,
li,
.form-text,
small {
    text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6,
.section-title {
    text-wrap: balance;
}

.public-main p:not(.text-center):not(.text-end),
.public-main .section-desc,
.user-layout main p:not(.text-center):not(.text-end),
.public-footer p,
.news-bps-body p {
    text-align: left !important;
    text-justify: auto;
    hyphens: manual;
}

.public-main section[id],
.public-main [id] {
    scroll-margin-top: 118px;
}

/* ----------------------------------------------------------------------
   Public website: navigation and page rhythm
   ---------------------------------------------------------------------- */
.public-nav-container {
    max-width: 1540px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 2.4vw, 2.25rem);
}

.public-main-nav.site-navbar {
    min-height: 88px;
}

.public-nav-brand {
    min-width: 0;
    gap: 12px;
}

.public-nav-brand-logo {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    padding: 5px;
}

.public-nav-brand-copy {
    min-width: 0;
    line-height: 1.15;
}

.public-nav-brand-copy small {
    margin-bottom: 4px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .09em;
    line-height: 1.2;
}

.public-nav-brand-copy strong {
    font-size: 1.02rem;
    letter-spacing: -.025em;
}

.public-main-menu {
    gap: 1px;
}

.public-main-nav.site-navbar .nav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: .66rem !important;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.public-main-nav.site-navbar .dropdown-menu {
    min-width: 230px;
    padding: 8px;
}

.public-main-nav.site-navbar .dropdown-item {
    min-height: 42px;
    padding: .65rem .7rem;
    font-size: .8rem;
    line-height: 1.35;
}

.public-main-nav.site-navbar .dropdown-item i {
    flex: 0 0 18px;
}

.public-nav-account {
    margin-left: .65rem;
}

.public-nav-account .btn {
    min-height: 42px;
    padding-inline: .85rem;
    font-size: .77rem;
    white-space: nowrap;
}

.public-slogan-ticker-window {
    padding-block: 6px;
}

.public-slogan-ticker-track > span {
    font-size: .68rem;
    letter-spacing: .075em;
}

.public-main {
    min-height: 55vh;
}

.page-hero {
    padding-block: clamp(3.25rem, 6vw, 4.75rem);
}

.page-hero h1 {
    max-width: 900px;
    margin-bottom: .65rem;
    font-size: clamp(2rem, 4.4vw, 3.65rem);
    line-height: 1.08;
}

.page-hero .breadcrumb {
    margin-bottom: 0;
    gap: .15rem;
    font-size: .78rem;
}

.section-space,
.home-section-compact {
    padding-block: var(--ui-space-section);
}

.section-kicker {
    display: inline-block;
    margin-bottom: .55rem;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: .12em;
}

.section-title,
.section-title.h1 {
    margin-bottom: .75rem;
    font-size: clamp(1.75rem, 3vw, 2.65rem);
    line-height: 1.12;
}

.section-desc {
    max-width: var(--ui-reading-width);
    font-size: .96rem;
    line-height: 1.75;
}

/* Home hero */
.home-hero-compact {
    min-height: clamp(520px, 66vh, 650px);
    padding-block: clamp(4.5rem, 8vw, 7rem);
}

.home-hero-compact .hero-content > .row {
    min-height: 360px;
}

.home-hero-title,
.home-hero-compact h1 {
    max-width: 900px;
    margin-top: 1rem !important;
    font-size: clamp(2.55rem, 5.4vw, 4.8rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -.045em;
}

.home-hero-compact p {
    max-width: 720px;
    margin-top: 1.15rem !important;
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    line-height: 1.75;
}

.hero-badge {
    min-height: 36px;
    padding: .52rem .8rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .015em;
}

.home-hero-actions {
    gap: .75rem !important;
}

.home-hero-actions .btn {
    min-height: 48px;
    padding-inline: 1.1rem;
}

/* Stats */
.stats-strip {
    margin-top: -48px;
}

.stats-card {
    padding: .55rem .75rem;
    border-radius: var(--ui-radius-lg);
}

.stat-item {
    min-height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem .85rem;
}

.stat-value,
.kpi-mini strong,
.admin-kpi .value {
    font-variant-numeric: tabular-nums;
}

.stat-value {
    font-family: var(--ui-font-heading);
    font-size: clamp(1.35rem, 2.1vw, 1.75rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.025em;
}

.stat-label {
    margin-top: .4rem;
    font-size: .67rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .065em;
}

/* Cards and content blocks */
.soft-card,
.service-search-card,
.information-support-card,
.information-news-card,
.home-bps-news-card,
.home-bps-ebook-card,
.public-document-card,
.commerce-meta-card,
.kpi-mini {
    border-radius: var(--ui-radius-md) !important;
}

.soft-card,
.home-bps-news-card,
.home-bps-ebook-card,
.information-news-card {
    transition: transform .18s ease, box-shadow .18s ease;
}

.soft-card:hover,
.home-bps-news-card:hover,
.home-bps-ebook-card:hover,
.information-news-card:hover {
    transform: translateY(-3px);
}

.service-card {
    padding: 1.4rem;
}

.service-card .icon-box {
    width: 52px;
    height: 52px;
    margin-bottom: 1.1rem !important;
}

.service-card h3,
.news-card h3,
.product-card h3,
.home-bps-news-body h3,
.home-bps-ebook-info h3 {
    font-family: var(--ui-font-heading);
    font-weight: 800;
    letter-spacing: -.02em;
}

.service-card h3 {
    margin-bottom: .55rem;
    font-size: 1rem;
    line-height: 1.4;
}

.service-card p {
    font-size: .84rem;
    line-height: 1.7;
}

.bps-section-heading,
.information-heading {
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.bps-see-all-link,
.information-news-read {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .78rem;
    font-weight: 700;
}

.home-bps-ebook-info,
.home-bps-news-body,
.information-news-content {
    padding: 1.15rem 1.2rem 1.3rem;
}

.home-bps-ebook-info h3,
.home-bps-news-body h3,
.information-news-content h2,
.information-news-content h3 {
    line-height: 1.42;
}

.news-image,
.product-image,
.image-placeholder {
    min-height: 210px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-modern {
    min-width: 680px;
    border-radius: var(--ui-radius-sm);
}

.table-modern thead th {
    padding: .8rem .9rem;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: .05em;
    vertical-align: middle;
}

.table-modern tbody td {
    padding: .85rem .9rem;
    font-size: .8rem;
    line-height: 1.55;
}

.table-modern td .btn {
    min-height: 34px;
}

/* Forms and controls */
.form-label {
    margin-bottom: .45rem;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.35;
}

.form-control,
.form-select {
    min-height: 48px;
    padding: .72rem .85rem;
    border-radius: var(--ui-radius-sm);
    font-size: .86rem;
    line-height: 1.45;
}

textarea.form-control {
    min-height: 128px;
    line-height: 1.7;
}

.form-text,
.invalid-feedback {
    margin-top: .4rem;
    font-size: .7rem;
    line-height: 1.5;
}

.btn {
    min-height: 42px;
    padding: .64rem .95rem;
    border-radius: var(--ui-radius-sm);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.008em;
}

.btn-sm {
    min-height: 34px;
    padding: .45rem .65rem;
    border-radius: 8px;
    font-size: .74rem;
}

.alert {
    padding: .9rem 1rem;
    border-radius: var(--ui-radius-sm);
    font-size: .82rem;
    line-height: 1.6;
}

.dropdown-menu {
    border-radius: var(--ui-radius-sm);
}

.modal-content {
    border-radius: var(--ui-radius-lg);
}

.modal-header,
.modal-body,
.modal-footer {
    padding-inline: clamp(1.1rem, 3vw, 1.5rem);
}

/* Footer */
.footer.public-footer {
    padding-top: clamp(3.5rem, 6vw, 5rem);
}

.footer-brand {
    gap: .8rem;
}

.public-footer h5 {
    margin-bottom: 1rem;
    font-size: .92rem;
    line-height: 1.35;
}

.public-footer p,
.public-footer a,
.footer-contact-list {
    font-size: .8rem;
    line-height: 1.75;
}

.footer-bottom {
    margin-top: 2.25rem;
    padding-top: 1.2rem;
    font-size: .72rem;
}

/* ----------------------------------------------------------------------
   Admin dashboard: cleaner density, stronger hierarchy
   ---------------------------------------------------------------------- */
.admin-sidebar {
    width: var(--admin-sidebar-width);
}

.admin-brand {
    min-height: 78px;
    padding: 14px 16px;
}

.admin-brand-logo {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
}

.admin-brand-copy strong {
    font-size: .9rem;
    line-height: 1.25;
    letter-spacing: -.015em;
}

.admin-brand-copy small {
    margin-top: 2px;
    font-size: .66rem;
    line-height: 1.35;
}

.admin-sidebar-caption {
    padding: 18px 18px 7px;
    font-size: .6rem;
    line-height: 1.2;
}

.admin-nav {
    padding-inline: 11px;
}

.admin-nav-link,
.admin-nav-parent {
    min-height: 44px;
    gap: .7rem;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: .78rem;
    line-height: 1.35;
}

.admin-nav-icon {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
    border-radius: 8px;
    font-size: .78rem;
}

.admin-nav-child {
    min-height: 38px;
    padding: 7px 8px;
    font-size: .74rem;
    line-height: 1.35;
}

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

.admin-topbar {
    height: 76px;
    padding-inline: clamp(1rem, 2vw, 1.6rem);
}

.admin-page-heading {
    gap: 2px;
}

.admin-page-eyebrow {
    font-size: .58rem;
    line-height: 1.2;
    letter-spacing: .11em;
}

.admin-page-heading strong {
    font-size: 1.02rem;
    line-height: 1.25;
}

.admin-content {
    max-width: 1660px;
    padding: clamp(1.2rem, 2.2vw, 2rem);
}

.admin-page-title {
    margin-bottom: .35rem;
    font-size: clamp(1.45rem, 2.2vw, 1.9rem) !important;
    line-height: 1.16;
}

.admin-content > .mb-4,
.admin-content > div > .mb-4 {
    margin-bottom: 1.25rem !important;
}

.admin-card {
    padding: clamp(1rem, 1.8vw, 1.35rem);
    border-radius: var(--ui-radius-md);
}

.admin-card h2,
.admin-card h3 {
    line-height: 1.3;
}

.admin-kpi {
    min-height: 128px;
    padding: 1.1rem;
    border-radius: var(--ui-radius-md);
}

.admin-kpi .value {
    margin-top: .35rem;
    font-size: clamp(1.55rem, 2.3vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -.035em;
}

.admin-kpi .small {
    font-size: .7rem;
    line-height: 1.45;
}

.admin-filter-bar,
.admin-card form.row.g-2.mb-3 {
    padding: .8rem;
    border-radius: var(--ui-radius-sm);
}

.admin-user-button {
    min-height: 44px;
}

.admin-user-avatar {
    width: 34px;
    height: 34px;
    font-weight: 800;
}

.admin-user-copy strong {
    font-size: .74rem;
}

.admin-user-copy small {
    font-size: .62rem;
}

.admin-notification-button {
    width: 42px;
    height: 42px;
}

.admin-empty-state {
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.admin-form-actions {
    gap: .65rem;
}

/* ----------------------------------------------------------------------
   Resident dashboard and account modal
   ---------------------------------------------------------------------- */
.user-topbar {
    padding-block: .85rem !important;
}

.user-topbar .site-brand-logo {
    width: 46px;
    height: 46px;
}

.user-layout > main.container {
    max-width: var(--ui-content-width);
    padding-top: 2rem !important;
    padding-bottom: 3rem !important;
}

.user-layout .soft-card,
.user-layout .admin-card {
    border-radius: var(--ui-radius-md);
}

.account-modal-hero {
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 1.8rem);
}

.account-modal-avatar {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    font-size: 1.2rem;
}

.account-modal-title {
    margin: .2rem 0 .35rem;
    font-family: var(--ui-font-heading);
    font-size: clamp(1.25rem, 2.5vw, 1.7rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.03em;
}

.account-modal-meta {
    gap: .55rem 1rem;
    font-size: .7rem;
    line-height: 1.45;
}

.account-modal-body {
    padding: clamp(1.15rem, 3vw, 1.6rem);
}

.account-identity-card,
.account-settings-content {
    border-radius: var(--ui-radius-md);
}

.account-card-kicker {
    font-size: .64rem;
    line-height: 1.3;
    letter-spacing: .09em;
}

.account-identity-card h3,
.account-pane-heading h3 {
    font-family: var(--ui-font-heading);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.02em;
}

.account-card-description,
.account-pane-heading p {
    font-size: .78rem;
    line-height: 1.65;
}

.account-settings-tabs .nav-link {
    min-height: 44px;
    padding: .65rem .85rem;
    font-size: .76rem;
    font-weight: 700;
}

.account-form-footer {
    gap: .65rem;
}

/* ----------------------------------------------------------------------
   Authentication pages
   ---------------------------------------------------------------------- */
.auth-shell {
    grid-template-columns: minmax(380px, .95fr) minmax(480px, 1.05fr);
}

.auth-visual {
    padding: clamp(2rem, 5vw, 4.5rem);
}

.auth-visual h1 {
    max-width: 760px;
    margin-top: 1.25rem !important;
    font-size: clamp(2.3rem, 4.5vw, 4.25rem);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.auth-visual .lead {
    max-width: 680px;
    font-size: 1rem;
    line-height: 1.75;
}

.auth-form-wrap {
    padding: clamp(1.25rem, 4vw, 3rem);
}

.auth-card {
    max-width: 540px;
    padding: clamp(1.5rem, 3.5vw, 2.25rem);
    border-radius: var(--ui-radius-lg) !important;
}

.auth-card h1,
.auth-card h2,
.auth-card .h3,
.auth-card .h4 {
    line-height: 1.2;
}

/* ----------------------------------------------------------------------
   Responsive cleanup
   ---------------------------------------------------------------------- */
@media (max-width: 1399.98px) {
    .public-main-nav.site-navbar .nav-link {
        padding-inline: .5rem !important;
        font-size: .74rem;
    }

    .public-nav-account .btn {
        padding-inline: .72rem;
    }
}

@media (max-width: 1199.98px) {
    html {
        scroll-padding-top: 92px;
    }

    .public-main section[id],
    .public-main [id] {
        scroll-margin-top: 92px;
    }

    .public-main-nav.site-navbar {
        min-height: 76px;
        padding-block: .55rem;
    }

    .public-main-nav.site-navbar .navbar-collapse {
        margin-top: .7rem;
        padding-bottom: .85rem;
    }

    .public-main-menu {
        gap: 2px;
    }

    .public-main-nav.site-navbar .nav-link {
        min-height: 42px;
        justify-content: flex-start;
        padding: .68rem .8rem !important;
        font-size: .82rem;
        white-space: normal;
    }

    .public-main-nav.site-navbar .dropdown-menu {
        min-width: 0;
        margin: .25rem 0 .45rem;
    }

    .public-nav-account {
        margin: .7rem 0 0;
        padding-top: .75rem;
    }

    .public-nav-account .btn {
        flex: 1 1 150px;
    }

    .auth-shell {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 991.98px) {
    .home-hero-compact {
        min-height: auto;
        padding-block: 4.5rem 5.5rem;
    }

    .home-hero-compact .hero-content > .row {
        min-height: 0;
    }

    .stats-strip {
        margin-top: -34px;
    }

    .stat-item {
        min-height: 88px;
    }

    .auth-shell {
        display: block;
        min-height: 100vh;
    }

    .auth-visual {
        min-height: 330px;
        padding: 2rem;
    }

    .auth-visual h1 {
        max-width: 650px;
        font-size: clamp(2.15rem, 7vw, 3.4rem);
    }

    .auth-form-wrap {
        min-height: auto;
        padding: 2rem 1rem 3rem;
    }

    .auth-card {
        max-width: 620px;
    }
}

@media (max-width: 767.98px) {
    :root {
        --ui-space-section: 3.5rem;
    }

    body {
        font-size: 14px;
    }

    .public-nav-container {
        padding-inline: .9rem;
    }

    .public-nav-brand-logo {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .public-nav-brand-copy small {
        font-size: .56rem;
    }

    .public-nav-brand-copy strong {
        max-width: 210px;
        overflow: hidden;
        font-size: .9rem;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .public-slogan-ticker-track > span {
        padding-right: 48px;
        font-size: .63rem;
    }

    .page-hero {
        padding-block: 2.8rem 2.6rem;
    }

    .page-hero h1 {
        font-size: clamp(1.8rem, 9vw, 2.65rem);
    }

    .section-title,
    .section-title.h1 {
        font-size: clamp(1.55rem, 7vw, 2.05rem);
    }

    .section-desc {
        font-size: .88rem;
    }

    .home-hero-compact {
        padding-block: 3.6rem 4.8rem;
    }

    .home-hero-title,
    .home-hero-compact h1 {
        font-size: clamp(2.2rem, 11vw, 3.35rem);
    }

    .home-hero-compact p {
        font-size: .94rem;
    }

    .stats-strip {
        margin-top: -28px;
    }

    .stats-card {
        padding: .4rem;
    }

    .home-stats-scroll {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .home-stats-scroll::-webkit-scrollbar {
        display: none;
    }

    .home-stats-scroll .stat-item {
        min-width: 142px;
        min-height: 82px;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    .service-card {
        padding: 1.15rem;
    }

    .table-modern {
        min-width: 620px;
    }

    .admin-topbar {
        padding-inline: .85rem;
    }

    .admin-content {
        padding: 1rem .85rem 1.5rem;
    }

    .admin-card {
        padding: 1rem;
    }

    .admin-page-heading strong {
        font-size: .9rem;
    }

    .admin-page-eyebrow {
        font-size: .54rem;
    }

    .admin-user-button {
        padding-right: 5px;
    }

    .account-modal-hero {
        align-items: flex-start;
    }

    .account-modal-meta {
        display: grid;
    }

    .account-settings-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }

    .account-settings-tabs::-webkit-scrollbar {
        display: none;
    }

    .account-settings-tabs .nav-link {
        white-space: nowrap;
    }

    .auth-visual {
        min-height: 290px;
        padding: 1.5rem;
    }

    .auth-visual .lead {
        font-size: .9rem;
    }

    .auth-form-wrap {
        padding: 1.25rem .85rem 2.5rem;
    }

    .auth-card {
        padding: 1.35rem;
    }
}

@media (max-width: 575.98px) {
    .public-nav-brand-copy strong {
        max-width: 175px;
        font-size: .84rem;
    }

    .home-hero-actions {
        display: grid !important;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .home-hero-actions .btn {
        width: 100%;
    }

    .section-kicker {
        font-size: .66rem;
    }

    .bps-section-heading,
    .information-heading {
        align-items: flex-start;
    }

    .admin-notification-menu {
        width: calc(100vw - 20px);
    }

    .admin-notification-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .user-topbar .container {
        align-items: flex-start !important;
    }

    .user-topbar .site-brand-logo {
        width: 42px;
        height: 42px;
    }

    .account-modal-avatar {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
