* {
    box-sizing: border-box;
}
.demo-page-status{display:flex;align-items:center;gap:12px;margin-bottom:16px;padding:12px 16px;background:#eef6f2;border-left:4px solid #1c6b4f;border-radius:6px}.demo-page-status span{font-size:12px;font-weight:800;text-transform:uppercase;color:#1c6b4f}.demo-page-status small{margin-left:auto;color:#66756f}.demo-pager{margin-top:22px;padding:20px;background:#fff;border:1px solid #d8e0dc;border-radius:8px}.demo-pager-row{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px}.demo-pager-row>:last-child{justify-self:end}.demo-page-numbers{display:flex;justify-content:center;flex-wrap:wrap;gap:7px;margin-top:16px}.demo-page-numbers a{display:grid;place-items:center;width:34px;height:34px;border:1px solid #d8e0dc;border-radius:6px;color:#1c6b4f;font-weight:750;text-decoration:none;background:#fff}.demo-page-numbers a.active{background:#1c6b4f;border-color:#1c6b4f;color:#fff}@media(max-width:600px){.demo-page-status{align-items:flex-start;flex-wrap:wrap}.demo-page-status small{width:100%;margin-left:0}.demo-pager-row{grid-template-columns:1fr 1fr}.demo-pager-row strong{grid-column:1/-1;grid-row:1;text-align:center}.demo-pager-row .button{grid-row:2}.demo-pager-row>:last-child{justify-self:stretch}}
.demo-form-preview{border:0;padding:0;margin:18px 0 0;opacity:1}.demo-form-preview input,.demo-form-preview select{background:#f8faf9;color:#68756f}.demo-form-preview label span{display:block;margin-bottom:7px;font-weight:700}.demo-form-table input,.demo-form-table select{min-width:130px}.demo-form-table td{padding:10px}
.age-split{display:grid;grid-template-columns:repeat(2,minmax(90px,1fr));gap:8px}.age-split input{width:100%;min-width:0}
.survey-form .repeater .table-wrap{overflow:visible}.survey-form .repeater table{display:block;min-width:0}.survey-form .repeater thead{display:none}.survey-form .repeater tbody{display:grid;gap:16px}.survey-form .repeater tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px;padding:18px;border:1px solid #ded6ca;border-radius:14px;background:#fffdfa;box-shadow:0 10px 24px rgba(42,61,69,.06)}.survey-form .repeater td{display:grid;gap:7px;padding:0;border:0;min-width:0}.survey-form .repeater td::before{content:attr(data-label);font-size:12px;font-weight:750;color:#355d60}.survey-form .repeater td:last-child{grid-column:1/-1;justify-items:start}.survey-form .repeater input,.survey-form .repeater select,.survey-form .repeater textarea{min-width:0}@media(max-width:850px){.survey-form .repeater tbody tr{grid-template-columns:1fr}}
.survey-form .repeater td.module-subsection{grid-column:1/-1;display:block;margin:12px 0 0;padding:12px 14px;background:#eaf2ef;border-left:4px solid #275d63;border-radius:6px;color:#164c5a;font-weight:800}.survey-form .repeater td.module-subsection::before{content:none}
.user-actions{min-width:230px}.password-reset{margin-bottom:10px}.password-reset summary{color:#164c5a;font-weight:750;cursor:pointer}.password-reset-form{display:grid;gap:10px;margin-top:10px;padding:12px;background:#f4f8f6;border:1px solid #d8e0dc;border-radius:8px}.password-reset-form label{gap:5px}.password-reset-form input{padding:9px 10px}.password-reset-form .button{width:100%;padding:9px 12px}
@media(min-width:1100px){.shell{grid-template-columns:240px minmax(0,1fr)}.sidebar{position:sticky;top:0;height:100vh;padding:24px 18px;gap:18px;overflow-y:auto}.sidebar h1{font-size:22px}.nav a{padding:10px 12px}.main{min-width:0;padding:22px 24px;gap:18px}.page-header{align-items:center}.card{padding:20px;border-radius:12px}.portal-intro{display:grid;grid-template-columns:minmax(260px,.7fr) minmax(520px,1.3fr);align-items:start;gap:14px 24px}.portal-intro .module-toolbar{justify-content:flex-end}.portal-intro .mobile-tip,.portal-intro .section-nav{grid-column:1/-1}.section-nav{flex-wrap:nowrap;overflow-x:auto}.survey-form{gap:14px}.survey-form .module-head{position:sticky;top:0;z-index:7;margin:-20px -20px 16px;padding:14px 20px;background:rgba(255,255,255,.98);border-bottom:1px solid #e6dece}.survey-form .two-up{grid-template-columns:repeat(4,minmax(0,1fr))}.survey-form .three-up{grid-template-columns:repeat(4,minmax(0,1fr))}.survey-form .repeater tbody tr{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;padding:16px}.survey-form input,.survey-form select,.survey-form textarea{min-height:42px;padding:9px 11px;border-radius:8px}.survey-form label{gap:6px}.form-actions{bottom:10px;z-index:10;padding:10px 12px;background:rgba(248,242,232,.96);border:1px solid #ded6ca;border-radius:10px}.table-wrap{max-width:100%}}@media(min-width:1500px){.shell{grid-template-columns:250px minmax(0,1fr)}.main{padding:24px 30px}.survey-form .repeater tbody tr{grid-template-columns:repeat(3,minmax(0,1fr))}}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: #1d1d1b;
    background:
        radial-gradient(circle at top right, rgba(207, 226, 243, 0.8), transparent 28%),
        linear-gradient(180deg, #f8f2e8 0%, #f4eee4 100%);
}

.guest-body {
    background: #f4f7f5;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.guest-topbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(20px, calc((100vw - 1180px) / 2));
    background: #fff;
    border-bottom: 1px solid #dce6e0;
}

.guest-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #17322c;
    text-decoration: none;
}

.guest-brand span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    background: #146c54;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}

.guest-topbar nav {
    display: flex;
    gap: 20px;
}

.guest-topbar nav a {
    color: #275d63;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.guest-main {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 38px 0 70px;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

a {
    color: #164c5a;
}

.sidebar {
    padding: 32px 24px;
    background: #0f3d3e;
    color: #f7f0e4;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar h1,
.page-header h2,
.card h3,
.auth-card h2 {
    margin: 0;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    opacity: 0.7;
}

.muted {
    color: rgba(29, 29, 27, 0.7);
}

.sidebar .muted,
.sidebar a,
.sidebar span {
    color: rgba(247, 240, 228, 0.8);
}

.nav {
    display: grid;
    gap: 8px;
}

.portal-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px 0;
}

.portal-tab {
    display: grid;
    gap: 4px;
    min-width: 220px;
    padding: 14px 16px;
    border: 1px solid rgba(39, 93, 99, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
    color: #164c5a;
    text-decoration: none;
}

.portal-tab.is-active {
    border-color: rgba(177, 79, 45, 0.5);
    background: rgba(177, 79, 45, 0.1);
}

.portal-tab span {
    font-size: 13px;
    color: rgba(29, 29, 27, 0.68);
}

.portal-tab strong {
    font-size: 16px;
}

.nav a,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: 160ms ease;
}

.nav a {
    background: rgba(255, 255, 255, 0.08);
}

.nav a:hover,
.button:hover {
    transform: translateY(-1px);
}

.main {
    padding: 32px;
    display: grid;
    gap: 24px;
}

.page-header,
.section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

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

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

.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-grid {
    grid-template-columns: minmax(280px, 360px) 1fr;
}

.card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 61, 62, 0.12);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 18px 40px rgba(42, 61, 69, 0.08);
}

.narrow {
    max-width: 620px;
}

.stack {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #c9c2b6;
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid #e6dece;
    text-align: left;
    vertical-align: top;
}

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

.button {
    background: #b14f2d;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(177, 79, 45, 0.22);
}

.button.secondary {
    background: #275d63;
    box-shadow: 0 10px 24px rgba(39, 93, 99, 0.2);
}

.button.danger {
    background: #8a2d2d;
    box-shadow: none;
}

.flash {
    padding: 14px 16px;
    border-radius: 14px;
}

.flash-success {
    background: #dff3df;
    color: #144714;
}

.flash-error {
    background: #f8dddd;
    color: #6c1b1b;
}

.user-card {
    margin-top: auto;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 4px;
}

.stat-card strong {
    font-size: 40px;
}

.json-view {
    padding: 16px;
    border-radius: 16px;
    background: #f5efe5;
    overflow: auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 16px;
    padding: 12px 0 4px;
}

.hero {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.hero-copy,
.hero-panel {
    padding: 28px;
}

.hero-copy {
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(15, 61, 62, 0.92), rgba(39, 93, 99, 0.88)),
        linear-gradient(180deg, #f8f2e8 0%, #f4eee4 100%);
    color: #f7f0e4;
    box-shadow: 0 26px 54px rgba(15, 61, 62, 0.22);
}

.hero-copy .hero-text,
.hero-copy .eyebrow {
    color: rgba(247, 240, 228, 0.85);
}

.hero-copy h2 {
    margin: 0 0 12px;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.03;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

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

.hero-panel {
    display: grid;
    gap: 16px;
}

.mini-stat {
    padding: 18px;
    border-radius: 18px;
    background: rgba(245, 239, 229, 0.8);
    border: 1px solid rgba(15, 61, 62, 0.12);
}

.mini-stat span,
.stat-card span {
    display: block;
    font-size: 14px;
    color: rgba(29, 29, 27, 0.7);
}

.mini-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
}

.feature-card h3 {
    margin-bottom: 10px;
}

.portal-intro {
    display: grid;
    gap: 16px;
}


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

.module-card {
    display: grid;
    gap: 16px;
}

.module-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.module-head p {
    margin: 6px 0 0;
}

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

.module-body[hidden] {
    display: none;
}

.module-toggle {
    min-width: 108px;
}

.section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.section-nav a,
.chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(39, 93, 99, 0.1);
    border: 1px solid rgba(39, 93, 99, 0.16);
    color: #164c5a;
    font-size: 13px;
    text-decoration: none;
}

.survey-form .card {
    scroll-margin-top: 24px;
}

.survey-form .card.is-active {
    border-color: rgba(177, 79, 45, 0.45);
    box-shadow: 0 20px 44px rgba(177, 79, 45, 0.1);
}

.repeater .section-title p {
    margin: 6px 0 0;
}

.dashboard-hero {
    padding: 4px 0 8px;
}

.vap-public-hero {
    min-height: 65vh;
    display: grid;
    grid-template-columns: 1.5fr .6fr;
    align-items: center;
    gap: 50px;
}

.vap-public-hero h2 {
    max-width: 850px;
    margin: 10px 0 22px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(44px, 6vw, 76px);
    line-height: 1.03;
}

.vap-public-hero p:not(.eyebrow) {
    max-width: 680px;
    color: rgba(29, 29, 27, .66);
    font-size: 19px;
}

.vap-public-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px 18px;
    align-items: center;
    padding: 38px;
    background: #0c4c3b;
    color: white;
    box-shadow: 0 12px 34px rgba(24,55,46,.12);
}

.vap-public-panel strong {
    color: #aee4ce;
    font-size: 42px;
}

.vap-public-panel span { font-size: 16px; }

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

.visual-card {
    min-height: 190px;
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    padding: 22px;
    background: #fff;
    border: 1px solid rgba(15, 61, 62, .12);
    box-shadow: 0 16px 38px rgba(42, 61, 69, .08);
}

.visual-card h3 { margin: 0 0 8px; font-size: 19px; }
.visual-card p { margin: 0; color: rgba(29, 29, 27, .65); font-size: 14px; }

.radial-graphic {
    width: 78px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#b14f2d var(--value), #edf1ef 0);
    position: relative;
}

.radial-graphic.modules { background: conic-gradient(#275d63 var(--value), #edf1ef 0); }

.radial-graphic::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: #fff;
}

.radial-graphic span { position: relative; z-index: 1; font-size: 24px; color: #0f3d3e; }

.people-graphic {
    width: 84px;
    min-height: 94px;
    display: grid;
    grid-template-columns: repeat(3, 20px);
    align-content: center;
    justify-content: center;
    gap: 8px;
}

.people-graphic span {
    width: 20px;
    height: 20px;
    border-radius: 50% 50% 42% 42%;
    background: #275d63;
    box-shadow: inset 0 -8px 0 rgba(255,255,255,.18);
}

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

.module-node {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    align-items: center;
    padding: 15px;
    border: 1px solid rgba(39, 93, 99, .14);
    color: #164c5a;
    text-decoration: none;
}

.module-node span { font-weight: 700; }
.module-node small { color: rgba(29,29,27,.6); }
.module-node i {
    grid-row: span 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: conic-gradient(#275d63 var(--intensity), #e6ece9 0);
    box-shadow: inset 0 0 0 8px #fff;
}

@media (max-width: 1024px) {
    .shell,
    .hero,
    .admin-grid,
    .dashboard-stats,
    .visual-overview,
    .module-map,
    .vap-public-hero,
    .module-metrics-grid,
    .chart-grid,
    .two-up,
    .three-up {
        grid-template-columns: 1fr;
    }

    .sidebar {
        gap: 16px;
    }

    .main {
        padding: 20px;
    }

    .hero-copy {
        padding: 24px;
    }

    .vap-public-panel {
        max-width: 420px;
    }

    .form-actions {
        position: static;
    }
}

@media (max-width: 720px) {
    .page-header,
    .section-title,
    .module-head,
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    .sidebar {
        padding: 20px;
    }

    .guest-topbar {
        padding: 0 16px;
    }

    .guest-topbar nav a:first-child {
        display: none;
    }
}


.detail-grid p {
    margin: 0;
}

.cell-muted {
    opacity: 0.55;
}


.mobile-tip {
    margin: 0;
}

input,
select,
textarea,
.button {
    min-height: 48px;
}

.section-nav {
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.section-nav a {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding: 18px;
    }

    .main {
        padding: 16px;
    }

    .page-header,
    .section-title,
    .module-head,
    .hero-actions,
    .module-actions,
    .module-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        position: sticky;
        bottom: 8px;
        background: linear-gradient(180deg, rgba(248,242,232,0), rgba(248,242,232,0.96) 30%);
        padding-top: 16px;
    }
}

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

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 68px;
    padding: 10px clamp(18px, 3vw, 36px);
    background: #0f3d3e;
    color: #f7f0e4;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #f7f0e4;
    text-decoration: none;
}

.app-brand span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .13);
    font-weight: 900;
    letter-spacing: .04em;
}

.app-brand strong {
    font-size: 18px;
    line-height: 1.2;
}

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

.top-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .2);
    color: #f7f0e4;
    text-decoration: none;
    font-weight: 750;
    background: rgba(255, 255, 255, .08);
}

