:root {
    --primary: #0d5c46;
    --primary-dark: #0b4939;
    --primary-soft: #eaf5f1;
    --secondary: #f4b942;
    --secondary-soft: #fff4d7;
    --bg: #f4f7f6;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #667085;
    --border: #e1e8e5;
    --success: #1f9d72;
    --success-soft: #eafaf5;
    --warning: #c77d00;
    --warning-soft: #fff1d8;
    --danger: #d74949;
    --danger-soft: #fdecec;
    --shadow: 0 10px 28px rgba(15, 41, 32, 0.07);
    --shadow-hover: 0 14px 32px rgba(15, 41, 32, 0.11);
    --radius-card: 20px;
    --radius-control: 11px;
    --focus-ring: 0 0 0 4px rgba(13, 92, 70, 0.12);
}

.request-action-form {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    min-width: max-content;
}

.request-action-form select,
.request-action-form input:not([type="hidden"]) {
    min-width: 9rem;
}

.request-action-form .btn {
    white-space: nowrap;
}

.resident-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    min-width: max-content;
}

.resident-action-form {
    display: inline-flex;
    margin: 0;
}

.resident-row-actions .btn {
    white-space: nowrap;
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
    min-height: 36px;
}

.resident-id-button {
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
    min-height: 36px;
    white-space: nowrap;
}

.resident-id-dialog {
    width: min(1000px, calc(100% - 2rem));
    max-height: 90vh;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--card);
    box-shadow: var(--shadow-hover);
}

.resident-id-dialog::backdrop {
    background: rgba(15, 41, 32, 0.6);
}

.resident-id-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.resident-id-dialog-header h3 {
    margin: 0;
}

.resident-id-dialog iframe {
    display: block;
    width: 100%;
    height: min(72vh, 760px);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f4f7f6;
}

.profile-management-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.profile-management-actions label {
    cursor: pointer;
}

.resident-profile-actions {
    flex-wrap: nowrap;
}

.resident-profile-actions form {
    margin: 0;
}

.resident-profile-actions .btn {
    min-height: 42px;
    white-space: nowrap;
}

.resident-request-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.resident-request-actions form {
    display: inline-flex;
    flex: 0 0 auto;
    margin: 0;
}

.resident-request-actions .btn {
    min-height: 36px;
    padding: 0.5rem 0.8rem;
    white-space: nowrap;
}

.household-member-count {
    display: inline-block;
    padding: 0.75rem 0.85rem;
    color: var(--primary-dark);
    background: var(--primary-soft);
    border: 1px solid rgba(13, 92, 70, 0.12);
    border-radius: var(--radius-control);
    font-weight: 700;
}

.household-member-list {
    display: grid;
    gap: 1rem;
    margin-top: 0.75rem;
}

.household-member-entry {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.household-member-entry legend {
    padding: 0 0.4rem;
    color: var(--primary-dark);
    font-weight: 700;
}

.household-member-fields {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.household-member-fields .field {
    min-width: 0;
}

.household-member-table-wrap {
    max-width: 36rem;
}

.household-member-table {
    min-width: 520px;
}

.household-member-table th,
.household-member-table td {
    padding: 0.55rem;
    font-size: 0.82rem;
}

.request-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
}

.request-preview-dialog {
    width: min(560px, calc(100% - 2rem));
    max-height: min(80vh, 720px);
    padding: 1.5rem;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-hover);
}

.request-preview-dialog::backdrop {
    background: rgba(15, 41, 32, 0.55);
}

.request-preview-list {
    display: grid;
    grid-template-columns: minmax(110px, 0.35fr) 1fr;
    gap: 0.7rem 1rem;
    margin: 1.25rem 0;
}

.request-preview-list dt {
    color: var(--muted);
    font-weight: 700;
}

.request-preview-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

* {
    box-sizing: border-box;
}

img,
svg {
    max-width: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding-left: 250px;
    min-height: 100vh;
    font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at 8% 0%, rgba(16, 119, 89, 0.08), transparent 28rem),
        linear-gradient(135deg, #f3f8f5 0%, #f7f9fb 55%, #f3f7f6 100%);
    color: var(--text);
    animation: pageFade 0.45s ease;
    line-height: 1.55;
}

a {
    color: inherit;
    text-decoration: none;
}

@keyframes pageFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes homeReveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-page .home-hero .hero-copy,
.home-page .home-hero .hero-card,
.home-page .home-coverage .panel {
    animation: homeReveal 0.65s ease both;
}

