:root {
    --bg: #f6f1e8;
    --bg-soft: #fbf8f3;
    --panel: rgba(255, 252, 247, 0.92);
    --panel-strong: #fffdf9;
    --panel-light: #fff8ef;
    --ink: #26354a;
    --muted: #6f7d90;
    --line: rgba(169, 143, 117, 0.22);
    --brand: #d97841;
    --brand-2: #efb366;
    --brand-3: #7db6d9;
    --success: #2f9c6a;
    --danger: #d35d72;
    --warning: #c5912e;
    --shadow: 0 24px 60px rgba(135, 115, 92, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(255, 210, 164, 0.38), transparent 28%),
        radial-gradient(circle at bottom right, rgba(162, 213, 242, 0.34), transparent 24%),
        linear-gradient(180deg, #fffaf3 0%, #f6f1e8 100%);
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

a {
    color: #375478;
    text-decoration: none;
}

button,
.button-link {
    align-items: center;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    border: 0;
    border-radius: 16px;
    box-shadow: 0 14px 26px rgba(217, 120, 65, 0.2);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 700;
    gap: 0.5rem;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1.2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover,
.button-link:hover {
    box-shadow: 0 18px 32px rgba(217, 120, 65, 0.26);
    transform: translateY(-1px);
}

.button-link.muted {
    background: #f1e7d7;
    box-shadow: none;
    color: var(--ink);
}

.secondary-button {
    background: #f1e7d7;
    box-shadow: none;
    color: var(--ink);
}

.danger-button {
    background: linear-gradient(135deg, #d35d72 0%, #f08a9b 100%);
    box-shadow: 0 12px 22px rgba(211, 93, 114, 0.18);
    min-height: 36px;
    padding: 0.45rem 0.75rem;
}

.cancel-reason-input {
    border-radius: 12px;
    min-width: 150px;
    padding: 0.55rem 0.7rem;
}

input,
select,
textarea {
    width: 100%;
    background: #fffdf9;
    border: 1px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    font: inherit;
    outline: none;
    padding: 0.9rem 1rem;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(217, 120, 65, 0.6);
    box-shadow: 0 0 0 3px rgba(217, 120, 65, 0.1);
}

label {
    color: var(--muted);
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

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

th,
td {
    border-bottom: 1px solid rgba(169, 143, 117, 0.14);
    padding: 1rem;
    text-align: left;
}

th {
    color: #8a7b6a;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar {
    background: linear-gradient(180deg, #fff9f1 0%, #f2e9da 100%);
    border-right: 1px solid rgba(169, 143, 117, 0.18);
    box-shadow: 10px 0 30px rgba(149, 124, 92, 0.08);
    display: flex;
    flex-direction: column;
    height: 100vh;
    left: 0;
    padding: 1.4rem;
    position: fixed;
    top: 0;
    width: 270px;
}

.mobile-topbar,
.mobile-nav-toggle,
.mobile-nav-backdrop {
    display: none;
}

.mobile-topbar {
    align-items: center;
    background: rgba(255, 252, 247, 0.96);
    border: 1px solid rgba(169, 143, 117, 0.18);
    border-radius: 20px;
    box-shadow: 0 16px 32px rgba(149, 124, 92, 0.12);
    gap: 0.75rem;
    justify-content: space-between;
    left: 0.75rem;
    padding: 0.7rem 0.8rem;
    position: fixed;
    right: 0.75rem;
    top: 0.75rem;
    z-index: 1100;
}

.mobile-topbar__brand {
    align-items: center;
    display: flex;
    gap: 0.65rem;
    min-width: 0;
}

.mobile-topbar__logo {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    height: 42px;
    max-height: 42px;
    max-width: 42px;
    object-fit: contain;
    padding: 0.28rem;
    width: 42px;
}

.mobile-topbar__text {
    display: grid;
    gap: 0.08rem;
    min-width: 0;
}

.mobile-topbar__text strong {
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1.2;
}

.mobile-topbar__text span {
    color: var(--muted);
    font-size: 0.76rem;
}

.mobile-nav-toggle {
    position: static;
    z-index: 1101;
}

.mobile-nav-toggle span {
    background: currentColor;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 18px;
}

.mobile-nav-backdrop {
    background: rgba(22, 33, 47, 0.36);
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    visibility: hidden;
    z-index: 1050;
}

.brand-wrap {
    align-items: center;
    display: flex;
    gap: 0.9rem;
    min-width: 0;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    border-radius: 18px;
    color: #fff;
    display: flex;
    font-size: 1.3rem;
    font-weight: 900;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.brand-logo {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    flex: 0 0 54px;
    height: 54px;
    max-height: 54px;
    max-width: 54px;
    object-fit: contain;
    padding: 0.35rem;
    width: 54px;
}

.brand {
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    max-width: 170px;
    overflow-wrap: anywhere;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.nav {
    display: grid;
    gap: 0.7rem;
    margin-top: 2rem;
}

.nav a {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid transparent;
    border-radius: 16px;
    color: var(--ink);
    padding: 0.95rem 1rem;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav a:hover {
    background: #fff;
    border-color: rgba(125, 182, 217, 0.45);
    transform: translateX(2px);
}

.sidebar-foot {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--muted);
    display: grid;
    gap: 0.2rem;
    line-height: 1.6;
    margin-top: auto;
    padding: 1rem;
}

.sidebar-foot strong {
    color: var(--ink);
    font-size: 0.98rem;
}

.sidebar-foot span {
    font-size: 0.84rem;
}

.main {
    margin-left: 270px;
    min-height: 100vh;
    padding: 2rem;
}

.auth-main {
    margin-left: 0;
    padding: 2rem;
}

.site-footer {
    align-items: center;
    border-top: 1px solid rgba(169, 143, 117, 0.2);
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: space-between;
    margin-top: 1.5rem;
    padding: 1rem 0 0.25rem;
}

.site-footer__text {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
}

.site-footer__text strong {
    color: var(--ink);
}

.auth-shell {
    align-items: stretch;
    display: grid;
    gap: 1.4rem;
    grid-template-columns: 1.2fr 0.8fr;
    margin: 5vh auto;
    max-width: 1180px;
}

.auth-main {
    background:
        radial-gradient(circle at top left, rgba(255, 210, 164, 0.45), transparent 30%),
        radial-gradient(circle at bottom right, rgba(162, 213, 242, 0.45), transparent 26%),
        linear-gradient(180deg, #fff9f1 0%, #f7f4ee 100%);
    color: var(--ink);
}

.auth-hero,
.auth-panel,
.card,
.hero-card,
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.auth-hero {
    background: linear-gradient(135deg, rgba(255, 247, 235, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
    color: var(--ink);
    overflow: hidden;
    padding: 2.2rem;
    position: relative;
}

.auth-hero::after,
.hero-card::after {
    background: linear-gradient(135deg, rgba(244, 177, 131, 0.28), rgba(255, 255, 255, 0));
    content: "";
    inset: auto -15% -25% auto;
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    filter: blur(10px);
}

.auth-panel {
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    padding: 2rem;
}

.panel-badge,
.eyebrow {
    color: #b86c3d;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-hero h1,
.hero-card h1,
.page-header h1 {
    color: var(--ink);
    font-size: clamp(1.8rem, 3.2vw, 2.8rem);
    line-height: 1.08;
    margin: 0.45rem 0 0.8rem;
    max-width: 760px;
}

.auth-panel h2,
.section-heading h2,
.card h2 {
    color: var(--ink);
    font-size: 1.2rem;
    margin: 0.3rem 0 0.65rem;
}

.auth-hero p,
.auth-panel p,
.hero-card p,
.page-header p,
.report-total,
.empty,
.mapping-list span {
    color: var(--muted);
    line-height: 1.7;
}

.auth-metrics {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2rem;
}

.association-logos {
    align-items: center;
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1rem;
    max-width: 100%;
}

.association-logos img {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    flex: 0 0 72px;
    height: 72px;
    max-height: 72px;
    max-width: 72px;
    object-fit: contain;
    padding: 0.45rem;
    width: 72px;
}

.login-brand-block {
    flex: 1;
    text-align: center;
}

.login-brand-block .eyebrow {
    display: block;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    margin-top: 0.45rem;
}

.login-brand-block h1 {
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    line-height: 1.2;
    margin: 0;
}

.association-contact {
    color: #4a5a78;
    display: grid;
    gap: 0.25rem;
    line-height: 1.5;
    margin-top: 0.6rem;
}

.settings-logo-preview {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    display: block;
    height: 72px;
    margin-top: 0.75rem;
    object-fit: contain;
    padding: 0.35rem;
    width: 72px;
}

.auth-metrics div,
.mapping-list div {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(216, 198, 178, 0.8);
    border-radius: 20px;
    padding: 1rem;
}

.auth-metrics span,
.mapping-list strong {
    color: #8a8f99;
    display: block;
    font-size: 0.82rem;
    margin-bottom: 0.45rem;
}

.auth-metrics strong {
    color: var(--ink);
    font-size: 1.1rem;
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.form-note {
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 1rem;
}

.hero-card,
.page-header,
.section-heading,
.header-actions,
.inline-form,
.filters,
.hero-actions,
.signature-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.hero-card,
.card {
    padding: 1.5rem;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.quick-link {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--ink);
    display: block;
    font-weight: 700;
    padding: 1rem 1.1rem;
    text-align: center;
}

.hero-card {
    background: linear-gradient(135deg, rgba(255, 251, 244, 0.95) 0%, rgba(247, 244, 238, 0.95) 100%);
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
}

.page-header {
    margin-bottom: 1.4rem;
}

.stats-grid,
.reports-grid,
.member-grid,
.import-grid,
.payments-grid,
.settings-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.stat-card {
    padding: 1.3rem;
}

.stat-card.glass,
.stat-card.accent {
    grid-column: span 4;
}

.stat-card span {
    color: var(--muted);
    display: block;
    margin-bottom: 0.4rem;
}

.stat-card strong {
    color: var(--ink);
    font-size: 2rem;
}

.stat-card.accent {
    background: linear-gradient(135deg, rgba(255, 234, 212, 0.95) 0%, rgba(235, 245, 250, 0.95) 100%);
}

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

.list-summary {
    align-items: center;
    color: var(--muted);
    display: flex;
    font-size: 0.92rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.2rem;
}

.pagination a,
.pagination span {
    align-items: center;
    background: #fff8ef;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    display: inline-flex;
    font-weight: 700;
    min-height: 38px;
    min-width: 42px;
    padding: 0.55rem 0.8rem;
    justify-content: center;
}

.pagination span {
    color: var(--muted);
}

.pagination .active-page {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    border-color: transparent;
    color: #fff;
}

.pagination a.active {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    border-color: transparent;
    color: #fff;
}

.form-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.span-2 {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.section-divider {
    border-top: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 700;
    margin-top: 0.2rem;
    padding-top: 1rem;
}

.details {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.details div {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 1rem;
}

.details dt {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.details dd {
    margin: 0;
}

.member-grid > .card:first-child,
.reports-grid > .card:first-child {
    grid-column: span 7;
}

.member-grid.single-card > .card:first-child {
    grid-column: span 12;
}

.member-grid > .card:last-child,
.reports-grid > .card:last-child {
    grid-column: span 5;
}

.import-grid > .card {
    grid-column: span 6;
}

.payments-grid > .card {
    grid-column: span 6;
}

.settings-grid > .card:first-child {
    grid-column: span 7;
}

.settings-grid > .card:last-child {
    grid-column: span 5;
}

.settings-tabs {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 24px;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: -0.4rem 0 1.2rem;
    padding: 0.45rem;
}

.settings-tabs a {
    border-radius: 18px;
    color: var(--muted);
    font-weight: 900;
    padding: 0.85rem 1rem;
    text-align: center;
}

.settings-tabs a.active {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    box-shadow: 0 14px 26px rgba(217, 120, 65, 0.16);
    color: #fff;
}

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

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.active {
    display: block;
}

.settings-panel {
    margin-bottom: 1.2rem;
}

.report-filter-card {
    box-shadow: none;
    margin-bottom: 1rem;
}

.report-summary-strip {
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 234, 212, 0.75), rgba(235, 245, 250, 0.75));
    border: 1px solid var(--line);
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.2rem;
}

.report-summary-strip span {
    color: var(--muted);
    font-weight: 800;
}

.report-summary-strip strong {
    color: var(--ink);
    font-size: 1.2rem;
}

.settings-panel-head {
    align-items: flex-start;
    border-bottom: 1px solid rgba(169, 143, 117, 0.14);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: -0.2rem 0 1.2rem;
    padding-bottom: 1rem;
}

.settings-panel-head h2 {
    margin: 0.2rem 0 0.25rem;
}

.settings-panel-head p {
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
}

.settings-two-column {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.settings-user-layout {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
}

.profile-layout .span-2 {
    grid-column: span 2;
}

.settings-subcard {
    background: rgba(255, 248, 239, 0.55);
    border: 1px solid rgba(169, 143, 117, 0.18);
    border-radius: 24px;
    padding: 1rem;
}

.settings-detail {
    background: #fffdf9;
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
}

.settings-detail summary {
    background: #fff8ef;
    cursor: pointer;
    font-weight: 900;
    padding: 0.85rem 1rem;
}

.settings-detail > :not(summary) {
    margin-left: 1rem;
    margin-right: 1rem;
}

.settings-detail .permission-matrix,
.settings-detail .district-check-grid {
    margin-bottom: 1rem;
}

.settings-inline-form {
    align-items: center;
    display: grid;
    gap: 0.7rem;
    grid-template-columns: minmax(120px, 1fr) auto auto auto;
}

.settings-inline-form label {
    align-items: center;
    color: var(--ink);
    display: inline-flex;
    gap: 0.45rem;
    margin: 0;
}

.settings-inline-form input[type="checkbox"] {
    width: auto;
}

.settings-logo-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-checks {
    align-content: end;
    display: grid;
    gap: 0.6rem;
}

.settings-checks label,
.permission-check {
    align-items: center;
    color: var(--ink);
    display: inline-flex;
    gap: 0.55rem;
    margin: 0;
}

.settings-checks input,
.permission-check input {
    width: auto;
}

.inline-copy-field {
    align-items: center;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.inline-copy-field input[readonly] {
    background: #f8f2e8;
    color: #5d687b;
}

.permission-matrix {
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
}

.district-access-box {
    background: #fff8ef;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1rem;
}

.district-check-grid {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0.8rem;
    max-height: 260px;
    overflow: auto;
}

.permission-row {
    align-items: center;
    border-top: 1px solid rgba(169, 143, 117, 0.14);
    display: grid;
    gap: 0.7rem;
    grid-template-columns: 1.4fr repeat(4, minmax(82px, 1fr));
    padding: 0.85rem 1rem;
}

.permission-row:first-child {
    border-top: 0;
}

.permission-head {
    background: #fff8ef;
    color: #8a7b6a;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.permission-check span {
    color: var(--muted);
    font-size: 0.82rem;
}

.receipt-actions {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.receipt-actions p {
    color: var(--muted);
    margin: 0;
}

.selected-member {
    background: #fff8ef;
    border: 1px solid var(--line);
    border-radius: 18px;
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 1rem;
}

.selected-member span {
    color: var(--muted);
}

.mapping-list {
    display: grid;
    gap: 0.8rem;
}

.import-result {
    margin-top: 1.2rem;
}

.import-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.import-counts span {
    background: #fff8ef;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    font-weight: 700;
    padding: 0.45rem 0.8rem;
}

.import-result-group {
    border: 1px solid var(--line);
    border-radius: 18px;
    margin-top: 1rem;
    overflow: hidden;
}

.import-result-group summary {
    background: #fff8ef;
    cursor: pointer;
    font-weight: 800;
    padding: 0.9rem 1rem;
}

.import-result-group .table-wrap {
    padding: 0 1rem 1rem;
}

.status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.35rem 0.75rem;
}

.status.active {
    background: rgba(47, 156, 106, 0.14);
    color: var(--success);
}

.status.expired {
    background: rgba(211, 93, 114, 0.14);
    color: var(--danger);
}

.status.inactive {
    background: rgba(197, 145, 46, 0.14);
    color: var(--warning);
}

.district-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.audit-modal-backdrop {
    align-items: center;
    background: rgba(16, 34, 63, 0.38);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1.5rem;
    position: fixed;
    z-index: 50;
}

.audit-modal {
    max-height: calc(100vh - 3rem);
    max-width: 920px;
    overflow: auto;
    width: min(920px, 100%);
}

.audit-modal-head {
    align-items: flex-start;
    gap: 1rem;
}

.flash {
    border: 1px solid var(--line);
    border-radius: 20px;
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
}

.flash.success {
    background: rgba(47, 156, 106, 0.12);
    color: var(--success);
}

.flash.error {
    background: rgba(211, 93, 114, 0.12);
    color: var(--danger);
}

.checkbox-row {
    color: var(--muted);
    display: flex;
    gap: 0.7rem;
    line-height: 1.5;
}

.checkbox-row input {
    margin-top: 0.2rem;
    width: auto;
}

.top-gap {
    margin-top: 1rem;
}

.print-body {
    background: linear-gradient(135deg, #f7efe5 0%, #edf5fb 100%);
    color: #11203a;
    margin: 0;
    padding: 2rem;
}

.print-sheet,
.certificate-sheet {
    margin: 0 auto;
    max-width: 1000px;
}

.print-sheet {
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 22px 60px rgba(17, 32, 58, 0.12);
    padding: 1.25rem;
}

.print-head {
    align-items: center;
    display: flex;
    gap: 1.2rem;
    justify-content: space-between;
}

.receipt-letterhead {
    align-items: center;
    border-bottom: 2px solid rgba(207, 138, 87, 0.35);
    display: grid;
    gap: 1rem;
    grid-template-columns: 110px minmax(0, 1fr) 110px;
    padding-bottom: 0.75rem;
    text-align: center;
}

.letterhead-logo {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 72px;
}

.letterhead-logo img {
    height: 68px;
    max-height: 68px;
    max-width: 82px;
    object-fit: contain;
    width: 82px;
}

.letterhead-center h1 {
    color: #10223f;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.15;
    margin: 0 0 0.45rem;
}

.letterhead-center div {
    color: #4a5a78;
    font-size: 0.92rem;
    line-height: 1.35;
}

.receipt-title-row {
    margin-top: 0.85rem;
}

.receipt-title-row h2 {
    color: #10223f;
    font-size: 1.45rem;
    margin: 0;
}

.print-brand {
    min-width: 0;
}

.print-brand h1 {
    margin: 0.35rem 0;
}

.print-logos {
    margin-bottom: 0.7rem;
}

.print-logos img {
    flex-basis: 58px;
    height: 58px;
    max-height: 58px;
    max-width: 58px;
    width: 58px;
}

.print-grid,
.certificate-metrics {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.print-grid div {
    border-bottom: 1px solid rgba(169, 143, 117, 0.14);
    padding: 0.45rem 0;
}

.amount-box {
    background: linear-gradient(135deg, rgba(255, 234, 212, 0.7), rgba(235, 245, 250, 0.7));
    border-left: 5px solid #d97841;
    border-radius: 18px;
    font-size: 1.1rem;
    font-weight: 800;
    margin-top: 0.9rem;
    padding: 0.75rem 1rem;
}

.notes {
    color: #4a5a78;
    margin-top: 1rem;
}

.signature-row {
    margin-top: 1rem;
}

.signature {
    min-width: 220px;
    padding-top: 2.4rem;
    text-align: center;
}

.receipt-system-note {
    color: #4a5a78;
    font-weight: 700;
    min-width: 320px;
    padding-top: 0;
}

.certificate-frame {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 242, 235, 0.98));
    border: 14px solid #cf8a57;
    border-radius: 34px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    color: #10223f;
    padding: 2rem;
    text-align: center;
}

.certificate-frame h1 {
    font-size: clamp(1.6rem, 2.8vw, 2.35rem);
    letter-spacing: 0.01em;
    margin: 0.45rem 0 0.8rem;
}

.certificate-letterhead {
    margin-bottom: 1.1rem;
}

.certificate-letterhead .letterhead-center h1 {
    font-size: clamp(1.55rem, 2.6vw, 2.1rem);
    margin-bottom: 0.3rem;
}

.certificate-title-row {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
    position: relative;
}

.certificate-title-row h1 {
    color: #10223f;
    font-size: clamp(1.25rem, 2.1vw, 1.65rem);
    letter-spacing: 0.08em;
    margin: 0.15rem 0 0.65rem;
    text-transform: uppercase;
}

.certificate-title-row .certificate-actions {
    position: absolute;
    right: 0;
}

.certificate-top-actions {
    justify-content: flex-end;
    margin: 0 0 1rem;
}

.certificate-logos {
    justify-content: center;
    margin-bottom: 0.6rem;
}

.certificate-logos img {
    flex-basis: 64px;
    height: 64px;
    max-height: 64px;
    max-width: 64px;
    width: 64px;
}

.certificate-contact {
    justify-items: center;
    margin: 0.6rem auto 0;
    max-width: 760px;
}

.certificate-text {
    font-size: 1.02rem;
    line-height: 1.6;
    margin: 0 auto;
    max-width: 760px;
}

.certificate-metrics div {
    background: rgba(217, 120, 65, 0.08);
    border-radius: 20px;
    padding: 1rem;
}

.certificate-metrics span {
    color: #48617f;
    display: block;
    font-size: 0.82rem;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.certificate-signature {
    margin-top: 1.4rem;
}

.print-button {
    display: block;
    margin: 0 0 1rem auto;
}

@media (max-width: 1024px) {
    .sidebar {
        height: auto;
        position: static;
        width: 100%;
    }

    .main {
        margin-left: 0;
        padding: 1rem;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-shell,
    .hero-card,
    .page-header,
    .section-heading,
    .header-actions,
    .print-head,
    .list-summary,
    .inline-form,
    .filters,
    .hero-actions,
    .signature-row {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-shell,
    .auth-metrics,
    .form-grid,
    .form-grid.compact,
    .details,
    .quick-links,
    .print-grid,
    .certificate-metrics {
        grid-template-columns: 1fr;
    }

    .stat-card.glass,
    .stat-card.accent,
    .member-grid > .card:first-child,
    .member-grid > .card:last-child,
    .reports-grid > .card:first-child,
    .reports-grid > .card:last-child,
    .import-grid > .card,
    .payments-grid > .card,
    .settings-grid > .card:first-child,
    .settings-grid > .card:last-child,
    .span-2 {
        grid-column: span 12;
    }

    .settings-two-column,
    .settings-user-layout,
    .settings-logo-row,
    .settings-inline-form,
    .settings-tabs {
        grid-template-columns: 1fr;
    }

    .settings-panel-head {
        flex-direction: column;
    }

    .permission-row {
        grid-template-columns: 1fr 1fr;
    }

    .district-check-grid {
        grid-template-columns: 1fr;
    }

    .permission-head {
        display: none;
    }

    .brand {
        max-width: none;
    }

    .receipt-letterhead {
        grid-template-columns: 72px minmax(0, 1fr) 72px;
    }

    .letterhead-logo img {
        height: 60px;
        max-height: 60px;
        max-width: 68px;
        width: 68px;
    }
}

@media (max-width: 768px) {
    .main,
    .auth-main {
        padding: 4.9rem 0.75rem 0.75rem;
    }

    .mobile-topbar {
        display: flex;
    }

    .mobile-nav-toggle {
        align-items: center;
        display: inline-flex;
        flex-direction: column;
        gap: 0.25rem;
        min-height: 42px;
        min-width: 42px;
        padding: 0.7rem;
    }

    .mobile-nav-backdrop {
        display: block;
    }

    .sidebar {
        border-radius: 0 0 24px 24px;
        border-right: 0;
        box-shadow: 0 24px 42px rgba(31, 42, 54, 0.16);
        height: auto;
        left: 0.75rem;
        max-height: calc(100vh - 6.2rem);
        max-width: none;
        overflow-y: auto;
        padding: 1rem 0.9rem;
        position: fixed;
        right: 0.75rem;
        top: 4.35rem;
        transform: translateY(-1rem);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
        visibility: hidden;
        width: auto;
        z-index: 1080;
        opacity: 0;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    body.mobile-nav-open .mobile-nav-backdrop {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    body.mobile-nav-open .sidebar {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }

    .brand-wrap {
        display: none;
    }

    .brand {
        font-size: 1.05rem;
    }

    .brand-subtitle,
    .sidebar-foot span {
        font-size: 0.78rem;
    }

    .nav {
        gap: 0.55rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 0;
    }

    .nav a {
        min-width: 0;
        padding: 0.82rem 0.78rem;
        text-align: center;
    }

    .sidebar-foot {
        margin-top: 0.85rem;
        padding: 0.85rem;
    }

    .page-header h1 {
        font-size: 1.55rem;
        line-height: 1.15;
        max-width: none;
    }

    .card,
    .hero-card,
    .stat-card,
    .print-sheet,
    .certificate-frame {
        border-radius: 22px;
        padding: 1rem;
    }

    .quick-links {
        gap: 0.8rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-link {
        padding: 0.9rem 0.8rem;
    }

    .list-summary,
    .receipt-actions {
        gap: 0.75rem;
    }

    .header-actions,
    .hero-actions,
    .receipt-actions,
    .certificate-top-actions {
        width: 100%;
    }

    .header-actions .button-link,
    .header-actions button,
    .hero-actions .button-link,
    .hero-actions button,
    .receipt-actions .button-link,
    .receipt-actions button,
    .certificate-top-actions .button-link,
    .certificate-top-actions button {
        width: 100%;
    }

    .form-actions {
        justify-content: stretch;
    }

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

    .flash {
        padding: 0.9rem 1rem;
    }

    .table-wrap {
        margin: 0 -0.15rem;
    }

    table {
        min-width: 640px;
    }

    .pagination {
        justify-content: flex-start;
    }

    .receipt-letterhead {
        gap: 0.5rem;
        grid-template-columns: 56px minmax(0, 1fr) 56px;
    }

    .letterhead-logo img,
    .association-logos img,
    .certificate-logos img {
        height: 48px;
        max-height: 48px;
        max-width: 48px;
        width: 48px;
    }

    .letterhead-center h1,
    .certificate-letterhead .letterhead-center h1 {
        font-size: 1.15rem;
        line-height: 1.2;
    }

    .letterhead-center div {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .receipt-title-row h2,
    .certificate-title-row h1 {
        font-size: 1.05rem;
    }

    .certificate-title-row {
        flex-direction: column;
    }

    .certificate-title-row .certificate-actions {
        position: static;
        width: 100%;
    }

    .receipt-system-note {
        min-width: 0;
        text-align: left;
    }
}

@media (max-width: 520px) {
    .main,
    .auth-main {
        padding: 4.9rem 0.6rem 0.6rem;
    }

    .mobile-topbar {
        left: 0.6rem;
        right: 0.6rem;
        top: 0.6rem;
    }

    .mobile-topbar__text strong {
        font-size: 0.86rem;
    }

    .mobile-topbar__text span {
        font-size: 0.72rem;
    }

    .sidebar {
        left: 0.6rem;
        right: 0.6rem;
        top: 4.2rem;
    }

    .nav,
    .quick-links {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 1.35rem;
    }

    .card h2,
    .auth-panel h2,
    .auth-hero h1 {
        font-size: 1.1rem;
    }

    .receipt-letterhead {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .letterhead-logo {
        min-height: 0;
    }

    .letterhead-center {
        order: 2;
    }

    .receipt-title-row,
    .signature-row {
        gap: 0.65rem;
    }

    .details div,
    .certificate-metrics div {
        padding: 0.85rem;
    }

    table {
        min-width: 560px;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    button,
    .print-button,
    .receipt-screen-actions,
    .button-link {
        display: none;
    }

    body {
        background: #fff;
    }

    .print-body {
        background: #fff;
        padding: 0;
    }

    .certificate-frame {
        box-shadow: none;
    }

    .print-sheet {
        border-radius: 0;
        box-shadow: none;
        max-width: none;
        padding: 1rem;
        page-break-inside: avoid;
        break-inside: avoid;
        width: 100%;
    }

    .association-logos img,
    .print-logos img,
    .certificate-logos img {
        height: 54px;
        max-height: 54px;
        max-width: 54px;
        width: 54px;
    }

    .receipt-letterhead {
        display: grid;
        grid-template-columns: 110px minmax(0, 1fr) 110px;
        padding-bottom: 0.6rem;
    }

    .letterhead-logo {
        min-height: 70px;
    }

    .letterhead-logo img {
        height: 68px;
        max-height: 68px;
        max-width: 82px;
        width: 82px;
    }

    .letterhead-center h1 {
        font-size: 1.8rem;
        margin-bottom: 0.25rem;
    }

    .letterhead-center div {
        font-size: 0.85rem;
        line-height: 1.25;
    }

    .print-head,
    .receipt-title-row,
    .signature-row {
        align-items: center;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }

    .receipt-title-row {
        margin-top: 0.6rem;
    }

    .receipt-title-row h2 {
        font-size: 1.25rem;
    }

    .print-grid {
        display: grid;
        gap: 0.45rem 1rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 0.65rem;
    }

    .print-grid div {
        font-size: 0.86rem;
        padding: 0.32rem 0;
    }

    .amount-box {
        font-size: 0.95rem;
        margin-top: 0.65rem;
        padding: 0.55rem 0.8rem;
    }

    .signature-row {
        font-size: 0.86rem;
        margin-top: 0.65rem;
    }

    .receipt-system-note {
        min-width: 300px;
        text-align: right;
    }

    .certificate-frame {
        border-width: 10px;
        box-shadow: none;
        page-break-inside: avoid;
        break-inside: avoid;
        padding: 1.2rem;
    }

    .certificate-letterhead {
        margin-bottom: 0.65rem;
    }

    .certificate-letterhead .letterhead-center h1 {
        font-size: 1.7rem;
    }

    .certificate-title-row h1 {
        font-size: 1.25rem;
        margin-bottom: 0.45rem;
    }

    .certificate-text {
        font-size: 0.92rem;
        line-height: 1.45;
    }

    .certificate-metrics {
        gap: 0.65rem;
        margin-top: 0.8rem;
    }

    .certificate-metrics div {
        padding: 0.65rem;
    }

    .certificate-signature {
        margin-top: 0.75rem;
    }
}