.app-shell .main {
    width: min(1760px, 100%);
    margin: 0 auto;
    padding: clamp(18px, 2.4vw, 34px);
}

.app-shell .sidebar {
    display: none;
}

.paged-survey-form {
    gap: 18px;
}

.form-page-layout {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: clamp(18px, 2vw, 30px);
}

.form-page-tabs-side {
    top: 88px;
    gap: 8px;
    padding: 14px;
    background: #fff;
    border: 1px solid rgba(15, 61, 62, .13);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(42, 61, 69, .08);
}

.form-page-tabs-side a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #f7faf8;
    color: #17322c;
    font-weight: 750;
    line-height: 1.25;
    text-decoration: none;
}

.form-page-tabs-side a:hover {
    border-color: #cbd9d1;
    background: #fff;
}

.form-page-tabs-side a.is-active {
    background: #0f3d3e;
    color: #fff;
    border-color: #0f3d3e;
    box-shadow: none;
}

.form-page-content .card {
    border-radius: 12px;
}

.portal-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.portal-intro .mobile-tip,
.portal-intro .form-page-tabs {
    display: none;
}

@media (max-width: 900px) {
    .app-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
    }

    .top-actions a {
        flex: 1;
    }

    .form-page-layout {
        grid-template-columns: 1fr;
    }

    .form-page-tabs-side {
        position: static;
        flex-direction: row;
        padding: 10px;
    }

    .form-page-tabs-side a {
        min-width: 190px;
    }
}

