:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --sidebar: #0f172a;
    --sidebar-strong: #050b16;
    --text: #101828;
    --muted: #667085;
    --line: #d7dde7;
    --primary: #123a72;
    --primary-dark: #0b2447;
    --primary-soft: #e8eef8;
    --success: #15803d;
    --warning: #b45309;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(15, 23, 42, .12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

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

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    width: 292px;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding: clamp(10px, 1.6vh, 20px);
    color: #eef6ff;
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-strong));
    font-size: 15px;
}

.brand {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: clamp(7px, 1vh, 14px);
    margin-bottom: clamp(8px, 1.4vh, 22px);
}

.brand-logo {
    width: clamp(64px, 10vh, 128px);
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    background: #fff;
    padding: clamp(4px, .7vh, 8px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}

.brand strong,
.user-card strong {
    display: block;
}

.brand span,
.user-card small {
    display: block;
    margin-top: 2px;
    color: #b8c7dc;
    font-size: 13px;
}

.logo,
.login-logo {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #2d7ff0, #13b6c8);
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(19, 182, 200, .28);
}

.side-nav {
    display: grid;
    min-height: 0;
    gap: clamp(1px, .35vh, 5px);
}

.side-nav a,
.logout-link {
    border-radius: 8px;
    color: #dbe8f7;
    padding: clamp(4px, .55vh, 10px) 12px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .18s ease, color .18s ease;
}

.side-nav a:hover,
.logout-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.sidebar-footer {
    display: grid;
    gap: clamp(6px, 1vh, 12px);
    margin-top: auto;
    padding-top: clamp(8px, 1.4vh, 18px);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: clamp(6px, .9vh, 10px);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
}

.avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #0f2544;
    background: #fff;
    font-weight: 800;
}

.main {
    width: 100%;
    max-width: 1240px;
    padding: 34px;
}

.mobile-bar,
.nav-toggle,
.scrim {
    display: none;
}

.mobile-logo {
    width: 120px;
    height: auto;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 4px 0 8px;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.08;
    letter-spacing: 0;
}

.page-header p,
.hero-panel p,
.feature-card p,
.upload-panel p,
.info-panel p,
.empty-state p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
}

.eyebrow,
.tag {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.role-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 13px;
    font-weight: 800;
}

.status-pill.pending {
    color: var(--warning);
    background: #fff7ed;
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(29, 111, 220, .1), transparent 48%),
        var(--surface);
    box-shadow: var(--shadow);
}

.hero-panel h2 {
    max-width: 760px;
    margin: 6px 0 10px;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.12;
}

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

.hero-actions {
    align-items: flex-end;
    justify-content: flex-end;
    min-width: 220px;
}

.actions.center {
    justify-content: center;
    margin-top: 22px;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    color: #fff;
    background: var(--primary);
    font-weight: 800;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.btn:hover,
button:hover {
    background: var(--primary-dark);
}

.btn.secondary {
    border: 1px solid var(--line);
    color: var(--text);
    background: var(--surface);
}

.btn.secondary:hover {
    background: var(--surface-soft);
}

.secondary-button {
    border: 1px solid var(--line);
    color: var(--text);
    background: var(--surface);
}

.secondary-button:hover {
    background: var(--surface-soft);
}

.danger-button {
    background: var(--danger);
}

.danger-button:hover {
    background: #7f1d1d;
}

.warning-button {
    color: #fff;
    background: var(--warning);
}

.warning-button:hover {
    background: #7c2d12;
}

.summary-grid,
.quick-grid,
.document-grid,
.admin-stats {
    display: grid;
    gap: 16px;
}

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-bottom: 22px;
}

.summary-card,
.feature-card,
.panel,
.document-card,
.device-card,
.info-panel,
.success,
.stat-card,
.empty-state,
.news-card,
.service-card,
.info-tile {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 34px rgba(16, 35, 63, .07);
}

.summary-card {
    display: grid;
    gap: 8px;
    padding: 20px;
}

.summary-card strong,
.stat-card strong {
    display: block;
    color: var(--text);
    font-size: 36px;
    line-height: 1;
}

.summary-card span:last-child,
.stat-card span {
    color: var(--muted);
    font-weight: 650;
}

.summary-icon,
.file-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 44px;
    height: 34px;
    border-radius: 10px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 12px;
    font-weight: 900;
}