.home-page .home-hero .hero-card {
    animation-delay: 0.16s;
}

.home-page .quick-grid .metric-box {
    animation: homeReveal 0.55s ease both;
}

.home-page .quick-grid .metric-box:nth-child(1) {
    animation-delay: 0.2s;
}

.home-page .quick-grid .metric-box:nth-child(2) {
    animation-delay: 0.3s;
}

.home-page .quick-grid .metric-box:nth-child(3) {
    animation-delay: 0.4s;
}

.home-page .home-coverage .panel {
    animation-delay: 0.32s;
}

a,
button,
input,
select,
textarea {
    transition: color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease,
        border-color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.panel:hover,
.form-card:hover,
.hero-card:hover,
.stat-card:hover,
.metric-box:hover,
.barangay-item:hover {
    box-shadow: var(--shadow-hover);
}

button:active,
.btn:active,
a:active,
input:active,
select:active,
textarea:active {
    transform: scale(0.98);
}

button.is-pressed,
.btn.is-pressed,
a.is-pressed {
    transform: scale(0.98);
}

form.is-submitting,
form.is-submitting .btn,
form.is-submitting button {
    opacity: 0.9;
    pointer-events: none;
}

form.is-submitting .btn {
    transform: scale(0.99);
}

.system-loading {
    position: fixed;
    inset: 0 250px 0 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: rgba(244, 247, 246, 0.76);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    pointer-events: none;
}

.system-loading.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.system-loading-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.35rem;
    color: var(--primary-dark);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-hover);
    font-weight: 700;
}

.system-loading-spinner {
    width: 25px;
    height: 25px;
    border: 3px solid var(--primary-soft);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: systemLoadingSpin 0.75s linear infinite;
}

@keyframes systemLoadingSpin {
    to {
        transform: rotate(360deg);
    }
}

.table-wrap table tbody tr {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.table-wrap table tbody tr:hover {
    background: rgba(13, 92, 70, 0.02);
}

.table-wrap table tbody tr:hover td {
    background: rgba(13, 92, 70, 0.025);
}

.container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}

.hero-shell > *,
.auth-shell > *,
.two-column > *,
.dashboard-grid > *,
.quick-grid > * {
    min-width: 0;
}

h1,
h2,
h3,
h4 {
    color: var(--primary-dark);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.45rem, 2vw, 1.8rem);
}

h3 {
    font-size: 1.2rem;
}

p {
    line-height: 1.65;
}

.site-header {
    background: rgba(11, 73, 57, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 8px 0 24px rgba(11, 73, 57, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1.25rem;
    width: auto;
    min-height: 100%;
    margin: 0;
    padding: 1.35rem 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.35;
    padding: 0.15rem 0.25rem 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,0.14);
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f4b942, #f7e7a2);
    display: grid;
    place-items: center;
    color: var(--primary-dark);
    font-size: 1.3rem;
    box-shadow: 0 8px 18px rgba(244, 185, 66, 0.35);
}

.nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    flex-wrap: nowrap;
    flex: 1;
}

.nav-links::before {
    content: "MENU";
    padding: 0.35rem 0.85rem 0.45rem;
    color: rgba(255,255,255,0.52);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.nav-links a {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.9);
    padding: 0.72rem 0.85rem;
    border-radius: 11px;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
    font-size: 0.91rem;
    font-weight: 600;
}

.nav-links .nav-logo-form {
    margin: 0;
}

.nav-links .nav-action {
    display: flex;
    align-items: center;
    width: 100%;
    color: rgba(255,255,255,0.9);
    padding: 0.72rem 0.85rem;
    border-radius: 11px;
    cursor: pointer;
    font-size: 0.91rem;
    font-weight: 600;
}

.nav-links .nav-action:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    transform: translateX(2px);
}

.nav-links a.nav-logout {
    margin-top: auto;
    justify-content: center;
    background: #a92f37;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    box-shadow: 0 5px 14px rgba(0,0,0,0.14);
}

.nav-links a.nav-logout:hover {
    background: #92262e;
    color: #fff;
    transform: none;
}

.nav-links a.notification-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.3rem;
    padding: 0.62rem 0.75rem;
    border-radius: 11px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.95);
    font-size: 0.82rem;
    line-height: 1.2;
}

.notification-count {
    margin-left: auto;
}