@media (max-width: 768px) {
    .card {
        padding: 16px;
        border-radius: 16px;
    }

    .table-wrap {
        overflow: visible;
    }

    table {
        min-width: 0;
        width: 100%;
        display: block;
    }

    thead {
        display: none;
    }

    tbody {
        display: grid;
        gap: 12px;
    }

    tbody[data-rows] tr,
    .card table tbody tr {
        display: block;
        border: 1px solid #e6dece;
        border-radius: 14px;
        padding: 12px;
        background: #fffdfa;
        box-shadow: 0 10px 24px rgba(42, 61, 69, 0.06);
    }

    td {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px 0;
        border-bottom: 1px dashed #eadfcb;
    }

    td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    td::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #275d63;
    }

    td .button.danger {
        width: 100%;
    }

    .module-body {
        overflow: visible;
    }

    .chip {
        justify-content: center;
    }
}


.collector-tools {
    justify-content: flex-start;
}

.photo-block {
    display: grid;
    gap: 8px;
}

.photo-hint {
    font-size: 13px;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.photo-gallery img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid #ddd2c0;
}


.module-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-mini {
    display: grid;
    gap: 8px;
}

.metric-mini strong {
    font-size: 28px;
}


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

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

.bar-row {
    display: grid;
    gap: 6px;
}