.quick-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.feature-card {
    padding: 22px;
}

.feature-card h3 {
    margin: 8px 0 8px;
    font-size: 20px;
}

.panel,
.info-panel,
.success,
.empty-state {
    padding: 24px;
}

.upload-panel {
    display: grid;
    grid-template-columns: minmax(220px, .7fr) 1.5fr;
    gap: 22px;
    margin-bottom: 20px;
}

.sync-panel {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.upload-panel h2,
.info-panel h2,
.section-heading h2,
.document-card h2,
.device-card h2 {
    margin: 4px 0 8px;
}

.upload-form,
.filter-form,
.admin-row-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

.compact-upload {
    margin-top: 12px;
}

.inline-file-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-top: 12px;
}

.filter-panel {
    margin-bottom: 20px;
}

.filter-form {
    grid-template-columns: 1.5fr 1fr auto auto;
}

.admin-row-form {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.balance-form {
    flex: 1;
}

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

.field-row,
.columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    background: #fff;
    outline: none;
}

small {
    color: var(--muted);
    font-weight: 600;
}

.selected-file {
    overflow-wrap: anywhere;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(29, 111, 220, .12);
}

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

.accounting-groups {
    display: grid;
    gap: 22px;
}

.accounting-group {
    display: grid;
    gap: 12px;
}

