:root {
    color-scheme: light;
    --ink: #25372f;
    --muted: #78877b;
    --green: #377c5a;
    --green-dark: #285d43;
    --green-deep: #1d4935;
    --pale: #eaf1e4;
    --cream: #fbf8ef;
    --line: #e8e9de;
    --paper: #fffefa;
    --canvas: #f5f7f1;
    --gold: #d7a958;
    --red: #b72835;
    --red-dark: #921f2a;
    --red-soft: #fbefec;
    --red-line: #f0d7d2;
    --danger: #a33a32;
    --shadow: 0 16px 42px #2943310b;
    font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.6; }
body::before { position: fixed; inset: 0; z-index: -1; pointer-events: none; content: ""; opacity: .28; background-image: radial-gradient(#8aa58b 0.7px, transparent .7px); background-size: 19px 19px; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
button, input, textarea, select { font: inherit; }
.icon { width: 19px; height: 19px; flex: 0 0 19px; fill: none; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 25px; min-height: 78px; padding: 11px max(26px, calc((100% - 1160px) / 2)); border-bottom: 1px solid #e8e9decc; background: #fffefaed; backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--green-deep); text-decoration: none; }
.brand:hover { color: var(--green-deep); }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 15px; color: white; background: linear-gradient(145deg, #ce4a4b, #9f202d); box-shadow: 0 7px 17px #a3263236; }
.brand-mark .icon { width: 23px; height: 23px; }
.brand-copy { display: grid; line-height: 1.2; }
.brand-copy strong { font-size: 1.1rem; letter-spacing: -.04em; white-space: nowrap; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: .68rem; }
.main-nav, .guest-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 11px; color: #647367; font-size: .88rem; font-weight: 650; transition: background .2s, color .2s, transform .2s; }
.main-nav a:hover { color: var(--green-dark); background: var(--pale); transform: translateY(-1px); }
.main-nav a .icon { width: 17px; height: 17px; flex-basis: 17px; }
.nav-dropdown { position: relative; }
.nav-dropdown summary { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 11px; color: #647367; font-size: .88rem; font-weight: 650; cursor: pointer; list-style: none; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary:hover, .nav-dropdown[open] summary { color: var(--green-dark); background: var(--pale); }
.nav-dropdown summary .icon { width: 17px; height: 17px; flex-basis: 17px; }
.dropdown-caret { color: #88948a; font-size: .8rem; }
.nav-dropdown-menu { position: absolute; z-index: 25; top: calc(100% + 7px); left: 0; min-width: 185px; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: #fffefa; box-shadow: 0 12px 30px #2639231c; }
.main-nav .nav-dropdown-menu a { display: flex; padding: 9px 11px; border-radius: 9px; font-size: .83rem; white-space: nowrap; }
.nav-dropdown summary:focus-visible, .nav-dropdown-menu a:focus-visible { outline: 3px solid #9db89b; outline-offset: 2px; }
.resident-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 180px; }
.resident-actions form { margin: 0; }
.resident-status-inactive { border-color: #f0d7d2; color: #963b35; background: #fff5f1; }
.danger-button { color: #963b35; border-color: #f0d7d2; background: #fff5f1; box-shadow: none; }
.danger-button:hover { color: #792d29; background: #fbe9e3; }
.nav-user { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: .84rem; }
.user-greeting { max-width: 150px; overflow: hidden; color: #53665a; text-overflow: ellipsis; }
.role { padding: 4px 10px; border: 1px solid #dfe9d9; border-radius: 24px; color: var(--green-dark); background: #f0f5e9; font-size: .71rem; font-weight: 700; }
.inline { display: inline; }
.logout-button { display: inline-flex; align-items: center; gap: 6px; padding: 8px; border: 0; border-radius: 9px; color: #7d897f; background: transparent; font-weight: 650; cursor: pointer; }
.logout-button:hover { color: var(--danger); background: #fbefec; }
.logout-button .icon { width: 17px; height: 17px; flex-basis: 17px; }
.guest-nav { gap: 17px; font-size: .92rem; font-weight: 650; }
.container { width: min(100% - 36px, 840px); min-height: calc(100vh - 180px); margin: 35px auto 70px; }
.page-heading, .admin-hero, .staff-dashboard-hero { position: relative; display: flex; min-height: 132px; align-items: center; justify-content: space-between; gap: 20px; margin: 4px 0 19px; padding: 24px 28px; border: 1px solid #dfe8d8; border-radius: 21px; background: linear-gradient(110deg, #fffdf8, #f1f5eb); }
.page-heading > div:first-child, .admin-hero > div:first-child, .staff-dashboard-hero > div:first-child { min-width: 0; flex: 1; }
.page-heading h1, .admin-hero h1, .staff-dashboard-hero h1 { margin: 3px 0 7px; font-size: clamp(1.75rem, 4vw, 2.15rem); }
.page-heading p, .admin-hero p, .staff-dashboard-hero p { margin: 0; color: var(--muted); font-size: .9rem; }
.page-heading .eyebrow, .admin-hero .eyebrow, .staff-dashboard-hero .eyebrow { display: block; }
.page-heading .staff-actions { justify-content: flex-end; }
.section-heading { margin: 30px 2px 14px; }
.section-heading h2 { margin: 2px 0 0; font-size: 1.24rem; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: "Trebuchet MS", "Segoe UI", sans-serif; }
h1 { margin-bottom: 7px; font-size: clamp(1.75rem, 4vw, 2.45rem); letter-spacing: -.055em; line-height: 1.18; }
h2 { margin-bottom: 13px; font-size: 1.15rem; letter-spacing: -.035em; }
.eyebrow { margin-bottom: 4px; color: var(--green); font-size: .71rem; font-weight: 800; letter-spacing: .14em; }
.muted { color: var(--muted); }
.small { font-size: .81rem; }
.text-link { font-size: .86rem; font-weight: 700; }
.card { margin-bottom: 17px; padding: 22px; border: 1px solid #e8e9de; border-radius: 19px; background: var(--paper); box-shadow: var(--shadow); }
.card p:last-child { margin-bottom: 0; }
.hero-panel { position: relative; min-height: 300px; display: flex; align-items: center; overflow: hidden; padding: 35px 36px; border: 1px solid #eadfd1; border-radius: 25px; background: linear-gradient(105deg, #fffdfa 0%, #fcf4ec 49%, #e8ecdf 100%); box-shadow: 0 20px 48px #6b493312; }
.hero-copy { position: relative; z-index: 2; width: min(68%, 500px); }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 13px; padding: 6px 11px; border: 1px solid #eddbd1; border-radius: 30px; color: var(--red-dark); background: #ffffffd9; font-size: .67rem; font-weight: 800; letter-spacing: .1em; }
.hero-kicker .icon { width: 15px; height: 15px; flex-basis: 15px; }
.hero-copy h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); }
.hero-copy h1 span { color: var(--red); }
.hero-copy p { max-width: 360px; margin: 12px 0 18px; color: #69786d; font-size: .96rem; }
.hero-link { display: inline-flex; align-items: center; gap: 8px; color: var(--green-dark); font-size: .86rem; font-weight: 800; }
.hero-link span { font-size: 1.2rem; transition: transform .2s; }
.hero-link:hover span { transform: translateX(4px); }
.hero-art { position: absolute; z-index: 0; inset: 0 0 0 auto; width: 58%; opacity: .4; background: url("teras-hero.svg") center right / contain no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 43%); mask-image: linear-gradient(90deg, transparent 0%, #000 43%); }
.composer { padding: 19px 21px 16px; }
.composer-title { display: flex; align-items: center; gap: 12px; margin: 1px 0 14px; }
.composer-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 15px; color: var(--green); background: #edf3e6; }
.composer-icon .icon { width: 21px; height: 21px; }
.composer-title h2 { margin: 0 0 2px; font-size: 1rem; }
.composer-title p { margin: 0; }
label { display: block; margin: 0 0 14px; color: #405248; font-size: .88rem; font-weight: 650; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; border: 1px solid #e0e5d9; border-radius: 11px; outline: none; color: var(--ink); background: #fffefa; transition: border-color .2s, box-shadow .2s, background .2s; }
input:focus, textarea:focus, select:focus { border-color: #7da784; background: white; box-shadow: 0 0 0 4px #6794721d; }
input[type="file"] { padding: 8px; font-size: .82rem; }
input[type="checkbox"] { width: auto; margin: 0; }
textarea { resize: vertical; }
.composer textarea { width: 100%; min-height: 80px; border-color: transparent; background: #f7f8f2; }
.composer textarea:focus { border-color: #9ab99c; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; border: 1px solid transparent; border-radius: 11px; color: white; background: linear-gradient(135deg, #c94346, #a32230); box-shadow: 0 5px 12px #a3263220; font-size: .87rem; font-weight: 750; cursor: pointer; transition: transform .18s, box-shadow .18s, filter .18s; }
.button:hover { color: white; filter: saturate(1.12); box-shadow: 0 8px 18px #a3263235; transform: translateY(-1px); }
.button.secondary { border-color: #e1e9d9; color: var(--green-dark); background: #f3f6ed; box-shadow: none; }
.button.secondary:hover { color: var(--green-dark); background: #eaf1e2; }
.form-row, .post-actions, .post-author, .profile-summary, .document-links { display: flex; align-items: center; gap: 12px; }
.form-row { justify-content: space-between; }
.file-label { margin: 0; color: #6d7b70; font-size: .81rem; font-weight: 500; }
.inline-label { display: flex; align-items: center; gap: 8px; width: fit-content; }
.inline-label select { width: auto; margin: 0; }
.post { padding: 20px 22px 13px; }
.post-author { margin-bottom: 14px; }
.avatar { width: 42px; height: 42px; flex: 0 0 42px; object-fit: cover; border: 2px solid #f0f3e8; border-radius: 50%; }
.avatar-placeholder { display: grid; place-items: center; color: var(--green-dark); background: var(--pale); font-size: 1.05rem; font-weight: 800; }
.large-avatar { width: 76px; height: 76px; flex-basis: 76px; }
.post-body { margin: 0 0 12px; overflow-wrap: anywhere; }
.post-image { display: block; max-width: 100%; max-height: 540px; margin: 12px auto; border-radius: 14px; object-fit: contain; }
.post-quota { margin: 5px 0 0; color: var(--green-dark); font-size: .75rem; font-weight: 700; }
.pin-quota { display: flex; align-items: center; gap: 5px; color: var(--red-dark); }
.pin-quota .icon { width: 14px; height: 14px; flex-basis: 14px; }
.pinned-label { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 6px 10px; border: 1px solid #f0d7d2; border-radius: 30px; color: var(--red-dark); background: linear-gradient(120deg, #fff4f0, #fff9ee); font-size: .67rem; font-weight: 850; letter-spacing: .08em; }
.pinned-label .icon { width: 14px; height: 14px; flex-basis: 14px; }
.pin-button { margin-left: auto; color: var(--red-dark); }
.pin-button .icon { width: 16px; height: 16px; flex-basis: 16px; }
.post.pinned-post { border-color: #e9c8bd; box-shadow: 0 14px 36px #a3263210; }
.post-actions { flex-wrap: wrap; }
.post-actions form { margin: 0; }
.feed-loader { display: flex; min-height: 62px; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 20px; color: var(--muted); font-size: .84rem; text-align: center; }
.feed-end { margin: 18px 0 28px; color: var(--muted); font-size: .82rem; text-align: center; }
.announcement-label { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 12px; padding: 5px 9px; border: 1px solid var(--red-line); border-radius: 20px; color: var(--red-dark); background: var(--red-soft); font-size: .67rem; font-weight: 850; letter-spacing: .08em; }
.post-stats { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
.post-actions { padding: 8px 0; border-bottom: 1px solid var(--line); }
.link-button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 0; border-radius: 8px; color: var(--green); background: transparent; font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.link-button:hover { color: var(--green-dark); background: #edf3e9; }
.comments { padding-top: 10px; }
.comment { margin: 6px 0; padding: 8px 11px; border-radius: 10px; background: #f6f7f1; font-size: .88rem; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; margin-top: 11px; }
.comment-form input { margin: 0; }
.small-button { padding: 8px 12px; white-space: nowrap; font-size: .82rem; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 1px 21px; color: var(--muted); font-size: .8rem; }
.pagination-controls { display: flex; align-items: center; gap: 8px; }
.pagination-current { padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; color: #627366; background: #fffefa; font-size: .76rem; font-weight: 700; }
.pagination-link { display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border: 1px solid #e4e9dc; border-radius: 9px; color: var(--green-dark); background: #fffefa; font-size: .79rem; font-weight: 700; }
.pagination-link:hover { border-color: #b7cdb5; background: #f0f5eb; }
.pagination-link .icon { width: 15px; height: 15px; flex-basis: 15px; }
.count-pill { display: inline-flex; min-width: 25px; height: 25px; align-items: center; justify-content: center; margin-left: 5px; padding: 0 7px; border-radius: 20px; color: var(--green-dark); background: #edf3e6; font-size: .75rem; vertical-align: middle; }
.auth-card { max-width: 480px; margin: 50px auto; padding: 31px; border: 1px solid var(--line); border-radius: 21px; background: var(--paper); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.8rem; }
.auth-page { background: linear-gradient(135deg, #f8f6ef, #f2f4ec 52%, #f7efeb); }
.auth-page .container { width: min(100% - 44px, 1080px); min-height: calc(100vh - 163px); display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 28px; margin-bottom: 35px; }
.auth-page .container > .alert { width: min(100%, 560px); display: flex; align-items: center; gap: 11px; margin: 0 auto 14px; padding: 13px 17px; border-radius: 15px; box-shadow: 0 10px 28px #29433112; }
.auth-page .container > .alert::before { width: 29px; height: 29px; display: grid; flex: 0 0 29px; place-items: center; border-radius: 10px; color: #315d3d; background: #dcefd4; content: "\2713"; font-size: .9rem; font-weight: 850; }
.auth-page .container > .alert.error::before { color: #8d2924; background: #f7ded8; content: "!"; }
.auth-layout { width: 100%; min-height: 570px; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border: 1px solid #e8e4d8; border-radius: 26px; background: var(--paper); box-shadow: 0 25px 70px #443e2615; }
.auth-welcome { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 41px 38px 28px; background: linear-gradient(150deg, #fffdfa 0%, #fbf5ed 54%, #f1eee2 100%); }
.auth-welcome::after { position: absolute; right: -78px; bottom: -132px; width: 330px; height: 330px; border: 1px solid #b7283512; border-radius: 50%; content: ""; box-shadow: 0 0 0 34px #b7283507, 0 0 0 68px #b7283505; }
.auth-welcome-content { position: relative; z-index: 1; max-width: 460px; }
.auth-welcome-content .hero-kicker { margin-bottom: 19px; }
.auth-welcome-content h1 { margin-bottom: 13px; font-size: clamp(2rem, 3.2vw, 2.8rem); }
.auth-welcome-content h1 span { color: var(--red); }
.auth-welcome-content p { max-width: 390px; margin: 0; color: #707b70; font-size: .96rem; }
.auth-illustration { position: relative; z-index: 1; width: calc(100% + 24px); height: 215px; align-self: center; margin: 12px -12px 0; background-image: linear-gradient(90deg, #fbf5ed 0%, #fbf5ed00 28%, #f1eee200 80%, #f1eee2 100%), url("teras-hero.svg"); background-position: center, center 58%; background-repeat: no-repeat; background-size: 100% 100%, contain; }
.auth-community-note { position: relative; z-index: 2; display: flex; align-items: center; gap: 11px; margin-top: 2px; padding: 12px 14px; border: 1px solid #e9e5d9; border-radius: 14px; background: #fffdf8d9; }
.auth-note-icon { width: 37px; height: 37px; display: grid; flex: 0 0 37px; place-items: center; border-radius: 12px; color: var(--red-dark); background: var(--red-soft); }
.auth-note-icon .icon { width: 19px; height: 19px; }
.auth-community-note strong, .auth-community-note small { display: block; }
.auth-community-note strong { color: #46564a; font-size: .83rem; }
.auth-community-note small { margin-top: 2px; color: var(--muted); font-size: .74rem; }
.auth-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 5vw, 62px); }
.auth-form-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid #f0d7d2; border-radius: 16px; color: var(--red); background: var(--red-soft); }
.auth-form-icon .icon { width: 23px; height: 23px; }
.auth-form-panel > .eyebrow { margin-bottom: 8px; }
.auth-form-panel h2 { margin-bottom: 6px; font-size: 1.72rem; }
.auth-form-panel > p.muted { margin-bottom: 24px; font-size: .9rem; }
.auth-form label { margin-bottom: 16px; }
.auth-form input { min-height: 47px; margin-top: 7px; background: #fffefa; }
.auth-submit { width: 100%; min-height: 48px; margin-top: 4px; }
.auth-submit .icon { width: 17px; height: 17px; }
.auth-switch { margin: 19px 0 0; color: #707b70; font-size: .85rem; text-align: center; }
.auth-switch a { color: var(--red-dark); font-weight: 750; }
.auth-approval-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: #7a8479; font-size: .74rem; text-align: center; }
.auth-approval-note .icon { width: 15px; height: 15px; flex-basis: 15px; color: var(--green); }
.register-layout { min-height: 680px; }
.register-form-panel { padding-top: 30px; padding-bottom: 30px; }
.register-form-panel > p.muted { margin-bottom: 14px; }
.register-form-panel .auth-form label { margin-bottom: 9px; font-size: .82rem; }
.register-form-panel .auth-form input { min-height: 40px; padding: 8px 11px; }
.register-form-panel .auth-form textarea { min-height: 68px; }
.register-form-panel .auth-approval-note { margin-top: 13px; padding-top: 11px; }
.narrow { max-width: 620px; margin-right: auto; margin-left: auto; }
.alert { margin: 0 0 18px; padding: 12px 15px; border: 1px solid #dcebdc; border-radius: 12px; color: #315d3d; background: #edf6e9; font-size: .9rem; }
.alert.error { border-color: #f1d8d1; color: #8d2924; background: #fbefec; }
.alert.info { border-color: #d8e6e3; color: #315d67; background: #edf5f2; }
.profile-summary { margin: 16px 0 25px; }
.household { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; }
.household h2 { margin-bottom: 5px; }
.household details { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); }
.household summary { margin-bottom: 14px; color: var(--green); font-weight: 750; cursor: pointer; }
.staff-family-form { grid-column: 1 / -1; }
.resident-list { padding-top: 12px; border-top: 1px solid var(--line); }
.resident-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .88rem; }
.resident-row form { margin: 0; }
.approval-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(110px, 150px) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.approval-row input:not([type="checkbox"]) { margin: 0; }
.check-label { display: flex; align-items: center; gap: 7px; margin: 0; white-space: nowrap; }
.role-form { display: flex; min-width: 210px; gap: 8px; }
.role-form select { margin: 0; padding: 7px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 0 14px; }
.grid-form .full-width { grid-column: 1 / -1; }
.meeting { display: grid; grid-template-columns: 58px 1fr; gap: 16px; }
.meeting h2 { margin: 3px 0; }
.meeting-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.meeting-title-row .eyebrow { margin-bottom: 0; }
.meeting-status { display: inline-flex; align-items: center; padding: 4px 9px; border: 1px solid #e1e9d9; border-radius: 20px; color: #53665a; background: #f3f6ed; font-size: .7rem; font-weight: 750; }
.status-dalam_proses { border-color: #d7e3ef; color: #315f85; background: #eef5fb; }
.status-selesai { border-color: #cfe5d6; color: #286643; background: #edf7f0; }
.status-batal { border-color: #f0d7d2; color: #963b35; background: #fff3ef; }
.meeting-pinned-label { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px; color: var(--red-dark); font-size: .68rem; font-weight: 850; letter-spacing: .08em; }
.meeting-pinned-label .icon { width: 14px; height: 14px; flex-basis: 14px; }
.meeting.pinned-meeting { border-color: #e9c8bd; box-shadow: 0 14px 36px #a3263210; }
.meeting-date { display: grid; height: 60px; place-content: center; border: 1px solid #e1e9d9; border-radius: 15px; color: var(--green-dark); background: var(--pale); font-size: 1.4rem; font-weight: 800; line-height: 1.1; text-align: center; }
.meeting-date span { font-size: .75rem; text-transform: uppercase; }
.minutes { margin-top: 12px; padding: 12px; border-radius: 11px; background: #f5f7f1; }
.minutes p { margin: 5px 0 0; }
.minutes-preview { margin-bottom: 10px !important; overflow-wrap: anywhere; }
.minutes-dialog { width: min(100% - 28px, 700px); }
.minutes-full { max-height: 60vh; overflow-y: auto; overflow-wrap: anywhere; line-height: 1.8; }
.balance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.balance { display: flex; flex-direction: column; gap: 7px; margin: 0; }
.balance span { color: var(--muted); font-size: .84rem; }
.balance strong { font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-size: 1.23rem; letter-spacing: -.04em; }
.balance.current { border-color: #3b7754; color: white; background: linear-gradient(135deg, #4a8961, #2d6547); }
.balance.current span { color: #d6ebe1; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; text-align: left; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .78rem; }
.empty { padding: 42px 20px; color: var(--muted); text-align: center; }
.admin-hero-icon { width: 57px; height: 57px; display: grid; flex: 0 0 57px; place-items: center; border-radius: 18px; color: white; background: var(--red); box-shadow: 0 8px 18px #a3263228; }
.admin-hero-icon .icon { width: 27px; height: 27px; }
.footer { padding: 24px; border-top: 1px solid #e8e9de; color: #7d887c; background: #fffefa8c; font-size: .82rem; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 900px) {
    .topbar { gap: 12px; padding-right: 20px; padding-left: 20px; }
    .main-nav { gap: 1px; }
    .main-nav a { gap: 5px; padding: 8px; font-size: .8rem; }
    .nav-dropdown summary { gap: 5px; padding: 8px; font-size: .8rem; }
    .user-greeting { display: none; }
}

@media (max-width: 680px) {
    .topbar { flex-wrap: wrap; padding: 10px 15px; }
    .brand-mark { width: 39px; height: 39px; border-radius: 13px; }
    .main-nav { order: 3; width: 100%; justify-content: space-between; overflow: visible; flex-wrap: wrap; }
    .main-nav a { flex-direction: column; gap: 2px; min-width: 62px; padding: 6px 8px; font-size: .69rem; }
    .main-nav a .icon { width: 18px; height: 18px; }
    .nav-dropdown summary { min-width: 65px; flex-direction: column; gap: 2px; padding: 6px 8px; font-size: .69rem; }
    .nav-dropdown summary .icon { width: 18px; height: 18px; }
    .dropdown-caret { display: none; }
    .nav-dropdown-menu { top: auto; right: 0; bottom: calc(100% + 6px); left: auto; min-width: 170px; transform: none; }
    .nav-dropdown:last-of-type .nav-dropdown-menu { right: auto; left: 0; }
    .main-nav .nav-dropdown-menu a { min-width: 0; flex-direction: row; padding: 9px 11px; font-size: .82rem; }
    .nav-user { margin-left: auto; gap: 6px; }
    .container { width: min(100% - 22px, 840px); margin-top: 21px; }
    .hero-panel { min-height: 355px; align-items: flex-start; padding: 24px 21px; }
    .hero-copy { width: 100%; }
    .hero-copy h1 { max-width: 330px; font-size: 1.86rem; }
    .hero-copy p { max-width: 280px; margin-bottom: 13px; font-size: .88rem; }
    .hero-art { top: auto; bottom: 0; width: 100%; height: 47%; background-position: bottom right; background-size: auto 100%; opacity: .28; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 58%); mask-image: linear-gradient(90deg, transparent 0%, #000 58%); }
    .hero-link { position: relative; z-index: 1; }
    .section-heading { margin-top: 24px; }
    .card { padding: 17px; border-radius: 16px; }
    .post { padding: 17px 17px 12px; }
    .approval-row { grid-template-columns: 1fr 1fr; }
    .approval-row > div { grid-column: 1 / -1; }
    .grid-form { grid-template-columns: 1fr; }
    .grid-form .full-width { grid-column: auto; }
    .balance-grid { grid-template-columns: 1fr; }
    .household { grid-template-columns: 1fr; }
    .document-links { grid-row: 2; }
    .pagination { align-items: flex-start; flex-direction: column; }
    .pagination-controls { width: 100%; justify-content: space-between; }
    .pagination-current { margin-right: auto; }
    .auth-card { margin-top: 25px; padding: 23px; }
    .auth-page .container { width: min(100% - 22px, 540px); min-height: auto; margin-top: 18px; margin-bottom: 24px; }
    .auth-page .container > .alert { width: 100%; margin-bottom: 12px; }
    .auth-layout, .register-layout { min-height: 0; grid-template-columns: 1fr; border-radius: 21px; }
    .auth-welcome { min-height: 355px; padding: 25px 22px 17px; }
    .auth-welcome-content .hero-kicker { margin-bottom: 13px; }
    .auth-welcome-content h1 { font-size: 2rem; }
    .auth-welcome-content p { max-width: 340px; font-size: .87rem; }
    .auth-illustration { height: 145px; margin-top: 6px; }
    .auth-community-note { padding: 9px 11px; }
    .auth-form-panel, .register-form-panel { padding: 28px 23px 24px; }
    .auth-form-icon { width: 42px; height: 42px; margin-bottom: 14px; }
    .auth-form-panel h2 { font-size: 1.55rem; }
    .auth-form-panel > p.muted { margin-bottom: 18px; }
    .register-layout .auth-welcome { min-height: 340px; }
    .page-heading, .admin-hero, .staff-dashboard-hero { min-height: 118px; align-items: flex-start; flex-wrap: wrap; padding: 20px; }
    .page-heading > div:first-child { flex: 1 1 100%; }
    .page-heading .staff-actions { width: 100%; justify-content: flex-start; }
    .admin-hero-icon { width: 47px; height: 47px; flex-basis: 47px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.brand-logo { width: 43px; height: 43px; flex: 0 0 43px; border: 1px solid var(--line); border-radius: 14px; object-fit: cover; background: white; }
.record-actions, .staff-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.record-actions form, .officer-card form { margin: 0; }
.danger-button { color: white; background: linear-gradient(135deg, #b94a40, #96352f); }
.form-dialog, .confirm-dialog { width: min(100% - 28px, 620px); max-height: min(88vh, 820px); padding: 25px; overflow-y: auto; border: 1px solid #e8e9de; border-radius: 22px; color: var(--ink); background: var(--paper); box-shadow: 0 28px 90px #1d302d38; }
.form-dialog::backdrop, .confirm-dialog::backdrop { background: #192b25a3; backdrop-filter: blur(4px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-heading h2 { margin: 4px 0 0; font-size: 1.4rem; }
.dialog-close { width: 38px; height: 38px; flex: 0 0 38px; border: 1px solid var(--line); border-radius: 12px; color: #647367; background: #f7f8f2; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.dialog-close:hover { color: var(--red-dark); background: var(--red-soft); }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.dialog-actions > .file-label { flex: 1; margin: 0; }
.dialog-actions.full-width { grid-column: 1 / -1; }
.confirm-dialog { width: min(100% - 28px, 430px); padding: 27px; text-align: center; }
.confirm-dialog form { display: flex; flex-direction: column; align-items: center; }
.confirm-dialog h2 { margin: 2px 0 6px; font-size: 1.45rem; }
.confirm-dialog #confirm-message { margin-bottom: 8px; }
.confirm-dialog .dialog-actions { width: 100%; }
.confirm-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 16px; color: var(--red); background: var(--red-soft); }
.confirm-icon .icon { width: 23px; height: 23px; }
.staff-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
.staff-stat { display: flex; min-height: 135px; flex-direction: column; justify-content: space-between; margin: 0; padding: 17px; }
.staff-stat > span, .staff-stat > small { color: var(--muted); font-size: .82rem; }
.staff-stat > strong { color: var(--green-deep); font-family: "Trebuchet MS", "Segoe UI", sans-serif; font-size: 2rem; line-height: 1.1; }
.occupancy-card .section-heading { margin-top: 0; }
.occupancy-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.occupancy-item { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcf8; }
.occupancy-icon { width: 39px; height: 39px; display: grid; flex: 0 0 39px; place-items: center; border-radius: 12px; background: #edf3e6; font-size: 1.2rem; }
.occupancy-item strong, .occupancy-item small { display: block; }
.occupancy-item strong { color: var(--green-deep); font-size: 1.1rem; }
.occupancy-item small { color: var(--muted); font-size: .73rem; }
.staff-directory .section-heading, .officers-section .section-heading { margin-top: 0; }
.directory-person { display: flex; align-items: center; gap: 10px; }
.resident-table td { vertical-align: middle; }
.resident-table th, .resident-table td { white-space: normal; }
.officer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.officer-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #fffefa; }
.officer-avatar { width: 43px; height: 43px; display: grid; flex: 0 0 43px; place-items: center; border-radius: 15px; color: var(--red-dark); background: var(--red-soft); font-weight: 850; }
.officer-info { display: grid; min-width: 0; gap: 2px; }
.officer-info strong { overflow: hidden; text-overflow: ellipsis; }
.officer-info small { color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.officer-title { color: var(--green-dark); font-size: .84rem; font-weight: 750; }
.icon-action { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: white; cursor: pointer; }
.icon-action.danger:hover { color: var(--danger); background: var(--red-soft); }
.settings-logo-preview { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.settings-logo-preview img { width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 13px; object-fit: cover; }
@media print {
    body { background: white; }
    body::before, .topbar, .footer, .staff-dashboard-hero, .staff-stat-grid, .occupancy-card, .officers-section, .staff-actions, .pagination, .alert { display: none !important; }
    .container { width: 100%; min-height: 0; margin: 0; }
    .staff-directory { margin: 0; padding: 0; border: 0; box-shadow: none; }
    .staff-directory .section-heading { margin: 0 0 12px; }
    #resident-directory th:last-child, #resident-directory td:last-child { display: none; }
    table { font-size: 10pt; }
    th, td { padding: 6px; border-color: #bbb; }
    a { color: inherit; }
}

@media (max-width: 680px) {
    .brand-logo { width: 39px; height: 39px; flex-basis: 39px; }
    .staff-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .staff-stat { min-height: 118px; padding: 13px; }
    .staff-stat > strong { font-size: 1.7rem; }
    .occupancy-grid, .officer-grid { grid-template-columns: 1fr 1fr; }
    .occupancy-item { align-items: flex-start; flex-direction: column; padding: 11px; }
    .staff-directory .section-heading, .officers-section .section-heading { align-items: flex-start; flex-direction: column; }
    .staff-actions { width: 100%; }
    .staff-actions .button { flex: 1; }
    .form-dialog, .confirm-dialog { padding: 20px; border-radius: 18px; }
    .dialog-actions { align-items: stretch; flex-wrap: wrap; }
}