.bar-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.bar-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(39, 93, 99, 0.12);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #275d63, #b14f2d);
}


.field-hidden {
    display: none !important;
}

.geo-status {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(39, 93, 99, 0.08);
    border: 1px solid rgba(39, 93, 99, 0.16);
    width: 100%;
}

.geo-status[data-tone="success"] {
    background: rgba(33, 115, 70, 0.12);
    border-color: rgba(33, 115, 70, 0.26);
    color: #175437;
}

.geo-status[data-tone="error"] {
    background: rgba(138, 45, 45, 0.12);
    border-color: rgba(138, 45, 45, 0.24);
    color: #7d2222;
}

.chart-card .section-title {
    align-items: center;
}

.chart-card .chip {
    white-space: nowrap;
}

.bar-meta strong {
    min-width: 44px;
    text-align: right;
}

@media (min-width: 1025px) and (max-width: 1499px), (max-height: 850px) and (min-width: 901px) {
    body {
        font-size: 14px;
    }

    .shell {
        grid-template-columns: 220px minmax(0, 1fr);
        min-height: 100vh;
    }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        padding: 16px 14px;
        gap: 12px;
        overflow-y: auto;
    }

    .sidebar h1 {
        font-size: 20px;
        line-height: 1.15;
    }

    .sidebar p {
        margin: 0;
    }

    .nav {
        gap: 6px;
    }

    .nav a,
    .button {
        min-height: 38px;
        padding: 8px 12px;
        border-radius: 8px;
    }

    .user-card {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .main {
        min-width: 0;
        padding: 14px 18px 18px;
        gap: 12px;
    }

    .page-header {
        align-items: center;
        gap: 12px;
    }

    .page-header h2,
    .card h3 {
        line-height: 1.15;
    }

    .page-header p,
    .module-head p,
    .portal-intro p {
        margin: 4px 0 0;
    }

    .card {
        padding: 14px;
        border-radius: 10px;
        box-shadow: 0 10px 24px rgba(42, 61, 69, 0.06);
    }

    .portal-intro {
        grid-template-columns: minmax(240px, 0.75fr) minmax(420px, 1.25fr);
        align-items: start;
        gap: 10px 16px;
    }

    .portal-intro .module-toolbar {
        justify-content: flex-end;
    }

    .portal-intro .mobile-tip,
    .portal-intro .section-nav {
        grid-column: 1 / -1;
    }

    .section-nav {
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .section-nav a,
    .chip {
        padding: 6px 10px;
        font-size: 12px;
    }

    .survey-form {
        gap: 10px;
    }

    .survey-form .module-head {
        position: sticky;
        top: 0;
        z-index: 7;
        margin: -14px -14px 12px;
        padding: 10px 14px;
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid #e6dece;
    }

    .module-head,
    .section-title {
        gap: 10px;
    }

    .module-actions,
    .module-toolbar {
        gap: 8px;
    }

    .survey-form .two-up,
    .survey-form .three-up {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
    }

    .survey-form input,
    .survey-form select,
    .survey-form textarea {
        min-height: 36px;
        padding: 7px 9px;
        border-radius: 7px;
    }

    .survey-form label {
        gap: 4px;
        font-size: 13px;
    }

    .survey-form textarea {
        min-height: 72px;
    }

    .survey-form .repeater tbody {
        gap: 10px;
    }

    .survey-form .repeater tbody tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 12px;
        padding: 12px;
        border-radius: 10px;
    }

    .survey-form .repeater td::before {
        font-size: 11px;
    }

    .survey-form .repeater td.module-subsection {
        margin-top: 6px;
        padding: 8px 10px;
    }

    .geo-status {
        padding: 8px 10px;
        border-radius: 8px;
    }

    .module-save-row {
        margin-top: 10px;
    }

    .form-actions {
        bottom: 8px;
        z-index: 10;
        padding: 8px 10px;
        background: rgba(248, 242, 232, 0.96);
        border: 1px solid #ded6ca;
        border-radius: 10px;
    }
}