.document-card,
.device-card {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.document-card p,
.device-card p,
.admin-item p {
    margin: 0;
    color: var(--muted);
}

.document-card small,
.device-card small,
.admin-item small,
.section-heading span,
.timeline-item span,
.check-list span {
    color: var(--muted);
}

.document-card strong {
    color: var(--primary);
}

.device-grid {
    align-items: stretch;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 20px;
    align-items: start;
}

.form-panel {
    padding: 26px;
}

.info-panel {
    position: sticky;
    top: 24px;
}

.timeline-item {
    display: grid;
    gap: 4px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.timeline-item:first-of-type {
    margin-top: 10px;
}

.check-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.wide {
    width: 100%;
    margin-top: 18px;
}

.calendar-box {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.calendar-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.calendar-day,
.file-row,
.history-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.calendar-day span,
.file-row span,
.history-item small,
.muted {
    color: var(--muted);
}

.check-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 650;
}

.check-field input {
    width: auto;
    margin-top: 5px;
}

.check-field.inline {
    align-items: center;
}

.check-field.inline input {
    margin-top: 0;
}

.admin-actions,
.inline-form {
    display: grid;
    gap: 8px;
}

.admin-actions {
    align-content: start;
}

.inline-form {
    min-width: 280px;
}

.preserve-text {
    white-space: pre-wrap;
}

.section-heading.spaced,
.admin-response {
    margin-top: 24px;
}

.admin-docs {
    margin-top: 22px;
}

.check-list span {
    padding: 12px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.admin-hub {
    margin-bottom: 26px;
}

.admin-hub .feature-card h3 {
    margin: 8px 0;
    color: var(--primary-dark);
    font-size: 30px;
    line-height: 1;
}

.stat-card {
    padding: 20px;
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

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

.admin-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.admin-balance-row {
    align-items: stretch;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
}

.empty-state.compact {
    padding: 18px;
}

.empty-state h2,
.empty-state h3 {
    margin: 0 0 6px;
}

.success {
    max-width: 620px;
    margin: 8vh auto;
    text-align: center;
}

.success-mark {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    color: #fff;
    background: var(--success);
    font-weight: 900;
}

.success h1 {
    margin: 18px 0 8px;
}

.success > strong {
    display: inline-block;
    margin-top: 18px;
    padding: 12px 18px;
    border-radius: 12px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-size: 24px;
}

.news-section {
    margin: 28px 0;
}

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

.news-card {
    display: grid;
    overflow: hidden;
}

.news-card.featured {
    grid-column: span 2;
    grid-template-columns: minmax(260px, .9fr) 1fr;
}

.news-card img,
.article-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--surface-soft);
}

.news-card.featured img,
.news-card.featured .news-placeholder {
    height: 100%;
    min-height: 300px;
}

.news-card > div:not(.news-placeholder) {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 20px;
}

.news-card h2,
.news-card h3 {
    margin: 0;
    line-height: 1.18;
}

.news-card p {
    margin: 0;
    color: var(--muted);
}

.news-placeholder {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: #fff;
    background: linear-gradient(135deg, #0b1220, #123a72);
    font-weight: 900;
    letter-spacing: .04em;
}

.article-page {
    display: grid;
    gap: 16px;
    max-width: 920px;
}

.article-page h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.08;
}

.article-page .lead {
    color: var(--muted);
    font-size: 18px;
}

.article-image {
    height: min(420px, 50vw);
    border-radius: 8px;
}

.calendar-month {
    display: grid;
    gap: 14px;
}

.service-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
}

.service-card h2 {
    margin: 8px 0 6px;
}

.service-card p {
    margin: 0 0 8px;
    color: var(--muted);
}

.date-box {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 86px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(180deg, #0b1220, #123a72);
}

.date-box strong {
    font-size: 34px;
    line-height: 1;
}

.date-box span {
    color: #cbd5e1;
    font-weight: 800;
}

.service-form {
    grid-column: 1 / -1;
}

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.quick-grid.mini {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 22px 0;
}

.info-tile {
    padding: 16px;
}

.info-tile strong {
    display: block;
    color: var(--primary-dark);
    font-size: 22px;
    line-height: 1.15;
}

.info-tile span {
    color: var(--muted);
    font-weight: 700;
}

.login-bg {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 36px 18px;
    background:
        radial-gradient(circle at 12% 8%, rgba(18, 58, 114, .11), transparent 30%),
        radial-gradient(circle at 88% 92%, rgba(21, 128, 61, .1), transparent 28%),
        linear-gradient(145deg, #ffffff 0%, #f7fafc 48%, #eef4fb 100%);
}

.login-card {
    width: min(460px, 100%);
    border: 1px solid rgba(207, 216, 227, .72);
    border-radius: 8px;
    padding: 42px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(16, 35, 63, .16);
    text-align: center;
}

.login-header {
    display: grid;
    justify-items: center;
}

.login-brand-logo {
    width: clamp(176px, 46vw, 220px);
    height: auto;
    margin: 0 0 22px;
    object-fit: contain;
}

.login-card h1 {
    margin: 0 0 10px;
    color: var(--primary-dark);
    font-size: clamp(32px, 7vw, 42px);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
}

.login-card p,
.login-card small {
    color: #6b7280;
}

.login-card p {
    max-width: 350px;
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
}

.login-form {
    display: grid;
    gap: 18px;
    margin: 34px 0 18px;
    text-align: left;
}

.login-field {
    display: grid;
    gap: 8px;
}

.login-field label {
    color: #24324b;
    font-size: 14px;
    font-weight: 800;
}

.login-field input {
    min-height: 50px;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    padding: 13px 15px;
    color: #172033;
    background: #fbfdff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.login-field input::placeholder {
    color: #98a2b3;
}

.login-field input:focus {
    border-color: #1d6fdc;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(29, 111, 220, .13);
}

.login-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 6px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0b1220 0%, #123a72 100%);
    box-shadow: 0 16px 32px rgba(18, 58, 114, .2);
    letter-spacing: .01em;
    transition: box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.login-submit:hover {
    background: linear-gradient(135deg, #050b16 0%, #0b2447 100%);
    box-shadow: 0 18px 38px rgba(18, 58, 114, .25);
    transform: translateY(-1px);
}

.login-submit:focus-visible {
    outline: 3px solid rgba(29, 111, 220, .32);
    outline-offset: 3px;
}

.login-note {
    display: block;
    text-align: center;
    font-size: 13px;
    font-weight: 650;
}

.alert {
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #fecdca;
    border-radius: 12px;
    color: var(--danger);
    background: #fff1f0;
}

.alert.success {
    border-color: #bbf7d0;
    color: var(--success);
    background: #f0fdf4;
}

.page-alert,
.inline-alert {
    margin: 0 0 18px;
}

.success-alert {
    border-color: #bbf7d0;
    color: var(--success);
    background: #f0fdf4;
}

.admin-edit-block {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.admin-edit-block summary {
    cursor: pointer;
    color: var(--primary-dark);
    font-weight: 850;
}

.temporary-password {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.temporary-password h2,
.temporary-password p {
    margin: 0;
}

.temporary-password strong {
    width: fit-content;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--primary-dark);
    background: #fff;
    font-size: 24px;
    letter-spacing: .06em;
}

.resident-form {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.resident-list {
    gap: 14px;
}

.resident-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(168px, 190px);
    gap: 16px;
    align-items: start;
    overflow: hidden;
}

.resident-card-main {
    display: grid;
    min-width: 0;
    gap: 12px;
}

.resident-row-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
    padding: 12px;
    align-items: end;
}

.resident-row-form label {
    min-width: 0;
}

.resident-row-form input,
.resident-row-form select {
    min-width: 0;
}

.resident-identity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 12px;
    padding: 4px 2px 0;
}

.resident-identity div {
    min-width: 0;
}

.resident-identity strong,
.resident-identity span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resident-identity span {
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.resident-reset-form {
    display: grid;
}

.resident-actions {
    width: 100%;
    min-width: 0;
}

.resident-actions form,
.resident-actions button,
.resident-reset-form button {
    width: 100%;
}

.resident-actions button,
.resident-row-form button {
    min-height: 38px;
    padding: 8px 11px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.2;
    white-space: normal;
}

.resident-actions small {
    display: block;
    padding-top: 4px;
    overflow-wrap: anywhere;
    text-align: center;
}

.account-link {
    width: fit-content;
    min-height: 38px;
    padding: 8px 12px;
}

@media (max-width: 1080px) {
    .summary-grid,
    .document-grid,
    .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-grid,
    .upload-panel,
    .upload-form,
    .filter-form,
    .admin-row-form,
    .resident-form,
    .resident-row-form,
    .content-layout,
    .about-grid {
        grid-template-columns: 1fr;
    }

    .resident-item {
        grid-template-columns: 1fr;
        overflow: visible;
    }

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

    .resident-row-form button {
        width: 100%;
    }

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

    .resident-reset-form button {
        width: 100%;
    }

    .news-card.featured {
        grid-column: span 2;
        grid-template-columns: 1fr;
    }

    .info-panel {
        position: static;
    }
}

@media (max-width: 820px) {
    .app-shell {
        display: block;
    }

    .main {
        max-width: none;
        padding: 18px;
    }

    .mobile-bar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: -18px -18px 22px;
        padding: 14px 18px;
        border-bottom: 1px solid var(--line);
        background: rgba(255, 255, 255, .92);
        backdrop-filter: blur(12px);
        font-weight: 800;
    }

    .menu-button {
        display: inline-flex;
        width: auto;
        gap: 0;
        border-radius: 10px;
        padding: 9px 12px;
        color: #fff;
        background: var(--primary);
        font-size: 14px;
        cursor: pointer;
    }

    .sidebar {
        position: fixed;
        z-index: 40;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .scrim {
        position: fixed;
        z-index: 30;
        inset: 0;
        background: rgba(15, 23, 42, .45);
    }

    .nav-toggle:checked ~ .sidebar {
        transform: translateX(0);
    }

    .nav-toggle:checked ~ .scrim {
        display: block;
    }

    .page-header,
    .hero-panel,
    .admin-item,
    .inline-form {
        display: grid;
    }

    .hero-actions {
        justify-content: flex-start;
        min-width: 0;
    }

    .summary-grid,
    .quick-grid,
    .document-grid,
    .news-grid,
    .admin-stats,
    .calendar-list,
    .field-row,
    .columns,
    .quick-grid.mini {
        grid-template-columns: 1fr;
    }

    .news-card.featured {
        grid-column: auto;
    }

    .service-card {
        grid-template-columns: 1fr;
    }

    .resident-identity {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .resident-actions,
    .resident-row-form {
        grid-template-columns: 1fr;
    }

    .date-box {
        justify-items: start;
        place-items: initial;
        padding: 16px;
    }

    .panel,
    .info-panel,
    .success,
    .empty-state,
    .hero-panel {
        padding: 20px;
    }
}

@media (max-width: 520px) {
    .login-bg {
        padding: 22px 14px;
    }

    .login-card {
        padding: 30px 22px 28px;
        border-radius: 8px;
    }

    .login-brand-logo {
        width: min(188px, 72vw);
        margin-bottom: 18px;
    }

    .login-card h1 {
        font-size: 31px;
    }

    .login-form {
        gap: 16px;
        margin-top: 28px;
    }
}