.nav-links a.notification-link:hover,
.nav-links a.notification-link:focus-visible {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

.notification-icon {
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.notification-count {
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--secondary);
    color: var(--primary-dark);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 2px 7px rgba(244,185,66,0.25);
}

.hero {
    padding: 4.5rem 0 2rem;
}

.hero-shell {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    align-items: center;
}

.hero-copy h1 {
    font-size: clamp(2.15rem, 4vw, 3.65rem);
    margin: 0 0 1rem;
    line-height: 1.04;
    color: var(--primary-dark);
    letter-spacing: -0.04em;
}

.hero-copy p {
    font-size: 1.08rem;
    color: var(--muted);
    margin-bottom: 1.6rem;
    max-width: 60ch;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font: inherit;
    padding: 0.76rem 1.05rem;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
    letter-spacing: 0.01em;
    font-size: 0.92rem;
}

.btn-compact {
    padding: 0.45rem 0.7rem;
    font-size: 0.8rem;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #147354);
    color: #fff;
    box-shadow: 0 5px 12px rgba(13, 92, 70, 0.16);
}

.btn-primary:hover {
    box-shadow: 0 9px 18px rgba(13, 92, 70, 0.22);
}

.btn-secondary {
    background: #fff;
    color: var(--primary-dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover,
.btn-outline {
    background: rgba(13, 92, 70, 0.04);
    color: var(--primary-dark);
    border: 1px solid rgba(13, 92, 70, 0.15);
}

.btn-secondary:hover,
.btn-outline:hover {
    box-shadow: 0 5px 12px rgba(13, 92, 70, 0.08);
}

.btn:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.table-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-box {
    min-width: 220px;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: #fff;
    color: var(--text);
    font: inherit;
}

.status-filter {
    border-radius: var(--radius-control);
    border: 1px solid var(--border);
    padding: 0.75rem 0.9rem;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.metric-box {
    background: rgba(13, 92, 70, 0.04);
    border: 1px solid rgba(13, 92, 70, 0.1);
    padding: 1rem;
    border-radius: 14px;
}

.metric-box strong {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.metric-box span {
    color: var(--muted);
    font-size: 0.92rem;
}

.hero-card,
.panel,
.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.panel,
.form-card,
.hero-card,
.stat-card,
.metric-box,
.barangay-item {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.hero-card {
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(238,247,242,0.96));
    border: 1px solid rgba(13, 92, 70, 0.08);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.info-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.9rem;
}

.info-list li {
    display: flex;
    gap: 0.9rem;
    align-items: start;
    background: linear-gradient(180deg, #ffffff, #f5faf8);
    padding: 0.9rem 1rem;
    border-radius: 13px;
    border: 1px solid rgba(13, 92, 70, 0.06);
}

.info-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(31, 157, 114, 0.12);
    color: var(--success);
    font-weight: 700;
    flex-shrink: 0;
}

.main-section, .auth-page {
    padding: 1.6rem 0 4rem;
}

.auth-shell {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 1.5rem;
    align-items: stretch;
}

.side-panel {
    background: linear-gradient(135deg, #0d5c46 0%, #0f7a5a 100%);
    color: white;
    border-radius: 24px;
    padding: 2rem;
    min-height: 620px;
    box-shadow: 0 24px 42px rgba(13, 92, 70, 0.18);
    position: relative;
    overflow: hidden;
}

.side-panel::before {
    content: "";
    position: absolute;
    inset: -80px -30px auto auto;
    width: 220px;
    height: 220px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.side-panel h2 {
    font-size: clamp(2rem, 3vw, 2.6rem);
    margin: 0 0 0.8rem;
    color: #fff;
    position: relative;
    z-index: 1;
}

.side-panel p,
.side-panel li {
    position: relative;
    z-index: 1;
}

.side-panel ul {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    display: grid;
    gap: 1rem;
}

.side-panel li {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    opacity: 0.96;
}

.tick {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
}

.form-card {
    padding: clamp(1.25rem, 3vw, 2rem);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(13, 92, 70, 0.08);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.form-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-dark);
    letter-spacing: -0.025em;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.field label {
    font-weight: 700;
    color: var(--text);
    font-size: 0.88rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-control);
    padding: 0.75rem 0.85rem;
    font: inherit;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder,
.field textarea::placeholder,
.search-box::placeholder {
    color: #98a2a0;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(13, 92, 70, 0.5);
    box-shadow: var(--focus-ring);
}

.inline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-top: 0.4rem;
    font-size: 0.92rem;
    color: var(--muted);
}

.notice {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.notice.error {
    background: var(--danger-soft);
    border: 1px solid rgba(215, 73, 73, 0.2);
    color: #8a1f1f;
}

.notice.success {
    background: var(--success-soft);
    border: 1px solid rgba(31, 157, 114, 0.2);
    color: #0d5c46;
}

.announcements-panel {
    margin-bottom: 1.5rem;
}

.announcement-form {
    margin-top: 1rem;
}

.announcement-form textarea {
    min-height: 110px;
}

.announcement-list {
    display: grid;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.announcement-list > h4 {
    margin: 0;
    color: var(--primary-dark);
}

.announcement-item {
    padding: 1rem;
    border: 1px solid rgba(13, 92, 70, 0.1);
    border-left: 3px solid var(--secondary);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f8fbfa);
}

.announcement-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.announcement-item h4 {
    margin: 0;
    color: var(--primary-dark);
}

.announcement-item p {
    margin: 0.65rem 0;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.announcement-actions {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.announcement-edit {
    min-width: 0;
}

.announcement-edit summary {
    display: inline-flex;
    list-style: none;
}

.announcement-edit summary::-webkit-details-marker {
    display: none;
}

.announcement-edit-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.8rem;
}

.announcement-edit-form .field {
    margin: 0;
}

.announcement-delete-form {
    display: inline-flex;
    margin: 0;
}

.announcement-audience {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.workflow-panel {
    background: linear-gradient(180deg, rgba(244, 249, 247, 0.95), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(13, 92, 70, 0.08);
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.workflow-step {
    position: relative;
    padding: 1.1rem 1rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.04);
}

.workflow-step strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-size: 0.96rem;
}

.workflow-step p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.92rem;
}

.workflow-step-primary {
    background: linear-gradient(135deg, rgba(13, 92, 70, 0.06), rgba(255, 255, 255, 1));
}

.workflow-step-secondary {
    background: linear-gradient(135deg, rgba(244, 185, 66, 0.08), rgba(255, 255, 255, 1));
}

.workflow-step-accent {
    background: linear-gradient(135deg, rgba(92, 116, 255, 0.08), rgba(255, 255, 255, 1));
}

.workflow-step-success {
    background: linear-gradient(135deg, rgba(31, 157, 114, 0.08), rgba(255, 255, 255, 1));
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.management-shell {
    display: grid;
    gap: 1.5rem;
}

.management-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(13, 92, 70, 0.08);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.barangay-assignment-form,
.barangay-admin-actions,
.barangay-password-reset-form {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.65rem;
    margin: 0;
    min-width: max-content;
}

.barangay-assignment-form {
    justify-content: flex-end;
    width: 100%;
    min-width: 0;
}

.barangay-assignment-form select,
.barangay-password-reset-form input:not([type="hidden"]) {
    min-width: 13rem;
    min-height: 38px;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: #fff;
    color: var(--text);
    font: inherit;
}

.barangay-assignment-form select {
    flex: 1 1 auto;
}

.barangay-password-reset-form input:not([type="hidden"]) {
    min-width: 9rem;
}

.barangay-admin-actions .btn,
.barangay-assignment-form .btn {
    min-height: 38px;
    white-space: nowrap;
}

.resident-profile-panel {
    scroll-margin-top: 8rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.1rem 1rem;
    box-shadow: var(--shadow);
}

.stat-card .label {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 0.4rem;
}

.stat-card .value {
    font-size: clamp(1.65rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--primary-dark);
}

.two-column {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.panel {
    padding: clamp(1rem, 2.5vw, 1.4rem);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(13, 92, 70, 0.08);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.panel h3 {
    margin-top: 0;
    color: var(--primary-dark);
}

.table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f4f8f6;
    color: var(--primary-dark);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

td {
    font-size: 0.92rem;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.badge.pending {
    background: rgba(199, 125, 0, 0.12);
    color: var(--warning);
}

.badge.approved {
    background: rgba(31, 157, 114, 0.12);
    color: var(--success);
}

.badge.ready {
    background: rgba(13, 92, 70, 0.12);
    color: var(--primary-dark);
}

.badge.picked_up {
    background: rgba(72, 118, 255, 0.12);
    color: #2148b3;
}

.badge.rejected {
    background: rgba(215, 73, 73, 0.12);
    color: var(--danger);
}

.barangay-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.barangay-coverage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
}

.barangay-coverage-card {
    min-width: 0;
    padding: 1rem;
    background: linear-gradient(145deg, #fff, #f5faf8);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 14px;
    box-shadow: 0 5px 14px rgba(15, 41, 32, 0.04);
}

.barangay-coverage-card h4 {
    margin: 0 0 0.8rem;
    font-size: 0.96rem;
    overflow-wrap: anywhere;
}

.barangay-coverage-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.barangay-coverage-metrics > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem;
    background: var(--primary-soft);
    border-radius: 10px;
}

.barangay-coverage-metrics strong {
    color: var(--primary-dark);
    font-size: 1.35rem;
    line-height: 1.1;
}

.barangay-coverage-metrics span,
.barangay-admin-status {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.barangay-coverage-gender {
    margin: 0.7rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.barangay-admin-status {
    display: inline-block;
    margin-top: 0.65rem;
    padding: 0.25rem 0.5rem;
    color: #8a1f1f;
    background: var(--danger-soft);
    border-radius: 999px;
}

.barangay-item {
    background: rgba(13, 92, 70, 0.06);
    border: 1px solid rgba(13, 92, 70, 0.1);
    color: var(--primary-dark);
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.muted {
    color: var(--muted);
}

.password-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f7f8fa;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .hero-shell,
    .auth-shell,
    .two-column {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .household-member-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .side-panel {
        min-height: 0;
        padding: 1.6rem;
    }
}

@media (max-width: 960px) {
    .system-loading {
        inset: 0;
    }

    body {
        padding-left: 0;
    }

    .site-header {
        position: sticky;
        inset: auto;
        width: 100%;
        height: auto;
        overflow: visible;
        box-shadow: 0 6px 20px rgba(11, 73, 57, 0.14);
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .header-inner {
        width: min(1200px, calc(100% - 40px));
        min-height: 0;
        margin: 0 auto;
        padding: 0.75rem 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .brand {
        width: 100%;
        justify-content: center;
        padding: 0;
        border-bottom: 0;
    }

    .nav-links::before {
        display: none;
    }

    .nav-links {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
        flex: 0 0 auto;
        gap: 0.35rem;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.15rem 0 0.3rem;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.35) transparent;
        overscroll-behavior-x: contain;
    }

    .nav-links a {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 0.55rem 0.75rem;
        border-radius: 999px;
        font-size: 0.86rem;
    }

    .nav-links a.nav-logout {
        margin-top: 0;
        margin-left: auto;
    }

    .nav-links .nav-logo-form {
        flex: 0 0 auto;
    }

    .nav-links .nav-action {
        width: auto;
        min-height: 42px;
        padding: 0.55rem 0.75rem;
        border-radius: 999px;
        font-size: 0.86rem;
        white-space: nowrap;
    }

    .nav-links a:hover {
        transform: none;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 24px, 1200px);
    }

    .header-inner {
        width: min(100% - 24px, 1200px);
        padding: 0.65rem 0;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        flex: 0 0 auto;
    }

    .nav-links a {
        min-height: 40px;
        padding: 0.5rem 0.65rem;
        font-size: 0.82rem;
    }

    .nav-links a.nav-logout {
        margin-left: 0.5rem;
    }

    .nav-links .nav-action {
        min-height: 40px;
        padding: 0.5rem 0.65rem;
        font-size: 0.82rem;
    }

    .hero {
        padding-top: 2.5rem;
    }

    .hero-shell {
        gap: 1rem;
    }

    .dashboard-grid,
    .form-row,
    .quick-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .household-member-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .panel {
        padding: 1rem;
    }

    .filter-row,
    .table-tools {
        align-items: stretch;
    }

    .section-header-row {
        align-items: flex-start;
    }

    .table-tools {
        width: 100%;
    }

    .search-box,
    .status-filter,
    .table-tools input,
    .table-tools select {
        width: 100%;
        min-width: 0;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .btn {
        min-height: 44px;
    }

    .table-wrap table {
        min-width: 640px;
    }

    .announcement-item-heading {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .site-header,
    .nav-links,
    .btn,
    form,
    .filter-row,
    .logout-btn {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .panel,
    .stat-card,
    .form-card,
    .hero-card {
        box-shadow: none;
        border: 1px solid #d9d9d9;
    }

    .container {
        width: 100%;
        max-width: 100%;
    }
}