@media (min-width: 1500px) {
    .survey-form .two-up,
    .survey-form .three-up {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.dashboard-hero {
    order: -3;
}

.visual-overview {
    order: -2;
}

.dashboard-tabs {
    display: grid;
    gap: 18px;
    order: -1;
}

.dashboard-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px solid #e6dece;
    padding-bottom: 10px;
}

.dashboard-tab {
    border: 1px solid #d8cdbd;
    border-radius: 10px;
    background: #fffdfa;
    color: #275d63;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 10px 14px;
}

.dashboard-tab.is-active {
    background: #275d63;
    border-color: #275d63;
    color: #fff;
}

.dashboard-tab-panel {
    display: grid;
    gap: 16px;
}

.dashboard-tab-panel[hidden] {
    display: none;
}

.data-page-tabs {
    display: grid;
    gap: 14px;
}

.data-page-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.data-page-tab {
    align-items: center;
    border: 1px solid #d8cdbd;
    border-radius: 8px;
    background: #fffdfa;
    color: #275d63;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    justify-content: center;
    padding: 8px 11px;
    text-decoration: none;
}

.data-page-tab.is-active {
    background: #b14f2d;
    border-color: #b14f2d;
    color: #fff;
}

.data-page-panel[hidden] {
    display: none;
}

.module-save-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 14px;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.inline-delete {
    display: inline;
    margin: 0;
}

.inline-delete button {
    border: 0;
    background: none;
    color: #b42318;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

body {
    overflow-x: hidden;
}

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

    .nav a,
    .button,
    .hero-actions .button,
    .module-actions .button,
    .module-toolbar .button,
    .form-actions .button {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
        bottom: 0;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .module-toolbar,
    .module-actions,
    .hero-actions,
    .section-title,
    .page-header,
    .module-head {
        gap: 12px;
    }

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

    .bar-track {
        height: 14px;
    }
}

@media (max-width: 520px) {
    .nav {
        grid-template-columns: 1fr;
    }

    .main {
        padding: 14px;
    }

    .sidebar {
        padding: 16px;
    }

    .card {
        padding: 14px;
        border-radius: 14px;
    }

    .photo-gallery {
        grid-template-columns: 1fr;
    }
}

.form-page-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.portal-intro .form-page-tabs {
    display: none;
}

.form-page-tabs-side {
    position: sticky;
    top: 18px;
    flex-direction: column;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
}

.form-page-tabs a.is-active,
.form-page-tabs-side a.is-active {
    background: #fff;
    color: #1c6b4f;
    border-color: #cbd9d1;
    box-shadow: 0 8px 22px rgba(42, 61, 69, .08);
}

.form-page-content {
    min-width: 0;
}

.paged-survey-form .module-card[hidden] {
    display: none;
}

.paged-survey-form .module-toggle {
    display: none;
}

.page-actions {
    justify-content: flex-end;
    border-top: 1px solid #ded6ca;
    padding-top: 16px;
}

.final-actions {
    justify-content: flex-start;
}

@media (max-width: 900px) {
    .form-page-layout {
        grid-template-columns: 1fr;
    }

    .form-page-tabs-side {
        position: static;
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
    }
}

/* Final VAP top-navigation and full-width form layout overrides. */
.app-shell {
    display: block;
    min-height: 100vh;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 68px;
    padding: 10px clamp(18px, 3vw, 36px);
    background: #0f3d3e;
    color: #f7f0e4;
}

.app-brand,
.app-brand:hover {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #f7f0e4;
    text-decoration: none;
}

.app-brand span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .13);
    font-weight: 900;
}

.app-brand strong {
    font-size: 18px;
}

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

.top-actions a {
    min-height: 40px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .2);
    color: #f7f0e4;
    text-decoration: none;
    font-weight: 750;
    background: rgba(255, 255, 255, .08);
}

.app-shell .main {
    width: min(1760px, 100%);
    margin: 0 auto;
    padding: clamp(18px, 2.4vw, 34px);
}

.app-shell .sidebar {
    display: none;
}

.form-page-layout {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: clamp(18px, 2vw, 30px);
}

.form-page-tabs-side {
    top: 88px;
    gap: 8px;
    padding: 14px;
    background: #fff;
    border: 1px solid rgba(15, 61, 62, .13);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(42, 61, 69, .08);
}

.form-page-tabs-side a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #f7faf8;
    color: #17322c;
    font-weight: 750;
    line-height: 1.25;
    text-decoration: none;
}

.form-page-tabs-side a.is-active {
    background: #0f3d3e;
    color: #fff;
    border-color: #0f3d3e;
    box-shadow: none;
}

.portal-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.portal-intro .mobile-tip,
.portal-intro .form-page-tabs,
.final-actions {
    display: none;
}

@media (max-width: 900px) {
    .app-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
    }

    .top-actions a {
        flex: 1;
        text-align: center;
    }

    .form-page-layout {
        grid-template-columns: 1fr;
    }

    .form-page-tabs-side {
        position: static;
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
    }

    .form-page-tabs-side a {
        min-width: 190px;
    }
}
/* FCP-aligned VAP scheme: keep VAP workflow, match FCP's cleaner visual language. */
:root {
    --ink: #17322c;
    --muted: #65766f;
    --paper: #f4f7f4;
    --card: #fff;
    --line: #dce6e0;
    --green: #146c54;
    --green2: #0c4c3b;
    --mint: #dff3e9;
    --gold: #e8ae45;
    --danger: #a53a3a;
    --shadow: 0 12px 34px rgba(24, 55, 46, .08);
}

* {
    box-sizing: border-box;
}

body,
body.app-body,
body.guest-body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.shell.app-shell {
    min-height: 100vh;
    background: var(--paper);
}

.app-topbar,
.guest-topbar {
    height: 70px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(24px, calc((100vw - 1580px) / 2));
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: none;
}

.app-brand,
.guest-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
}

.app-brand span,
.guest-brand span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--green);
    color: #fff;
    font-weight: 800;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.app-brand strong,
.guest-brand strong {
    color: var(--ink);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 22px;
}

.top-actions a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 650;
}

.top-actions a:hover {
    color: var(--green);
}

.main,
.guest-main {
    width: 100%;
    max-width: 1580px;
    margin: 0 auto;
    padding: 26px 24px 64px;
}

.page-header,
.portal-intro,
.card,
.panel,
.module-card,
.summary-card,
.table-card,
.auth-card,
.login-card,
.dashboard-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.page-header,
.portal-intro {
    padding: 20px 24px;
    margin-bottom: 20px;
}

.page-header h1,
.page-header h2,
.portal-intro h1,
.portal-intro h2 {
    font-family: Georgia, serif;
    color: var(--ink);
    line-height: 1.2;
    letter-spacing: 0;
    margin: 5px 0;
}

.page-header p,
.portal-intro p,
.muted,
.hint,
small {
    color: var(--muted);
}

.button,
button.button,
input[type="submit"],
.btn,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--green);
    border: 1px solid var(--green);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    padding: 11px 17px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.button:hover,
button.button:hover,
input[type="submit"]:hover,
.btn:hover,
.primary-button:hover {
    background: var(--green2);
    border-color: var(--green2);
}

.button.secondary,
.btn.secondary,
.secondary-button {
    background: #fff;
    color: var(--green);
    border-color: var(--green);
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #cbd9d1;
    border-radius: 9px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(20, 108, 84, .12);
    border-color: var(--green);
}

label,
.field span,
.form-label {
    color: var(--ink);
    font-weight: 700;
}

.form-page-layout {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.form-page-tabs-side {
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 0 6px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    counter-reset: vap-page;
}

.form-page-tabs-side a {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 46px;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    color: var(--ink);
    background: transparent;
    text-decoration: none;
    font-weight: 650;
    line-height: 1.25;
    box-shadow: none;
}

.form-page-tabs-side a::before {
    counter-increment: vap-page;
    content: counter(vap-page);
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e5ece8;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.form-page-tabs-side a:hover,
.form-page-tabs-side a.is-active {
    background: #fff;
    box-shadow: 0 3px 14px rgba(20, 60, 48, .07);
}

.form-page-tabs-side a.is-active {
    color: var(--green);
}

.form-page-tabs-side a.is-active::before {
    background: var(--green);
    color: #fff;
}

.portal-intro .form-page-tabs,
.form-page-tabs {
    display: none !important;
}

.form-page-panel,
.module-form,
.survey-form,
.form-section {
    min-width: 0;
}

.form-page,
.form-section,
.survey-section {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow);
}

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

.field,
.form-field {
    margin-bottom: 14px;
}

.field.wide,
.wide,
.full-width {
    grid-column: 1 / -1;
}

.form-actions,
.page-actions,
.save-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
}

.form-page .form-actions,
.module-form > .form-actions {
    position: sticky;
    bottom: 10px;
    z-index: 9;
    padding: 12px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.flash {
    padding: 12px 15px;
    border-radius: 10px;
    background: var(--mint);
    color: var(--green2);
    margin-bottom: 20px;
}

.flash.error,
.flash-danger {
    background: #fae5e5;
    color: var(--danger);
}

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

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

th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}

.badge.complete,
.status-complete {
    background: var(--mint);
    color: var(--green2);
}

@media (max-width: 850px) {
    .app-topbar,
    .guest-topbar {
        height: auto;
        min-height: 70px;
        padding: 12px 16px;
        gap: 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        gap: 14px;
        flex-wrap: wrap;
    }

    .main,
    .guest-main {
        padding: 25px 16px;
    }

    .form-page-layout,
    .survey-form .two-up,
    .survey-form .three-up,
    .form-grid,
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-page-tabs-side {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        max-height: none;
        padding: 0 0 8px;
    }

    .form-page-tabs-side a {
        min-width: max-content;
    }

    .form-actions,
    .page-actions,
    .save-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* VAP data collection layout repair: keep the side tabs visible and let the page use the workspace. */
.paged-survey-form .form-page-layout {
    display: grid !important;
    grid-template-columns: 260px minmax(0, 1fr) !important;
    gap: 22px !important;
    align-items: start !important;
    width: 100% !important;
}

.paged-survey-form .form-page-tabs-side {
    display: flex !important;
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
}

.paged-survey-form .form-page-content {
    grid-column: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
}

.paged-survey-form .form-page-content > .card,
.paged-survey-form .form-page-content > .module-card {
    width: 100% !important;
    max-width: none !important;
}

.paged-survey-form .form-page-tabs:not(.form-page-tabs-side),
.portal-intro .form-page-tabs {
    display: none !important;
}

.paged-survey-form .survey-form .two-up,
.paged-survey-form .survey-form .three-up,
.paged-survey-form .two-up,
.paged-survey-form .three-up {
    grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
}

.paged-survey-form input,
.paged-survey-form select,
.paged-survey-form textarea {
    min-width: 0 !important;
}

@media (max-width: 900px) {
    .paged-survey-form .form-page-layout {
        grid-template-columns: 1fr !important;
    }

    .paged-survey-form .form-page-tabs-side,
    .paged-survey-form .form-page-content {
        grid-column: 1 !important;
    }

    .paged-survey-form .form-page-tabs-side {
        flex-direction: row !important;
    }

    .paged-survey-form .two-up,
    .paged-survey-form .three-up {
        grid-template-columns: 1fr !important;
    }
}
