:root {
    --bg: #f6f7f4;
    --surface: #ffffff;
    --surface-muted: #eef3ed;
    --line: #d9ded6;
    --line-strong: #b7c2b3;
    --text: #1d2520;
    --muted: #66736a;
    --brand: #17633a;
    --brand-strong: #0c4f2d;
    --gold: #d7b56d;
    --danger: #a43b3b;
    --shadow: 0 12px 30px rgba(26, 45, 36, .08);
    --sidebar-width: 292px;
}

.family-review-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.family-review-stats article {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 16px;
}

.family-review-stats span {
    display: block;
    color: var(--muted);
    font-size: .88rem;
    margin-bottom: 8px;
}

.family-review-stats strong {
    color: var(--text);
    font-size: 1.55rem;
}

.food-basket-stats-compact {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.food-basket-stats-compact article {
    padding: 10px 12px;
}

.food-basket-stats-compact span {
    font-size: .78rem;
    margin-bottom: 4px;
}

.food-basket-stats-compact strong {
    font-size: 1.2rem;
}

.food-basket-criteria-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.family-review-section {
    margin-bottom: 18px;
}

.family-review-document-form {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 110px 92px 82px auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
    padding: 12px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.family-review-document-form .field {
    margin: 0;
}

.inline-check.compact {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #cdd5ca;
    border-radius: 8px;
    color: #314138;
    font-weight: 800;
}

.family-review-document-form input[type="checkbox"],
.family-review-document-table input[type="checkbox"] {
    flex: 0 0 18px;
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--brand);
}

.family-review-document-form .btn {
    min-height: 42px;
    white-space: nowrap;
}

.financial-table.family-review-document-table {
    min-width: 920px;
    table-layout: fixed;
}

.family-review-document-table th:nth-child(1) {
    width: 42%;
}

.family-review-document-table th:nth-child(2),
.family-review-document-table th:nth-child(3) {
    width: 78px;
}

.family-review-document-table th:nth-child(4) {
    width: 110px;
}

.family-review-document-table th:nth-child(5) {
    width: 100px;
}

.family-review-document-table th:nth-child(6) {
    width: 110px;
}

.financial-table.family-review-document-table td {
    white-space: normal;
    vertical-align: middle;
}

.family-review-document-table .document-type-edit-fields {
    display: grid;
    gap: 6px;
}

.family-review-document-table .document-type-edit-fields textarea {
    min-height: 44px;
    max-height: 82px;
    resize: vertical;
}

.family-review-document-table input[type="number"] {
    width: 82px;
    min-width: 82px;
    margin-inline: auto;
    text-align: center;
}

.family-review-document-table td:nth-child(2),
.family-review-document-table td:nth-child(3),
.family-review-document-table td:nth-child(4),
.family-review-document-table td:nth-child(5),
.family-review-document-table td:nth-child(6) {
    text-align: center;
}

.family-review-section .financial-table input:not([type="checkbox"]):not([type="number"]),
.family-review-section .financial-table textarea,
.family-review-table input:not([type="checkbox"]),
.family-review-table select,
.family-review-table textarea {
    width: 100%;
}

.family-review-section .financial-table textarea {
    min-height: 46px;
    margin-top: 6px;
}

.family-review-filter {
    grid-template-columns: minmax(260px, 1fr) minmax(170px, .5fr) minmax(170px, .5fr) 120px auto;
}

.food-basket-list-filter {
    grid-template-columns: minmax(220px, .7fr) minmax(320px, 1.4fr) minmax(150px, .45fr) minmax(130px, .35fr) auto;
    align-items: end;
}

.food-basket-list-filter .filter-heading {
    display: grid;
    gap: 3px;
    align-self: center;
}

.food-basket-list-filter .filter-heading strong {
    color: var(--brand-strong);
    font-size: 16px;
}

.food-basket-list-filter .filter-heading span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.gharimun-filter {
    grid-template-columns: minmax(260px, 1fr) minmax(140px, .45fr) minmax(150px, .5fr) minmax(150px, .5fr) 120px auto;
    align-items: end;
}

.gharimun-list-section {
    margin-top: 16px;
}

.gharimun-table {
    min-width: 1320px;
    table-layout: fixed;
}

.gharimun-table th:nth-child(1) {
    width: 48px;
}

.gharimun-table th:nth-child(2) {
    width: 210px;
}

.gharimun-table th:nth-child(3),
.gharimun-table th:nth-child(7),
.gharimun-table th:nth-child(9) {
    width: 115px;
}

.gharimun-table th:nth-child(4) {
    width: 112px;
}

.gharimun-table th:nth-child(5),
.gharimun-table th:nth-child(6) {
    width: 132px;
}

.gharimun-table th:nth-child(8) {
    width: 128px;
}

.gharimun-table th:nth-child(10) {
    width: 150px;
}

.gharimun-table th:nth-child(11) {
    width: 96px;
}

.gharimun-table td {
    white-space: normal;
    word-break: break-word;
}

.gharimun-table td:not(:nth-child(2)):not(:nth-child(10)) {
    text-align: center;
}

.gharimun-table .table-actions {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 5px;
}

.gharimun-modal-panel {
    width: min(1130px, calc(100vw - 30px));
    max-height: calc(100vh - 28px);
}

.gharimun-modal-panel .modal-body {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.gharimun-form {
    display: grid;
    gap: 18px;
}

.gharimun-form-section {
    padding: 14px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.gharimun-form-section .section-title {
    margin-bottom: 14px;
}

.gharimun-form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.gharimun-form-grid .wide {
    grid-column: span 2;
}

.gharimun-form-grid .full {
    grid-column: 1 / -1;
}

.amount-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.amount-input-group input {
    border-radius: 0 8px 8px 0;
}

.amount-input-group span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 0 10px;
    color: #34463b;
    background: #f3f5f1;
    border: 1px solid #cdd5ca;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    font-size: 12px;
    font-weight: 800;
}

.amount-input-group.compact span {
    min-width: 48px;
}

.gharimun-assistance-table {
    min-width: 840px;
    table-layout: fixed;
}

.gharimun-assistance-table th:nth-child(1) {
    width: 28%;
}

.gharimun-assistance-table th:nth-child(2),
.gharimun-assistance-table th:nth-child(3) {
    width: 170px;
}

.gharimun-assistance-table th:nth-child(5) {
    width: 70px;
}

.gharimun-assistance-table input {
    min-height: 38px;
}

.gharimun-attachment-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.gharimun-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 9px 10px;
    color: var(--brand-strong);
    background: #f7faf5;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
}

.gharimun-attachment-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gharimun-file-field {
    margin-top: 10px;
}

.gharimun-print-document {
    max-width: 1140px;
}

.gharimun-print-table {
    font-size: 11px;
}

.financial-table.family-review-table {
    min-width: 1040px;
    table-layout: fixed;
}

.financial-table.family-review-table th:nth-child(1) {
    width: 26%;
}

.financial-table.family-review-table th:nth-child(5),
.financial-table.family-review-table th:nth-child(6) {
    width: 130px;
}

.food-basket-family-table {
    width: 100%;
    table-layout: fixed;
}

.food-basket-family-table th:nth-child(1) {
    width: 22%;
}

.food-basket-family-table th:nth-child(2) {
    width: 102px;
}

.food-basket-family-table th:nth-child(3) {
    width: 98px;
}

.food-basket-family-table th:nth-child(4) {
    width: 14%;
}

.food-basket-family-table th:nth-child(5),
.food-basket-family-table th:nth-child(7) {
    width: 12%;
}

.food-basket-family-table th:nth-child(6) {
    width: 7%;
}

.food-basket-family-table th:nth-child(8) {
    width: 78px;
}

.food-basket-family-table th:nth-child(9) {
    width: 130px;
}

.food-basket-family-table th:nth-child(10) {
    width: 140px;
}

.food-basket-family-table.has-sms-selection th:nth-child(1) {
    width: 44px;
}

.food-basket-family-table.has-sms-selection th:nth-child(2) {
    width: 20%;
}

.food-basket-family-table.has-sms-selection th:nth-child(3) {
    width: 102px;
}

.food-basket-family-table.has-sms-selection th:nth-child(4) {
    width: 98px;
}

.food-basket-family-table.has-sms-selection th:nth-child(5) {
    width: 13%;
}

.food-basket-family-table.has-sms-selection th:nth-child(6),
.food-basket-family-table.has-sms-selection th:nth-child(8) {
    width: 12%;
}

.food-basket-family-table.has-sms-selection th:nth-child(7) {
    width: 7%;
}

.food-basket-family-table.has-sms-selection th:nth-child(9) {
    width: 78px;
}

.food-basket-family-table.has-sms-selection th:nth-child(10) {
    width: 130px;
}

.food-basket-family-table.has-sms-selection th:nth-child(11) {
    width: 140px;
}

.food-basket-family-table td {
    white-space: normal;
    word-break: break-word;
}

.food-basket-family-table td:nth-child(2),
.food-basket-family-table td:nth-child(3),
.food-basket-family-table td:nth-child(4),
.food-basket-family-table td:nth-child(5),
.food-basket-family-table td:nth-child(6),
.food-basket-family-table td:nth-child(7),
.food-basket-family-table td:nth-child(8),
.food-basket-family-table td:nth-child(10) {
    text-align: center;
}

.food-basket-family-table.has-sms-selection td:nth-child(2) {
    text-align: right;
}

.food-basket-family-table.has-sms-selection td:nth-child(3),
.food-basket-family-table.has-sms-selection td:nth-child(4),
.food-basket-family-table.has-sms-selection td:nth-child(5),
.food-basket-family-table.has-sms-selection td:nth-child(6),
.food-basket-family-table.has-sms-selection td:nth-child(7),
.food-basket-family-table.has-sms-selection td:nth-child(8),
.food-basket-family-table.has-sms-selection td:nth-child(9),
.food-basket-family-table.has-sms-selection td:nth-child(11) {
    text-align: center;
}

.food-basket-select-cell {
    text-align: center !important;
    vertical-align: middle;
}

.food-basket-select-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}

.food-basket-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0;
    padding: 8px 10px;
    background: #f7faf5;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.food-basket-selection-bar span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.food-basket-selection-bar strong {
    color: var(--brand-strong);
    font-size: 15px;
}

.food-basket-selection-bar .btn {
    min-height: 34px;
    padding: 7px 10px;
}

.food-basket-family-table .table-actions {
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
}

.food-basket-family-table .icon-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
}

.food-basket-family-table td:nth-child(8) .status-pill {
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
}

.food-basket-family-table.has-sms-selection td:nth-child(9) .status-pill {
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
}

.table-record-link {
    color: var(--brand-strong);
    font-weight: 800;
    text-decoration: none;
}

.table-record-link:hover,
.table-record-link:focus-visible {
    color: var(--brand);
    text-decoration: underline;
}

.food-basket-print-document {
    max-width: 1140px;
}

.food-basket-print-table {
    font-size: 11px;
}

.food-basket-print-table th:nth-child(1),
.food-basket-print-table td:nth-child(1) {
    width: 34px;
    text-align: center;
}

.food-basket-print-table th:nth-child(2),
.food-basket-print-table td:nth-child(2),
.food-basket-print-table th:nth-child(4),
.food-basket-print-table td:nth-child(4),
.food-basket-print-table th:nth-child(5),
.food-basket-print-table td:nth-child(5),
.food-basket-print-table th:nth-child(7),
.food-basket-print-table td:nth-child(7),
.food-basket-print-table th:nth-child(8),
.food-basket-print-table td:nth-child(8),
.food-basket-print-table th:nth-child(9),
.food-basket-print-table td:nth-child(9) {
    text-align: center;
}

.family-review-deficiency-btn {
    display: inline-grid;
    grid-template-columns: auto auto;
    gap: 6px;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    min-height: 34px;
    padding: 5px 10px;
    color: var(--brand-strong);
    background: #eef7f0;
    border: 1px solid #bfd8c7;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.family-review-deficiency-btn strong {
    font-size: 1rem;
}

.family-review-deficiency-btn span {
    color: var(--muted);
    font-size: .78rem;
}

.family-review-deficiency-btn:hover,
.family-review-deficiency-btn:focus-visible {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.family-review-deficiency-btn:hover span,
.family-review-deficiency-btn:focus-visible span {
    color: rgba(255, 255, 255, .88);
}

.family-review-progress {
    display: grid;
    gap: 5px;
    min-width: 96px;
}

.family-review-progress span {
    color: var(--text);
    font-weight: 900;
}

.family-review-progress i {
    display: block;
    height: 7px;
    overflow: hidden;
    background: #edf1eb;
    border-radius: 999px;
}

.family-review-progress i::before {
    content: "";
    display: block;
    width: var(--progress);
    height: 100%;
    background: var(--brand);
    border-radius: inherit;
}

.family-review-details-modal {
    width: min(1160px, calc(100vw - 36px));
    max-height: calc(100vh - 34px);
    overflow: hidden;
}

.family-review-details-modal .modal-body {
    max-height: calc(100vh - 132px);
    overflow-y: auto;
}

.family-review-details-modal .modal-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
}

.family-review-modal-body {
    display: grid;
    gap: 14px;
}

.family-review-modal-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.family-review-modal-summary article {
    padding: 12px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.family-review-modal-summary span {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    margin-bottom: 4px;
}

.family-review-modal-summary strong {
    color: var(--brand-strong);
    font-size: 1.25rem;
}

.family-review-detail-grid.compact,
.family-review-actions-grid.compact {
    padding-inline: 0;
    padding-bottom: 0;
}

.family-review-actions-grid.compact {
    margin-top: 0;
    grid-template-columns: 1fr;
    gap: 12px;
}

.family-review-action-card {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
}

.family-review-actions-grid .family-review-action-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.family-review-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e7ebe5;
}

.family-review-card-head h3 {
    margin: 0;
    color: var(--brand-strong);
    font-size: 1rem;
}

.family-review-card-footer {
    display: flex;
    justify-content: flex-start;
    padding-top: 2px;
}

.family-review-card-footer .btn {
    min-width: 132px;
}

.family-review-form-grid.review-update-grid {
    display: grid;
    grid-template-columns: minmax(110px, .7fr) minmax(220px, 1.4fr) minmax(170px, 1fr) minmax(170px, 1fr);
    gap: 10px;
}

.family-review-form-grid.attachment-upload-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(170px, 1fr) minmax(165px, .9fr) minmax(210px, 1.2fr);
    gap: 10px;
}

.family-review-form-grid.attachment-upload-grid .document-type-field {
    grid-column: span 1;
}

.family-review-form-grid.attachment-upload-grid .attachment-file-field {
    grid-column: span 1;
}

.family-review-form-grid.review-update-grid .field,
.family-review-form-grid.attachment-upload-grid .field {
    min-width: 0;
}

.family-review-form-grid.review-update-grid label,
.family-review-form-grid.attachment-upload-grid label {
    margin-bottom: 4px;
    font-size: .82rem;
    font-weight: 800;
}

.family-review-form-grid.review-update-grid input,
.family-review-form-grid.review-update-grid select,
.family-review-form-grid.attachment-upload-grid input,
.family-review-form-grid.attachment-upload-grid select {
    min-height: 38px;
    padding: 7px 9px;
}

.family-review-form-grid.review-update-grid textarea,
.family-review-form-grid.attachment-upload-grid textarea {
    min-height: 76px;
    padding: 8px 10px;
}

.family-review-form-grid.attachment-upload-grid input[type="file"] {
    padding: 6px 8px;
    overflow: hidden;
}

.family-review-pagination {
    margin-top: 14px;
}

.family-review-sms-missing {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    background: #f7faf5;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.family-review-sms-missing span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.family-review-sms-missing strong {
    color: var(--brand-strong);
    font-size: 13px;
    line-height: 1.7;
}

.family-review-detail-grid,
.family-review-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0 16px 16px;
}

.family-review-detail-grid h3,
.family-review-actions-grid h3 {
    margin: 0 0 10px;
    font-size: .98rem;
    color: var(--text);
}

.family-review-item-list,
.family-attachment-list {
    display: grid;
    gap: 8px;
}

.family-review-item-list[hidden] {
    display: none;
}

.family-review-item-list article,
.family-attachment-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 10px 12px;
}

.family-review-item-list article p,
.family-attachment-list article span {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
}

.family-review-item-list article.missing strong {
    color: #b42318;
}

.family-review-item-list article.complete strong {
    color: var(--brand);
}

.family-review-actions-grid {
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.family-review-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.family-review-form-grid .field {
    grid-column: auto;
}

.family-review-form-grid .full {
    grid-column: 1 / -1;
}

.family-review-modal-panel {
    width: min(1180px, calc(100vw - 36px));
    max-width: none;
    max-height: calc(100vh - 34px);
    overflow: hidden;
}

.family-review-modal-panel .modal-body {
    max-height: calc(100vh - 132px);
    overflow-y: auto;
}

.family-review-modal-documents {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.family-review-modal-section-title {
    align-items: center;
}

.family-review-modal-documents .family-review-document-form {
    grid-template-columns: minmax(240px, 1fr) 110px 94px 82px auto;
}

.family-review-document-table-wrap.modal-document-table {
    max-height: 360px;
    overflow: auto;
    box-shadow: none;
}

.family-review-document-table-wrap.modal-document-table .family-review-document-table {
    min-width: 900px;
}

@media (max-width: 960px) {
    .family-review-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .family-review-document-form,
    .family-review-filter,
    .family-review-detail-grid,
    .family-review-actions-grid,
    .family-review-modal-summary {
        grid-template-columns: 1fr;
    }

    .family-review-form-grid {
        grid-template-columns: 1fr;
    }

    .family-review-form-grid.review-update-grid,
    .family-review-form-grid.attachment-upload-grid {
        grid-template-columns: 1fr;
    }

    .family-review-form-grid.attachment-upload-grid .document-type-field {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .family-review-stats {
        grid-template-columns: 1fr;
    }

}

* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
}

body.has-app-sidebar {
    background:
        linear-gradient(90deg, rgba(246, 247, 244, 0) 0, rgba(246, 247, 244, 0) calc(100% - var(--sidebar-width)), #0e3c27 calc(100% - var(--sidebar-width)));
}

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

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 70px;
    padding: 14px 32px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.has-app-sidebar .topbar {
    margin-right: var(--sidebar-width);
    padding: 13px 28px;
    min-height: 64px;
}

.topbar-context {
    display: grid;
    gap: 1px;
}

.topbar-context span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.topbar-context strong {
    color: var(--brand-strong);
    font-size: 18px;
    line-height: 1.35;
}

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

.app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    padding: 18px 16px;
    color: #edf7ef;
    background:
        linear-gradient(180deg, #0f4d2e 0%, #0d3d27 48%, #092f20 100%);
    border-left: 1px solid rgba(255, 255, 255, .1);
    box-shadow: -14px 0 36px rgba(9, 47, 32, .22);
    overflow-y: auto;
}

.app-sidebar-brand {
    display: grid;
    gap: 10px;
    padding: 4px 4px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.app-sidebar-nav-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    color: #edf7ef;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.app-sidebar-nav-toggle .icon {
    width: 18px;
    height: 18px;
}

.app-sidebar .brand {
    color: #fff;
    font-size: 19px;
}

.app-sidebar .brand-subtitle {
    color: rgba(237, 247, 239, .72);
}

.app-sidebar .brand-logos img {
    background: rgba(255, 255, 255, .95);
    border-color: rgba(255, 255, 255, .32);
}

.app-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 16px;
    padding: 12px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
}

.app-sidebar-user span {
    color: rgba(237, 247, 239, .7);
    font-size: 12px;
    font-weight: 800;
}

.app-sidebar-user strong {
    color: #fff;
    line-height: 1.35;
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: #fff;
    background: var(--brand);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    font-weight: 900;
    object-fit: cover;
}

.profile-avatar.xs {
    width: 26px;
    height: 26px;
    font-size: 12px;
}

.profile-avatar.sm {
    width: 42px;
    height: 42px;
    font-size: 16px;
}

.profile-avatar.xl {
    width: 118px;
    height: 118px;
    font-size: 42px;
}

.app-sidebar-nav {
    display: grid;
    gap: 10px;
    flex: 1;
    align-content: start;
    padding-bottom: 12px;
}

.app-sidebar-group {
    display: grid;
    gap: 6px;
    padding: 5px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    transition: background .15s ease, border-color .15s ease;
}

.app-sidebar-group:has(.app-sidebar-link.active),
.app-sidebar-group.is-open {
    background: rgba(255, 255, 255, .075);
    border-color: rgba(215, 181, 109, .28);
}

.app-sidebar-group.is-collapsed {
    gap: 0;
}

.app-sidebar-settings {
    margin-top: auto;
}

.app-sidebar-group h2 {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 38px;
    margin: 0;
    padding: 8px 10px;
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    background: rgba(0, 0, 0, .12);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.app-sidebar-group h2::before {
    width: 4px;
    height: 18px;
    content: "";
    background: var(--gold);
    border-radius: 999px;
    box-shadow: 0 0 0 3px rgba(215, 181, 109, .08);
}

.app-sidebar-group h2:hover,
.app-sidebar-group h2:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(215, 181, 109, .36);
    outline: none;
}

.app-sidebar-group-title {
    flex: 1;
}

.app-sidebar-group-toggle-icon {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 1px solid rgba(237, 247, 239, .24);
    border-radius: 999px;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.app-sidebar-group-toggle-icon::before,
.app-sidebar-group-toggle-icon::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 2px;
    content: "";
    background: currentColor;
    border-radius: 999px;
    transform: translate(-50%, -50%);
}

.app-sidebar-group-toggle-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    transition: opacity .15s ease;
}

.app-sidebar-group.is-open .app-sidebar-group-toggle-icon {
    background: rgba(215, 181, 109, .16);
    border-color: rgba(215, 181, 109, .52);
}

.app-sidebar-group.is-open .app-sidebar-group-toggle-icon::after {
    opacity: 0;
}

.app-sidebar-group.is-collapsed .app-sidebar-group-toggle-icon {
    transform: rotate(0deg);
}

.app-sidebar-group.is-collapsed .app-sidebar-link {
    display: none;
}

.app-sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 43px;
    padding: 9px 11px;
    color: rgba(237, 247, 239, .82);
    border: 1px solid transparent;
    border-radius: 8px;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.app-sidebar-link:hover,
.app-sidebar-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .12);
    outline: none;
}

.app-sidebar-link.active {
    color: #0e3c27;
    background: #f5f8f1;
    border-color: rgba(215, 181, 109, .75);
    box-shadow: 0 10px 20px rgba(3, 25, 16, .2);
}

.app-sidebar-link.active::before {
    position: absolute;
    top: 10px;
    right: -16px;
    width: 4px;
    height: calc(100% - 20px);
    content: "";
    background: var(--gold);
    border-radius: 999px 0 0 999px;
}

.app-sidebar-link.danger {
    color: #ffd7d7;
}

.app-sidebar-link.danger:hover,
.app-sidebar-link.danger:focus-visible {
    color: #fff;
    background: rgba(164, 59, 59, .22);
}

.app-sidebar-link .icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.brand {
    display: block;
    color: var(--brand-strong);
    font-size: 21px;
    font-weight: 800;
}

.brand-subtitle {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logos {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logos:empty {
    display: none;
}

.brand-logos img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.topnav a,
.tab-link,
.btn {
    border-radius: 8px;
}

.topnav a {
    padding: 8px 14px;
    color: var(--muted);
}

.topnav a.active,
.topnav a:hover {
    background: var(--surface-muted);
    color: var(--brand-strong);
}

.nav-user {
    padding: 7px 10px;
    color: var(--muted);
    background: #f7f9f6;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
}

.profile-nav-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-top-menu {
    z-index: 20;
}

.user-top-menu-toggle {
    border: 1px solid var(--line);
    cursor: pointer;
}

.user-top-menu-toggle[aria-expanded="true"] {
    color: var(--brand-strong);
    background: #eef5ee;
    border-color: #b8d2bd;
}

.user-top-menu-chevron {
    width: 14px;
    height: 14px;
    color: #6c7870;
}

.user-top-menu-panel {
    width: 230px;
}

.user-top-menu-panel form {
    margin: 0;
}

.auth-inline-link {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    color: var(--brand-strong);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.auth-inline-link:hover,
.auth-inline-link:focus-visible {
    color: var(--brand);
    text-decoration: underline;
}

.mail-alert-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 10px;
    color: #174d72;
    background: #e8f3fb;
    border: 1px solid #b9d9ef;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.mail-alert-link .icon {
    width: 17px;
    height: 17px;
}

.mail-alert-link strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    color: #fff;
    background: #174d72;
    border-radius: 999px;
    line-height: 1;
}

.mail-alert-link small {
    color: #8b2929;
    font-size: 11px;
}

.mail-alert-link.has-overdue {
    color: #8b2929;
    background: #fff0ef;
    border-color: #e6b6b0;
}

.mail-alert-link.has-overdue strong {
    background: #b42318;
}

.mail-alert-link.sponsorship-alert-link {
    color: #7a4c0b;
    background: #fff7df;
    border-color: #e5c879;
}

.mail-alert-link.sponsorship-alert-link strong {
    background: #a76506;
}

.mail-alert-link.sponsorship-alert-link.has-overdue {
    color: #8b2929;
    background: #fff0ef;
    border-color: #e6b6b0;
}

.mail-alert-link.sponsorship-alert-link.has-overdue strong {
    background: #b42318;
}

.sidebar-mail-alert {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 5px;
    padding: 4px 7px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
}

.sidebar-mail-alert.sponsorship-sidebar-alert {
    background: rgba(255, 214, 118, .18);
    border-color: rgba(255, 225, 154, .34);
}

.profile-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.profile-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.profile-photo-wrap {
    padding: 8px;
    background: #f7f9f6;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.profile-card-body {
    display: grid;
    gap: 4px;
}

.profile-card-body h2 {
    margin: 0;
    font-size: 22px;
}

.profile-card-body span,
.profile-card-body p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.page-shell {
    flex: 1 0 auto;
    width: min(1380px, calc(100% - 40px));
    margin: 26px auto 30px;
}

.has-app-sidebar .page-shell {
    width: min(1380px, calc(100% - var(--sidebar-width) - 56px));
    margin: 24px calc(var(--sidebar-width) + 28px) 30px 28px;
}

.app-footer {
    flex: 0 0 auto;
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto 22px;
    color: var(--muted);
}

.has-app-sidebar .app-footer {
    width: min(1380px, calc(100% - var(--sidebar-width) - 56px));
    margin: 0 calc(var(--sidebar-width) + 28px) 22px 28px;
}

.app-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.app-footer-brand,
.app-footer-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.app-footer-brand strong {
    color: var(--brand-strong);
}

.app-footer-brand span,
.app-footer-meta span {
    position: relative;
}

.app-footer-meta span + span::before {
    content: "";
    position: absolute;
    top: 50%;
    right: -7px;
    width: 1px;
    height: 12px;
    background: var(--line-strong);
    transform: translateY(-50%);
}

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

.page-heading h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.3;
}

.page-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

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

.inline-upload-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-upload-form input[type="file"] {
    max-width: 310px;
    min-height: 42px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.filter-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
}

.filter-form .field {
    flex: 0 0 auto;
    min-width: 0;
}

.filter-form .filter-search {
    flex: 1 1 720px;
    min-width: 720px;
}

.filter-form .filter-status {
    flex-basis: 175px;
}

/* The vouchers filter bar has five extra dropdowns (status/program/batch/
   received) next to the search box — the generic 720px minimum above, plus
   the base nowrap/overflow-x:auto row, squeezed them into a horizontally
   scrolling strip. This page gets a narrower search field and lets the
   filters wrap onto a second line instead of scrolling. */
.filter-form.voucher-filter-form {
    flex-wrap: wrap;
    overflow-x: visible;
}

.filter-form.voucher-filter-form .filter-search {
    flex: 1 1 260px;
    min-width: 220px;
}

.filter-form.settlement-filter-form {
    flex-wrap: wrap;
    overflow-x: visible;
}

.filter-form.settlement-filter-form .filter-search {
    flex: 1 1 320px;
    min-width: 260px;
}

.filter-form .filter-size {
    flex-basis: 120px;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    flex: 0 0 auto;
    gap: 10px;
    padding-bottom: 0;
}

.filter-actions .btn {
    min-height: 42px;
    white-space: nowrap;
}

.inline-import-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-import-form input[type="file"] {
    max-width: 240px;
    min-height: 40px;
    padding: 7px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.filter-count-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 5px 9px;
    color: #6d5a05;
    background: #fff8cf;
    border: 1px solid #e6d86c;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.registered-filter-form {
    padding: 16px;
}

.registered-filter-head {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.registered-filter-head .filter-search {
    flex: 1 1 auto;
}

.input-action-wrap.has-inline-tools input {
    padding-left: 124px;
}

.input-action-tools {
    position: absolute;
    top: 50%;
    left: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
    transform: translateY(-50%);
}

.input-action-tools .input-icon-btn {
    position: relative;
    top: auto;
    left: auto;
    flex: 0 0 auto;
    transform: none;
}

.input-icon-btn.active {
    color: var(--brand-strong);
    background: var(--surface-muted);
}

.filter-clear-btn {
    color: #b73535;
}

.filter-clear-btn:hover,
.filter-clear-btn:focus-visible {
    color: #8f2424;
    background: #fff1f1;
}

.filter-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    color: #fff;
    background: var(--brand);
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.advanced-filters-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.advanced-filters-grid[hidden] {
    display: none;
}

.advanced-filter-field {
    min-width: 0;
}

.registered-filter-form .advanced-filters-grid {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
    gap: 12px 16px;
}

.registered-filter-form .advanced-filter-field {
    grid-column: auto;
}

.registered-filter-form .advanced-ranges-grid {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(190px, 1fr));
    gap: 12px 16px;
}

.multi-filter {
    position: relative;
}

.multi-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    color: #26342d;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    text-align: right;
}

.multi-filter-toggle span {
    min-width: 0;
    overflow: hidden;
    color: #6b766f;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-filter.has-selection .multi-filter-toggle span {
    color: var(--text);
    font-weight: 800;
}

.multi-filter-toggle .icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.multi-filter-toggle[aria-expanded="true"] {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(23, 99, 58, .12);
}

.multi-filter-panel {
    position: absolute;
    right: 0;
    left: 0;
    z-index: 900;
    margin-top: 5px;
    padding: 7px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(26, 45, 36, .14);
}

.multi-filter-panel[hidden] {
    display: none;
}

.multi-filter-search {
    min-height: 38px;
    margin-bottom: 6px;
}

.multi-filter-options {
    max-height: 260px;
    overflow-y: auto;
    padding-left: 2px;
}

.multi-filter-option {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 7px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
}

.multi-filter-option:hover {
    background: var(--surface-muted);
}

.multi-filter-option.is-filtered-out {
    display: none !important;
}

.multi-filter-option input {
    width: 16px;
    min-height: 16px;
}

.multi-filter-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-filter-option .icon {
    width: 16px;
    height: 16px;
    color: var(--brand-strong);
    opacity: 0;
}

.multi-filter-option:has(input:checked) .icon {
    opacity: 1;
}

.multi-filter-empty {
    padding: 18px 10px;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}

.range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.range-inputs input {
    min-width: 0;
    border-radius: 0;
}

.range-inputs input:first-child {
    border-radius: 0 6px 6px 0;
}

.range-inputs input:last-child {
    margin-right: -1px;
    border-radius: 6px 0 0 6px;
}

.advanced-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    grid-column: 1 / -1;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 2px;
}

.list-tools-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.table-meta-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 14px;
    color: var(--text);
}

.table-meta-bar strong {
    font-size: 15px;
    font-weight: 800;
}

.column-menu {
    position: relative;
}

.column-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 850;
    width: 280px;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(26, 45, 36, .14);
}

.column-menu-panel[hidden] {
    display: none;
}

.column-menu-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 7px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
}

.column-menu-panel label:hover {
    background: var(--surface-muted);
}

.column-menu-panel input {
    width: 16px;
    min-height: 16px;
}

.column-menu-actions {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--line);
}

.section,
.table-wrap,
.summary-band,
.print-block {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.section {
    padding: 22px;
    border-radius: 8px;
}

.section + .section {
    margin-top: 16px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.section-title h2 {
    margin: 0;
    font-size: 19px;
}

.section-title span {
    color: var(--muted);
    font-size: 13px;
}

.section-title.compact {
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 10px;
}

.section-title.compact h2 {
    font-size: 17px;
}

.dashboard-heading {
    align-items: center;
}

.financial-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.financial-nav-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}

.financial-nav-card:hover {
    border-color: var(--brand);
    transform: translateY(-1px);
}

.financial-nav-card strong {
    font-size: 14px;
    color: var(--brand-strong);
}

.financial-nav-card span {
    font-size: 12px;
    color: var(--muted);
}

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

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

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-alert-panel {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
    padding: 16px;
    background: #fff8ed;
    border: 1px solid #efd4aa;
    border-right: 5px solid #b86b16;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dashboard-alert-head {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.dashboard-alert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    color: #9a4d00;
    background: #fff1d8;
    border: 1px solid #efd4aa;
    border-radius: 8px;
}

.dashboard-alert-icon .icon {
    width: 25px;
    height: 25px;
}

.dashboard-alert-head h2 {
    margin: 0;
    color: #713800;
    font-size: 19px;
}

.dashboard-alert-head p {
    margin: 3px 0 0;
    color: #744c23;
    font-weight: 800;
}

.dashboard-metric {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 128px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dashboard-metric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 8px;
}

.dashboard-metric-icon .icon {
    width: 24px;
    height: 24px;
}

.dashboard-metric span,
.dashboard-ring-card span,
.dashboard-mini-stats span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-metric strong {
    display: block;
    margin-top: 2px;
    font-size: 29px;
    line-height: 1.1;
}

.dashboard-metric small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 800;
}

.dashboard-metric.green {
    border-color: #c8dfcf;
}

.dashboard-metric.green .dashboard-metric-icon {
    color: #0f5f38;
    background: #e8f5ed;
}

.dashboard-metric.blue {
    border-color: #c6d8ec;
}

.dashboard-metric.blue .dashboard-metric-icon {
    color: #175d8a;
    background: #e8f2fb;
}

.dashboard-metric.gold {
    border-color: #ead9a8;
}

.dashboard-metric.gold .dashboard-metric-icon {
    color: #86630e;
    background: #fff5d8;
}

.dashboard-metric.red {
    border-color: #edc8c8;
}

.dashboard-metric.red .dashboard-metric-icon {
    color: #9b3030;
    background: #fff0f0;
}

.dashboard-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.dashboard-ring-card,
.dashboard-mini-stats,
.dashboard-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dashboard-ring-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 110px;
    padding: 14px;
}

.dashboard-ring-card:nth-child(1) {
    --ring-color: #17633a;
}

.dashboard-ring-card:nth-child(2) {
    --ring-color: #1b6d94;
}

.dashboard-ring-card:nth-child(3) {
    --ring-color: #b88413;
}

.dashboard-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    background:
        radial-gradient(circle, var(--surface) 0 57%, transparent 58%),
        conic-gradient(var(--ring-color, var(--brand)) var(--value), #e5ebe3 0);
    border-radius: 50%;
}

.dashboard-ring strong {
    color: var(--text);
    font-size: 17px;
    line-height: 1;
}

.dashboard-mini-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
}

.dashboard-mini-stats div {
    min-height: 54px;
    padding: 12px;
    background: #fbfcfa;
}

.dashboard-mini-stats strong {
    display: block;
    margin-top: 2px;
    color: var(--brand-strong);
    font-size: 20px;
    line-height: 1.2;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.dashboard-panel {
    grid-column: span 4;
    min-width: 0;
    padding: 16px;
}

.dashboard-panel.wide {
    grid-column: span 8;
}

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

.age-bucket {
    display: grid;
    gap: 9px;
    min-height: 88px;
    padding: 12px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.age-bucket-head,
.bar-list-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.age-bucket-head span,
.bar-list-label span {
    color: var(--brand-strong);
    font-weight: 800;
}

.stat-bar {
    width: 100%;
    height: 9px;
    overflow: hidden;
    background: #e7ece4;
    border-radius: 999px;
}

.stat-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #17633a, #d7b56d);
    border-radius: inherit;
}

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

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

.bar-list-label strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    min-height: 235px;
    padding: 12px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.activity-month {
    display: grid;
    grid-template-rows: minmax(150px, 1fr) auto;
    gap: 8px;
    align-items: end;
    min-width: 0;
    text-align: center;
}

.activity-bars {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 7px;
    height: 150px;
    padding-top: 8px;
    border-bottom: 1px solid var(--line);
}

.activity-bars span {
    width: 18px;
    min-height: 4px;
    border-radius: 999px 999px 0 0;
}

.activity-bars .cases,
.chart-legend .cases {
    background: #17633a;
}

.activity-bars .families,
.chart-legend .families {
    background: #d7b56d;
}

.activity-month strong {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.recent-list {
    display: grid;
    gap: 8px;
}

.recent-list a {
    display: grid;
    gap: 2px;
    padding: 10px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.recent-list a:hover,
.recent-list a:focus-visible {
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 3px rgba(23, 99, 58, .09);
}

.recent-list strong {
    color: var(--brand-strong);
}

.recent-list span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-list small {
    color: var(--muted);
    font-weight: 800;
}

.empty-state.compact {
    padding: 18px 12px;
    box-shadow: none;
}

.aid-requests-table {
    min-width: 1260px;
}

.inline-search-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.inline-search-form .filter-search {
    flex: 1 1 auto;
}

.request-picked-family {
    display: grid;
    gap: 2px;
    margin-top: 12px;
    padding: 12px 14px;
    color: var(--brand-strong);
    background: #eef7f1;
    border: 1px solid #c8e2d2;
    border-radius: 8px;
}

.request-picked-family span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.request-subtitle {
    margin-top: 22px;
}

.request-items-table {
    min-width: 980px;
}

.request-items-table th:first-child,
.request-items-table td:first-child {
    width: 54px;
}

.request-items-table th:last-child,
.request-items-table td:last-child {
    width: 70px;
}

.request-notes-grid {
    margin-top: 18px;
}

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

.request-read-grid div,
.request-approval-note {
    min-height: 96px;
    padding: 12px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.request-read-grid div:first-child,
.request-read-grid div:last-child {
    grid-column: 1 / -1;
}

.request-read-grid span,
.request-approval-note span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.request-read-grid strong,
.request-approval-note strong {
    display: block;
    margin-top: 5px;
    white-space: pre-wrap;
}

.request-approval-note {
    margin-top: 10px;
}

.sponsorship-tabs {
    margin-top: -4px;
}

.sponsorship-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.sponsorship-metrics article {
    min-height: 94px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.sponsorship-metrics span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.sponsorship-metrics strong {
    display: block;
    margin-top: 5px;
    color: var(--brand-strong);
    font-size: 25px;
    line-height: 1.2;
}

.sponsorship-metrics article.has-warning {
    background: #fffaf0;
    border-color: #e9c27d;
}

.sponsorship-metrics article.has-warning strong {
    color: #7a4c0b;
}

.sponsorship-metrics article.has-danger {
    background: #fff0ef;
    border-color: #e6b6b0;
}

.sponsorship-metrics article.has-danger strong {
    color: #8b2929;
}

.sponsorship-ending-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 14px 0;
    padding: 14px 16px;
    color: #2f2a1c;
    background: #fff8e7;
    border: 1px solid #e5c879;
    border-radius: 8px;
}

.sponsorship-ending-alert span {
    display: block;
    color: #7a4c0b;
    font-size: 12px;
    font-weight: 900;
}

.sponsorship-ending-alert strong {
    display: block;
    margin-top: 4px;
    color: #2f2a1c;
    font-size: 18px;
    font-weight: 900;
}

.sponsorship-ending-alert p {
    margin: 5px 0 0;
    color: #6b5a32;
    font-size: 13px;
    font-weight: 700;
}

.sponsorship-table,
.sponsors-table {
    min-width: 1260px;
}

.sponsorship-table th,
.sponsorship-table td,
.sponsors-table th,
.sponsors-table td {
    white-space: nowrap;
}

.sponsorship-table th:first-child,
.sponsorship-table td:first-child,
.sponsors-table th:first-child,
.sponsors-table td:first-child {
    min-width: 230px;
    white-space: normal;
}

.sponsorship-table-wrap .table-actions form,
.sponsors-table .table-actions form {
    display: inline-flex;
    margin: 0;
}

.filter-form.sponsorship-filter-form {
    display: grid;
    grid-template-columns: minmax(280px, 430px) 150px 170px minmax(170px, 220px) auto;
    align-items: end;
    overflow-x: visible;
}

.filter-form.sponsorship-filter-form .field,
.filter-form.sponsorship-filter-form .filter-search,
.filter-form.sponsorship-filter-form .filter-status {
    min-width: 0;
}

.filter-form.sponsorship-filter-form .filter-actions {
    justify-content: flex-start;
    min-width: 0;
}

.sponsorship-end-cell {
    display: grid;
    gap: 5px;
    justify-items: start;
}

.sponsorship-end-alert {
    width: fit-content;
    min-height: 24px;
    padding: 2px 8px;
    font-size: 11px;
}

.sponsorship-search-form {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 250px auto auto;
    gap: 12px;
    align-items: end;
}

.sponsorship-search-form .field,
.sponsorship-search-form .field.wide {
    grid-column: auto;
}

.sponsorship-search-actions {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
}

.searchable-select {
    display: grid;
    gap: 7px;
}

.searchable-select input[type="search"] {
    min-height: 38px;
    background: #fbfcfa;
}

.check-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin: 0;
    color: #314138;
    font-weight: 800;
}

.check-field input {
    width: 18px;
    min-height: 18px;
}

.sponsorship-available-check {
    align-self: end;
    white-space: nowrap;
}

.sponsorship-open-check {
    grid-column: span 2;
    align-self: end;
    padding: 8px 10px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.sponsorship-picked {
    margin-top: 12px;
}

.sponsorship-notes-field {
    margin-top: 14px;
}

.financial-modal-panel.sponsorship-modal-panel {
    width: min(1100px, calc(100vw - 36px));
}

.sponsorship-modal-panel .modal-body {
    max-height: min(76vh, 760px);
    overflow-y: auto;
}

.sponsorship-modal-search {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.sponsorship-modal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sponsorship-modal-grid .wide {
    grid-column: span 2;
}

.sponsorship-modal-grid .full {
    grid-column: 1 / -1;
}

.sponsorship-search-results-wrap {
    max-height: 260px;
    overflow: auto;
}

.sponsorship-sponsor-picker {
    position: relative;
    min-width: 0;
}

.sponsorship-sponsor-picker input[type="search"] {
    min-height: 44px;
    padding-inline: 14px;
    background: #fff;
}

.sponsorship-sponsor-list {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 9;
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(12, 24, 18, .16);
}

.sponsorship-sponsor-list[hidden] {
    display: none;
}

.sponsorship-sponsor-option {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    color: var(--text);
    text-align: right;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

.sponsorship-sponsor-option:hover,
.sponsorship-sponsor-option:focus,
.sponsorship-sponsor-option.is-active {
    background: #eef5ef;
    outline: 0;
}

.sponsorship-sponsor-option-text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.sponsorship-sponsor-option-text strong {
    font-size: 14px;
}

.sponsorship-sponsor-option-text small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
}

.sponsorship-sponsor-status {
    flex: 0 0 auto;
    padding: 3px 7px;
    color: var(--brand-strong);
    background: #f1f6ee;
    border: 1px solid #d7e4d6;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.sponsorship-sponsor-empty {
    padding: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.sponsorship-beneficiary-picker {
    display: grid;
    gap: 12px;
    padding: 14px;
    background: #f8faf7;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.sponsorship-beneficiary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.sponsorship-beneficiary-head label {
    display: block;
    margin-bottom: 3px;
    color: var(--text);
    font-size: 15px;
    font-weight: 900;
}

.sponsorship-beneficiary-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
}

.sponsorship-beneficiary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.sponsorship-beneficiary-combobox {
    position: relative;
    min-width: 0;
}

.sponsorship-beneficiary-combobox input[type="search"] {
    min-height: 44px;
    padding-inline: 14px;
    background: #fff;
}

.sponsorship-beneficiary-list {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 8;
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(12, 24, 18, .16);
}

.sponsorship-beneficiary-list[hidden] {
    display: none;
}

.sponsorship-beneficiary-option {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    color: var(--text);
    text-align: right;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

.sponsorship-beneficiary-option:hover,
.sponsorship-beneficiary-option:focus,
.sponsorship-beneficiary-option.is-active {
    background: #eef5ef;
    outline: 0;
}

.sponsorship-beneficiary-option-text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.sponsorship-beneficiary-option-text strong {
    font-size: 14px;
}

.sponsorship-beneficiary-option-text small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
}

.sponsorship-beneficiary-option-badges {
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sponsorship-beneficiary-option-badges span {
    padding: 3px 7px;
    color: var(--brand-strong);
    background: #f1f6ee;
    border: 1px solid #d7e4d6;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.sponsorship-beneficiary-empty {
    padding: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.sponsorship-beneficiary-available {
    max-width: 310px;
    white-space: normal;
    line-height: 1.55;
}

@media (max-width: 1100px) {
    .dashboard-metrics,
    .dashboard-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-panel,
    .dashboard-panel.wide {
        grid-column: span 12;
    }

    .sponsorship-search-form {
        grid-template-columns: 1fr 240px;
    }

    .filter-form.sponsorship-filter-form {
        grid-template-columns: minmax(260px, 1fr) 160px 170px;
    }

    .filter-form.sponsorship-filter-form .filter-search {
        max-width: none;
    }

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

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

    .sponsorship-beneficiary-available {
        max-width: none;
    }
}

@media (max-width: 620px) {
    .dashboard-metrics,
    .dashboard-quick-grid,
    .dashboard-alert-head,
    .age-bucket-grid,
    .activity-chart {
        grid-template-columns: 1fr;
    }

    .dashboard-alert-head .btn {
        justify-self: stretch;
    }

    .dashboard-ring-card {
        grid-template-columns: 68px minmax(0, 1fr);
    }

    .dashboard-ring {
        width: 64px;
        height: 64px;
    }

    .dashboard-mini-stats {
        grid-template-columns: 1fr;
    }

    .inline-search-form,
    .request-read-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .request-read-grid div:first-child,
    .request-read-grid div:last-child {
        grid-column: auto;
    }

    .sponsorship-metrics,
    .sponsorship-search-form {
        grid-template-columns: 1fr;
    }

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

    .filter-form.sponsorship-filter-form .field,
    .filter-form.sponsorship-filter-form .filter-status,
    .filter-form.sponsorship-filter-form .filter-search,
    .filter-form.sponsorship-filter-form .filter-actions {
        width: 100%;
        max-width: none;
    }

    .sponsorship-open-check {
        grid-column: 1 / -1;
    }

    .sponsorship-modal-grid {
        grid-template-columns: 1fr;
    }

    .sponsorship-modal-grid .wide {
        grid-column: 1 / -1;
    }

    .sponsorship-beneficiary-head {
        flex-direction: column;
        align-items: stretch;
    }

    .activity-month {
        grid-template-columns: 74px minmax(0, 1fr);
        grid-template-rows: auto;
        align-items: center;
        text-align: right;
    }

    .activity-bars {
        order: 2;
        height: 74px;
    }
}

.admin-panel {
    margin-bottom: 16px;
}

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

.admin-card {
    display: grid;
    gap: 7px;
    min-height: 128px;
    padding: 15px;
    text-align: right;
    color: var(--text);
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.admin-card:hover,
.admin-card.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(23, 99, 58, .09);
}

.admin-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--brand-strong);
    background: #eef7f1;
    border: 1px solid #c8e2d2;
    border-radius: 8px;
}

.admin-card strong {
    display: block;
    font-size: 16px;
}

.admin-card small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

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

.import-panel {
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 16px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.import-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--brand-strong);
    background: #eef7f1;
    border: 1px solid #c8e2d2;
    border-radius: 8px;
}

.import-panel h3 {
    margin: 0;
    font-size: 18px;
}

.import-panel p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.import-panel input[type="file"] {
    min-height: 42px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.admin-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.admin-content {
    min-width: 0;
}

.admin-sidebar {
    position: sticky;
    top: 92px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.admin-sidebar-header {
    padding: 3px 5px 13px;
    border-bottom: 1px solid var(--line);
}

.admin-sidebar-header span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.admin-sidebar-header strong {
    display: block;
    margin-top: 1px;
    color: var(--brand-strong);
    font-size: 18px;
    line-height: 1.35;
}

.admin-sidebar-nav {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.admin-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 10px;
    color: var(--muted);
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
}

.admin-sidebar-nav a:hover {
    color: var(--brand-strong);
    background: var(--surface-muted);
    border-color: var(--line);
}

.admin-sidebar-nav a.active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 8px 18px rgba(23, 99, 58, .16);
}

.admin-sidebar-nav .icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.lookup-management {
    padding: 18px;
}

.lookup-groups {
    display: grid;
    gap: 10px;
}

.lookup-group-card {
    overflow: hidden;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.lookup-group-card summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px 46px 12px 16px;
    color: #55625b;
    cursor: pointer;
    list-style: none;
}

.lookup-group-card summary::-webkit-details-marker {
    display: none;
}

.lookup-group-card summary::before {
    position: absolute;
    right: 16px;
    color: #5f788f;
    content: "+";
    font-size: 24px;
    line-height: 1;
}

.lookup-group-card[open] summary::before {
    color: #7c55a3;
    content: "-";
}

.lookup-group-card summary span {
    font-weight: 800;
}

.lookup-group-card summary small {
    color: var(--muted);
    font-weight: 800;
}

.lookup-group-body {
    padding: 14px 16px 16px;
    background: #fff;
    border-top: 1px solid var(--line);
}

.lookup-group-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.lookup-search {
    width: min(520px, 100%);
}

.lookup-options-table {
    min-width: 760px;
    table-layout: fixed;
}

.lookup-options-table.has-color-column {
    min-width: 860px;
}

.lookup-options-table th:nth-child(1),
.lookup-options-table td:nth-child(1) {
    width: 120px;
}

.lookup-options-table th:nth-child(3),
.lookup-options-table td:nth-child(3),
.lookup-options-table th:nth-child(4),
.lookup-options-table td:nth-child(4),
.lookup-options-table th:nth-child(5),
.lookup-options-table td:nth-child(5) {
    width: 110px;
}

.lookup-options-table.has-color-column th:nth-child(6),
.lookup-options-table.has-color-column td:nth-child(6) {
    width: 110px;
}

.lookup-color-input {
    width: 48px;
    min-height: 36px;
    padding: 3px;
}

.compact-checkbox {
    width: 18px;
    min-height: 18px;
}

.family-classification-settings .section-title {
    align-items: center;
}

.family-classification-grid {
    row-gap: 18px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}

.field {
    grid-column: span 3;
}

.field.wide {
    grid-column: span 6;
}

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

.settings-subsection {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.settings-subsection h3 {
    margin: 0;
    color: var(--brand-strong);
    font-size: 17px;
}

.settings-subsection p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

label {
    display: block;
    margin-bottom: 6px;
    color: #314138;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cdd5ca;
    border-radius: 8px;
    outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(23, 99, 58, .12);
}

.input-action-wrap {
    position: relative;
}

.input-action-wrap input {
    padding-left: 44px;
}

.input-icon-btn {
    position: absolute;
    top: 50%;
    left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transform: translateY(-50%);
}

.input-icon-btn:hover {
    color: var(--brand-strong);
    background: var(--surface-muted);
}

.hidden {
    display: none !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 800;
}

.btn.primary {
    background: var(--brand);
    color: #fff;
}

.btn.secondary {
    background: var(--surface-muted);
    color: var(--brand-strong);
    border-color: var(--line);
}

.btn.danger {
    background: #fff4f4;
    color: var(--danger);
    border-color: #e8c4c4;
}

.btn:hover {
    filter: brightness(.97);
}

.icon-btn {
    position: relative;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
}

.icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.icon-btn::after {
    position: absolute;
    right: 50%;
    bottom: calc(100% + 8px);
    z-index: 20;
    min-width: max-content;
    padding: 5px 8px;
    color: #fff;
    background: #1d2520;
    border-radius: 6px;
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translateX(50%) translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
}

.icon-btn:hover::after,
.icon-btn:focus-visible::after {
    opacity: 1;
    transform: translateX(50%) translateY(0);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.compact-actions {
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: center;
}

.action-menu {
    position: relative;
    z-index: 1;
}

.action-menu.is-open {
    z-index: 160;
}

.action-menu-toggle[aria-expanded="true"] {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.action-menu-panel {
    position: fixed;
    z-index: 3000;
    width: 236px;
    max-height: min(76vh, 560px);
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(26, 45, 36, .16);
}

.action-menu-panel[hidden] {
    display: none;
}

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    color: #27352d;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    text-align: right;
    font-weight: 800;
}

.action-menu-item:hover,
.action-menu-item:focus-visible {
    background: var(--surface-muted);
    color: var(--brand-strong);
    outline: none;
}

.action-menu-item .icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: #5f6b64;
}

.action-menu-item.disabled {
    color: #9aa49d;
    cursor: not-allowed;
}

.action-menu-item.disabled .icon {
    color: #aeb7b1;
}

.action-menu-item.danger {
    color: var(--danger);
}

.action-menu-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--line);
}

body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(12, 24, 18, .52);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-panel {
    width: min(1120px, calc(100vw - 32px));
    max-height: calc(100vh - 38px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 26px 60px rgba(12, 24, 18, .24);
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.modal-header span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.modal-header h2 {
    margin: 2px 0 0;
    font-size: 21px;
    line-height: 1.35;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 18px;
}

.family-card-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #f4f8f5, #fff);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.family-card-hero span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.family-card-hero strong {
    display: block;
    margin-top: 4px;
    font-size: 22px;
    line-height: 1.35;
}

.family-card-tags {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.family-signal-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.family-signal {
    min-height: 104px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.family-signal .icon {
    width: 22px;
    height: 22px;
    margin-bottom: 8px;
}

.family-signal span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.family-signal strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
    font-size: 17px;
    line-height: 1.35;
}

.family-signal.identity,
.family-info-group.identity {
    background: #edf7ef;
    border-color: #c4dfc8;
}

.family-signal.contact,
.family-info-group.contact {
    background: #edf6fb;
    border-color: #bddbec;
}

.family-signal.members,
.family-info-group.status {
    background: #fff6df;
    border-color: #ead18c;
}

.family-signal.finance,
.family-info-group.finance {
    background: #eef7f4;
    border-color: #bfe0d6;
}

.family-signal.studies,
.family-info-group.notes {
    background: #f4f1fa;
    border-color: #d8d0ea;
}

.family-signal.linked {
    background: #fff0ef;
    border-color: #e8c4c0;
}

.family-info-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.family-info-group {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.family-info-group-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
}

.family-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--brand-strong);
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(12, 79, 45, .16);
    border-radius: 8px;
}

.family-info-group h3 {
    margin: 0;
    font-size: 16px;
}

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

.family-info-item {
    min-height: 58px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 8px;
}

.family-info-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.family-info-item strong {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.45;
}

.family-assistance-sections {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.family-assistance-section {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.family-assistance-section.requests {
    background: #f2f8ff;
    border-color: #c8dcf2;
}

.family-assistance-section.baskets {
    background: #f2f8ef;
    border-color: #c8dfc1;
}

.family-assistance-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.family-assistance-title span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.family-assistance-title h3 {
    margin: 3px 0 0;
    color: var(--brand-strong);
    font-size: 17px;
}

.family-assistance-title > strong {
    display: inline-grid;
    min-width: 38px;
    height: 32px;
    place-items: center;
    padding-inline: 10px;
    color: var(--brand-strong);
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(12, 79, 45, .14);
    border-radius: 999px;
    font-size: 14px;
}

.family-assistance-list {
    display: grid;
    gap: 8px;
}

.family-assistance-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.7fr) repeat(3, minmax(100px, .7fr));
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, .75);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 8px;
}

.family-assistance-row div {
    min-width: 0;
}

.family-assistance-row span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.family-assistance-row strong {
    display: block;
    margin-top: 3px;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
}

.family-assistance-empty {
    padding: 13px;
    color: var(--muted);
    background: rgba(255, 255, 255, .72);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.family-print-members {
    margin-top: 12px;
}

.family-print-members h3 {
    margin: 0 0 10px;
    padding: 10px 12px;
    color: var(--brand-strong);
    background: #edf7ef;
    border: 1px solid #c4dfc8;
    border-radius: 8px;
    font-size: 15px;
}

.table-primary-link {
    color: var(--brand-strong);
    font-weight: 800;
}

.table-primary-link:hover,
.table-primary-link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 14px;
    margin-bottom: 6px;
}

.tab-link {
    flex: 0 0 auto;
    padding: 9px 13px;
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--line);
}

.tab-link.active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

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

.module-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 0 16px;
    padding: 2px 0 6px;
}

.module-tabs a {
    flex: 0 0 auto;
    min-height: 39px;
    padding: 8px 13px;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
}

.module-tabs a.active,
.module-tabs a:hover,
.module-tabs a:focus-visible {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    outline: none;
}

.family-form {
    padding-bottom: 18px;
}

.family-form-tabs {
    margin-bottom: 14px;
    padding-bottom: 10px;
}

.family-form-tabs .tab-link {
    cursor: pointer;
}

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

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

.family-tab-panel .grid {
    padding: 4px 0 0;
}

.summary-band {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
}

.summary-item {
    padding: 13px 15px;
    border-inline-start: 1px solid var(--line);
}

.summary-item:first-child {
    border-inline-start: 0;
}

.summary-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.summary-item strong {
    display: block;
    margin-top: 2px;
    font-size: 18px;
}

.case-summary {
    gap: 8px;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

.case-summary .summary-item {
    position: relative;
    min-height: 92px;
    padding: 14px 14px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.case-summary .summary-item:first-child {
    border-inline-start: 1px solid var(--line);
}

.case-summary .summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 8px;
    color: currentColor;
    background: rgba(255, 255, 255, .68);
    border: 1px solid rgba(255, 255, 255, .86);
    border-radius: 8px;
}

.case-summary .summary-icon .icon {
    width: 18px;
    height: 18px;
}

.case-summary .summary-income {
    color: #18563a;
    background: #edf8f1;
    border-color: #c5e6d0;
}

.case-summary .summary-family {
    color: #28527d;
    background: #eef6ff;
    border-color: #c8def4;
}

.case-summary .summary-installments {
    color: #7b5413;
    background: #fff7e8;
    border-color: #ecd29d;
}

.case-summary .summary-remaining {
    color: #245767;
    background: #eef8fa;
    border-color: #c5e3ea;
}

.case-summary .summary-share {
    color: #5c467a;
    background: #f5f0ff;
    border-color: #d8caf2;
}

.case-summary .summary-result.eligible {
    color: #0c5a31;
    background: #eaf8ef;
    border-color: #b8dfc4;
}

.case-summary .summary-result.not-eligible {
    color: #8b2929;
    background: #fff0ef;
    border-color: #e6b6b0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 10px;
    border-radius: 999px;
    color: var(--brand-strong);
    background: var(--surface-muted);
    font-weight: 800;
    font-size: 12px;
    border: 1px solid transparent;
}

.status-pill.warn {
    color: var(--danger);
    background: #fff4f4;
}

.status-pill.danger {
    color: #8b2929;
    background: #fff0ef;
    border-color: #e6b6b0;
}

.status-pill.success {
    color: #0c5a31;
    background: #e5f6ea;
    border-color: #aad8b8;
}

.status-pill.info {
    color: #174d72;
    background: #e8f3fb;
    border-color: #b9d9ef;
}

.status-pill.teal {
    color: #075c5f;
    background: #e5f7f3;
    border-color: #afe1d9;
}

.status-pill.draft {
    color: #626a14;
    background: #faf6d8;
    border-color: #e5da87;
}

.status-pill.ready {
    color: #365e18;
    background: #edf7df;
    border-color: #c8e4a5;
}

.status-pill.review {
    color: #7a4c0b;
    background: #fff1d9;
    border-color: #e9c27d;
}

.status-pill.approved,
.status-pill.eligible {
    color: #0c5a31;
    background: #e5f6ea;
    border-color: #aad8b8;
}

.status-pill.needs-edit,
.status-pill.not-eligible {
    color: #8b2929;
    background: #fff0ef;
    border-color: #e6b6b0;
}

.status-pill.closed,
.status-pill.pending,
.status-pill.neutral {
    color: #48524c;
    background: #eef1ef;
    border-color: #cfd7d2;
}

.classification-pill {
    justify-content: center;
    min-width: 74px;
}

.status-pill.classification-red {
    color: #8f2424;
    background: #ffe8e8;
    border-color: #efb3b3;
}

.status-pill.classification-orange {
    color: #8a4b07;
    background: #fff0dc;
    border-color: #eebd7a;
}

.status-pill.classification-yellow {
    color: #111827;
    background: #fde047;
    border-color: #eab308;
}

.status-pill.classification-neutral {
    color: #48524c;
    background: #eef1ef;
    border-color: #cfd7d2;
}

.status-pill.classification-pill.has-custom-color {
    color: var(--classification-text-color, #111827);
    background: var(--classification-color);
    border-color: color-mix(in srgb, var(--classification-color) 78%, #111827);
}

.financial-tabs,
.financial-settings-tabs {
    margin-bottom: 16px;
}

.financial-settings-tabs {
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.financial-metrics {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.financial-negative {
    color: var(--danger);
}

.financial-entry-form {
    margin-top: 16px;
}

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

.financial-form-grid .field {
    grid-column: span 1;
}

.financial-form-grid .wide {
    grid-column: span 2;
}

.financial-form-grid .full {
    grid-column: 1 / -1;
}

.financial-modal-panel {
    width: min(960px, calc(100vw - 36px));
}

.correspondence-modal-panel {
    width: min(1080px, calc(100vw - 36px));
}

.correspondence-modal-panel .modal-body {
    max-height: min(76vh, 760px);
    overflow-y: auto;
}

.correspondence-modal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.correspondence-modal-grid .wide {
    grid-column: span 2;
}

.correspondence-modal-grid .full {
    grid-column: 1 / -1;
}

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

@media (max-width: 640px) {
    .correspondence-modal-grid {
        grid-template-columns: 1fr;
    }

    .correspondence-modal-grid .wide {
        grid-column: 1 / -1;
    }
}

.voucher-redemption-panel {
    width: min(760px, calc(100vw - 36px));
    overflow-x: hidden;
}

.voucher-redemption-panel .modal-body {
    padding: 14px 16px;
    overflow-x: hidden;
}

.voucher-redemption-panel .financial-modal-form {
    gap: 10px;
}

.voucher-redemption-panel .section-title {
    padding-bottom: 8px;
}

.voucher-redemption-panel .section-title h2 {
    font-size: 17px;
}

.voucher-redemption-panel .section-title span {
    font-size: 12px;
}

.voucher-redemption-panel .financial-form-grid.modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.voucher-redemption-panel .financial-form-grid.modal-grid > * {
    min-width: 0;
}

.voucher-redemption-panel .financial-form-grid .wide,
.voucher-redemption-panel .financial-form-grid .full {
    grid-column: 1 / -1;
}

.voucher-redemption-panel .financial-form-grid.modal-grid label {
    font-size: 12px;
}

.voucher-redemption-panel .financial-form-grid.modal-grid input,
.voucher-redemption-panel .financial-form-grid.modal-grid select {
    min-height: 36px;
    padding-block: 6px;
}

.voucher-redemption-panel .financial-form-grid.modal-grid textarea {
    min-height: 50px;
}

.voucher-redemption-panel .field-hint {
    margin-top: 4px;
    font-size: 11px;
}

.voucher-redemption-panel .inline-check {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 38px;
    margin: 0;
    padding: 0;
    white-space: normal;
}

.voucher-redemption-panel .inline-check input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border-radius: 4px;
}

.voucher-redemption-panel .inline-check span {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.5;
}

.voucher-redemption-panel .financial-modal-footer {
    margin-top: 0;
    padding-block: 9px;
}

.financial-modal-form {
    display: grid;
    gap: 14px;
}

.financial-modal-form .section-title {
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.financial-form-grid.modal-grid {
    gap: 12px 14px;
}

.financial-form-grid.modal-grid .field {
    min-width: 0;
}

.financial-form-grid.modal-grid label {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 800;
}

.financial-form-grid.modal-grid input,
.financial-form-grid.modal-grid select {
    min-height: 40px;
    padding-block: 7px;
}

.financial-form-grid.modal-grid textarea {
    min-height: 78px;
}

.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
}

.modal-check-field {
    align-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0;
    padding: 8px 10px;
    background: #f7faf5;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.financial-modal-footer {
    position: sticky;
    bottom: -18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 4px -18px -18px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

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

.voucher-mode-choice label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 0;
    padding: 12px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.voucher-mode-choice label.active {
    background: #eef7f1;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(23, 99, 58, .1);
}

.voucher-mode-choice input {
    width: 18px;
    min-height: 18px;
    margin-top: 4px;
}

.voucher-mode-choice strong,
.voucher-mode-choice small {
    display: block;
}

.voucher-mode-choice strong {
    color: var(--brand-strong);
    font-size: 15px;
}

.voucher-mode-choice small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

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

.voucher-family-combobox {
    position: relative;
}

.voucher-family-combobox input[type="search"] {
    width: 100%;
}

.voucher-family-dropdown {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 35;
    display: grid;
    max-height: 260px;
    overflow: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 36px rgba(26, 42, 33, .14);
}

.voucher-family-dropdown[hidden] {
    display: none;
}

[data-family-select-results] {
    display: grid;
    gap: 2px;
}

.voucher-family-option {
    display: grid;
    gap: 6px;
    width: 100%;
    padding: 10px 12px;
    color: var(--text);
    text-align: right;
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

.voucher-family-option:hover,
.voucher-family-option:focus,
.voucher-family-option.is-active {
    background: #eef7f1;
    outline: none;
}

.voucher-family-option.is-active {
    box-shadow: inset 3px 0 0 var(--brand);
}

.voucher-family-option strong {
    color: var(--brand-strong);
    font-size: 14px;
}

.voucher-family-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.voucher-family-meta span {
    padding: 3px 7px;
    color: #3f4d44;
    background: #f4f7f2;
    border: 1px solid #e5ebe2;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.voucher-family-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.voucher-family-empty {
    padding: 12px;
    text-align: center;
}

.voucher-family-count {
    color: var(--brand-strong);
    background: #f4f8f2;
    border-bottom: 1px solid var(--line);
}

.bulk-family-picker {
    display: grid;
    gap: 10px;
    padding: 10px;
    background: #f8fbf7;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.bulk-family-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px 16px;
    align-items: end;
}

.bulk-family-toolbar .field {
    margin: 0;
}

.bulk-family-search {
    grid-column: 1 / -1;
    min-width: 0;
}

.bulk-family-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 230px;
}

.bulk-family-table-wrap {
    max-height: 310px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
}

.bulk-family-table {
    min-width: 930px;
    table-layout: fixed;
}

.bulk-family-table th,
.bulk-family-table td {
    padding: 7px 8px;
    font-size: 12px;
}

.bulk-family-table th:first-child,
.bulk-family-table td:first-child {
    width: 72px;
    text-align: center;
}

.bulk-family-table th:nth-child(2),
.bulk-family-table td:nth-child(2) {
    width: 110px;
}

.bulk-family-table th:nth-child(4),
.bulk-family-table td:nth-child(4),
.bulk-family-table th:nth-child(5),
.bulk-family-table td:nth-child(5),
.bulk-family-table th:nth-child(6),
.bulk-family-table td:nth-child(6),
.bulk-family-table th:nth-child(7),
.bulk-family-table td:nth-child(7) {
    width: 125px;
}

.bulk-family-table th button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.bulk-family-table th button.active {
    color: var(--brand-strong);
}

.bulk-family-table input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
}

.financial-filter-form {
    margin-top: 16px;
}

.financial-table-wrap {
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.financial-table {
    min-width: 1180px;
}

.financial-table.compact {
    min-width: 620px;
}

.financial-table th,
.financial-table td {
    padding: 10px 12px;
    vertical-align: middle;
    white-space: nowrap;
    text-align: center;
    border-bottom: 1px solid #e7ebe5;
}

.financial-table th {
    color: #2f3f35;
    background: #f4f7f2;
    font-weight: 800;
}

.financial-table td:first-child,
.financial-table th:first-child {
    text-align: right;
}

.evaluation-score-table {
    width: 100%;
    border-collapse: collapse;
}

.evaluation-score-table th,
.evaluation-score-table td {
    padding: 10px 12px;
    vertical-align: middle;
    text-align: center;
    border-bottom: 1px solid #e7ebe5;
}

.evaluation-score-table th {
    color: #2f3f35;
    background: #f4f7f2;
    font-weight: 800;
}

.evaluation-score-table td:first-child,
.evaluation-score-table th:first-child {
    text-align: right;
}

.evaluation-score-table td:last-child,
.evaluation-score-table th:last-child {
    width: 140px;
}

.evaluation-score-table select {
    width: 100%;
}

.budget-statement-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.budget-statement-table th:nth-child(1),
.budget-statement-table td:nth-child(1),
.budget-statement-table th:nth-child(2),
.budget-statement-table td:nth-child(2) {
    width: 22%;
    white-space: normal;
    text-align: right;
    word-break: break-word;
}

.budget-statement-table th:nth-child(3),
.budget-statement-table td:nth-child(3),
.budget-statement-table th:nth-child(4),
.budget-statement-table td:nth-child(4),
.budget-statement-table th:nth-child(5),
.budget-statement-table td:nth-child(5),
.budget-statement-table th:nth-child(6),
.budget-statement-table td:nth-child(6) {
    width: 14%;
    white-space: nowrap;
}

.financial-table .table-actions {
    justify-content: center;
    flex-wrap: nowrap;
}

.financial-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 980px) {
    .financial-metrics,
    .financial-report-grid,
    .voucher-mode-choice {
        grid-template-columns: 1fr;
    }

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

    .bulk-family-actions {
        grid-column: 1 / -1;
    }

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

    .financial-form-grid .wide,
    .financial-form-grid .full {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .bulk-family-toolbar {
        grid-template-columns: 1fr;
    }

    .bulk-family-actions {
        min-width: 0;
    }

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

    .financial-form-grid .field,
    .financial-form-grid .wide,
    .financial-form-grid .full {
        grid-column: auto;
    }
}

.table-wrap {
    overflow-x: auto;
    scrollbar-color: var(--line-strong) #edf1eb;
    scrollbar-gutter: stable;
    border-radius: 8px;
}

.table-wrap::-webkit-scrollbar {
    height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
    background: #edf1eb;
    border-radius: 0 0 8px 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: #aebaaa;
    border: 3px solid #edf1eb;
    border-radius: 999px;
}

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

.case-files-table {
    min-width: 1540px;
    margin-inline: auto;
    table-layout: fixed;
}

.case-files-table-wrap {
    direction: rtl;
    padding-inline: 14px;
    scroll-padding-inline: 14px;
}

.case-files-table-wrap .case-files-table {
    direction: rtl;
}

.case-files-table th,
.case-files-table td,
.registered-families-table th,
.registered-families-table td {
    padding: 8px 9px;
    vertical-align: middle;
    white-space: nowrap;
}

.case-files-table th:not(:last-child),
.case-files-table td:not(:last-child),
.registered-families-table th:not(:last-child),
.registered-families-table td:not(:last-child) {
    overflow: hidden;
    text-overflow: ellipsis;
}

.case-files-table th:nth-child(1),
.case-files-table td:nth-child(1) {
    width: 84px;
}

.case-files-table th:nth-child(2),
.case-files-table td:nth-child(2) {
    width: 92px;
}

.case-files-table th:nth-child(3),
.case-files-table td:nth-child(3) {
    width: 160px;
}

.case-files-table th:nth-child(4),
.case-files-table td:nth-child(4) {
    width: 104px;
}

.case-files-table th:nth-child(5),
.case-files-table td:nth-child(5) {
    width: 165px;
}

.case-files-table th:nth-child(6),
.case-files-table td:nth-child(6) {
    width: 108px;
}

.case-files-table th:nth-child(7),
.case-files-table td:nth-child(7) {
    width: 124px;
}

.case-files-table th:nth-child(8),
.case-files-table td:nth-child(8) {
    width: 112px;
}

.case-files-table th:nth-child(9),
.case-files-table td:nth-child(9) {
    width: 122px;
}

.case-files-table th:nth-child(10),
.case-files-table td:nth-child(10) {
    width: 124px;
}

.case-files-table th:nth-child(11),
.case-files-table td:nth-child(11) {
    width: 124px;
}

.case-files-table th:nth-child(12),
.case-files-table td:nth-child(12) {
    width: 158px;
}

.case-files-table .table-actions {
    flex-wrap: nowrap;
}

.registered-families-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    margin-inline: auto;
}

[data-registered-family-results][aria-busy="true"] {
    opacity: 0.72;
    transition: opacity 0.12s ease;
}

.registered-families-scroll {
    overflow-x: auto;
    padding-inline: 14px;
    scroll-padding-inline: 14px;
}

.registered-families-table th,
.registered-families-table td {
    text-align: center;
}

.table-sort-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.table-sort-link:hover,
.table-sort-link:focus-visible,
.table-sort-link.active {
    color: var(--brand-strong);
}

.sort-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    min-width: 16px;
    color: #708076;
    font-size: 11px;
    line-height: 1;
}

.table-sort-link.active .sort-indicator {
    color: var(--brand-strong);
}

.registered-families-table th:last-child,
.registered-families-table td:last-child {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 5%;
    min-width: 44px;
    padding-inline: 4px;
    background: var(--surface);
    box-shadow: 8px 0 14px rgba(26, 45, 36, .08);
}

.registered-families-table th:last-child {
    z-index: 4;
    background: #edf1eb;
}

.registered-families-table tbody tr:hover td:last-child {
    background: #fbfcfa;
}

.registered-families-table tr.actions-row-open {
    position: relative;
    z-index: 80;
}

.registered-families-table td.actions-cell-open {
    z-index: 120;
}

.registered-families-table .table-actions {
    flex-wrap: nowrap;
}

.registered-families-table th[data-column],
.registered-families-table td[data-column] {
    width: 110px;
    min-width: 110px;
    padding-inline: 8px;
}

.registered-families-table th[data-column="sequence_number"],
.registered-families-table td[data-column="sequence_number"] {
    width: 4%;
    min-width: 36px;
}

.registered-families-table th[data-column="family_number"],
.registered-families-table td[data-column="family_number"] {
    width: 8%;
    min-width: 64px;
}

.registered-families-table th[data-column="file_number"],
.registered-families-table td[data-column="file_number"] {
    width: 8%;
    min-width: 64px;
}

.registered-families-table th[data-column="family_name"],
.registered-families-table td[data-column="family_name"] {
    width: 22%;
    min-width: 120px;
}

.registered-families-table th[data-column="area"],
.registered-families-table td[data-column="area"] {
    width: 11%;
    min-width: 70px;
}

.registered-families-table th[data-column="notes"],
.registered-families-table td[data-column="notes"],
.registered-families-table th[data-column="management_decision"],
.registered-families-table td[data-column="management_decision"],
.registered-families-table th[data-column="raw_payload"],
.registered-families-table td[data-column="raw_payload"] {
    width: 200px;
    min-width: 200px;
}

.registered-families-table th[data-column="residence"],
.registered-families-table td[data-column="residence"] {
    width: 190px;
    min-width: 190px;
}

.registered-families-table th[data-column="match"],
.registered-families-table td[data-column="match"] {
    width: 190px;
    min-width: 190px;
}

.registered-families-table th[data-column="civil_id"],
.registered-families-table td[data-column="civil_id"] {
    width: 100px;
    min-width: 100px;
}

.registered-families-table th[data-column="phone"],
.registered-families-table td[data-column="phone"],
.registered-families-table th[data-column="alternate_phone"],
.registered-families-table td[data-column="alternate_phone"] {
    width: 11%;
    min-width: 70px;
}

.registered-families-table th[data-column="average_income"],
.registered-families-table td[data-column="average_income"] {
    width: 8%;
    min-width: 60px;
}

.registered-families-table th[data-column="classification"],
.registered-families-table td[data-column="classification"] {
    width: 8%;
    min-width: 60px;
}

.registered-families-table th[data-column="platform_status"],
.registered-families-table td[data-column="platform_status"] {
    width: 9%;
    min-width: 64px;
}

.registered-families-table th[data-column="id"],
.registered-families-table td[data-column="id"],
.registered-families-table th[data-column="age"],
.registered-families-table td[data-column="age"],
.registered-families-table th[data-column="members_count"],
.registered-families-table td[data-column="members_count"],
.registered-families-table th[data-column="orphans_count"],
.registered-families-table td[data-column="orphans_count"],
.registered-families-table th[data-column="students_count"],
.registered-families-table td[data-column="students_count"] {
    width: 6%;
    min-width: 44px;
}

.family-members-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 12px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.family-members-head div {
    display: grid;
    gap: 2px;
}

.family-members-head strong {
    color: var(--brand-strong);
}

.family-members-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.family-members-table {
    min-width: 1240px;
    table-layout: fixed;
}

.family-members-table th,
.family-members-table td {
    padding: 8px 9px;
    vertical-align: middle;
    white-space: nowrap;
}

.family-members-table th:not(:last-child),
.family-members-table td:not(:last-child) {
    overflow: hidden;
    text-overflow: ellipsis;
}

.family-members-table th:nth-child(1),
.family-members-table td:nth-child(1) {
    width: 52px;
}

.family-members-table th:nth-child(2),
.family-members-table td:nth-child(2) {
    width: 215px;
}

.family-members-table th:nth-child(3),
.family-members-table td:nth-child(3),
.family-members-table th:nth-child(5),
.family-members-table td:nth-child(5),
.family-members-table th:nth-child(6),
.family-members-table td:nth-child(6),
.family-members-table th:nth-child(10),
.family-members-table td:nth-child(10) {
    width: 86px;
}

.family-members-table th:nth-child(4),
.family-members-table td:nth-child(4),
.family-members-table th:nth-child(12),
.family-members-table td:nth-child(12) {
    width: 110px;
}

.family-members-table th:nth-child(7),
.family-members-table td:nth-child(7) {
    width: 150px;
}

.family-members-table th:nth-child(8),
.family-members-table td:nth-child(8),
.family-members-table th:nth-child(9),
.family-members-table td:nth-child(9) {
    width: 120px;
}

.family-members-table th:nth-child(13),
.family-members-table td:nth-child(13) {
    width: 76px;
}

.muted-inline {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.flat-table-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
}

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

.source-details {
    margin-top: 16px;
}

.detail-item {
    min-width: 0;
    padding: 12px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.detail-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.detail-item strong {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    font-size: 14px;
}

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

th {
    color: #34463b;
    background: #edf1eb;
    font-size: 13px;
}

tbody tr:hover {
    background: #fbfcfa;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.row-actions {
    width: 92px;
}

.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 18px;
}

.auth-panel {
    width: min(520px, 100%);
    margin-inline: auto;
    padding: 28px;
    border-color: #cfd8cb;
    box-shadow: 0 18px 44px rgba(24, 42, 32, .10);
}

.auth-panel h1 {
    margin: 0;
    font-size: 24px;
}

.auth-brand-head {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.auth-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    padding: 10px;
    background: #f7faf5;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.auth-logo-mark img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.auth-logo-mark .icon {
    width: 36px;
    height: 36px;
    color: var(--brand);
}

.auth-brand-head span {
    display: block;
    color: var(--brand-strong);
    font-weight: 900;
}

.auth-brand-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.auth-login-form {
    gap: 15px;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap input {
    min-height: 48px;
    padding-right: 42px;
    padding-left: 44px;
}

.auth-input-wrap:not(.input-action-wrap) input {
    padding-left: 12px;
}

.auth-field-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 18px;
    height: 18px;
    color: #718077;
    pointer-events: none;
    transform: translateY(-50%);
}

.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}

.auth-options-row .checkbox-field {
    min-height: 36px;
}

.auth-options-row .auth-inline-link {
    align-items: center;
    gap: 6px;
    margin-top: 0;
    white-space: nowrap;
}

.auth-options-row .auth-inline-link .icon {
    width: 16px;
    height: 16px;
}

.auth-submit {
    min-width: 112px;
    min-height: 44px;
    padding-inline: 20px;
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-height: 42px;
    font-weight: 800;
}

.checkbox-field input {
    width: 18px;
    min-height: 18px;
}

.hidden-form {
    display: none;
}

.user-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.user-summary-grid article {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.user-summary-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.user-summary-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--brand-strong);
    font-size: 25px;
    line-height: 1.2;
}

.users-management-section {
    padding: 16px;
}

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

.users-table table {
    min-width: 900px;
}

.users-table th,
.users-table td {
    vertical-align: middle;
}

.users-table .table-actions {
    flex-wrap: nowrap;
}

.users-table .table-actions form {
    margin: 0;
}

.users-table th:last-child,
.users-table td:last-child {
    width: 160px;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 230px;
}

.user-cell strong,
.user-cell span {
    display: block;
}

.user-cell strong {
    font-weight: 900;
}

.user-cell span:not(.user-avatar) {
    color: var(--muted);
    font-size: 12px;
    direction: ltr;
    text-align: right;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    color: #fff;
    background: var(--brand);
    border-radius: 8px;
    font-weight: 900;
    object-fit: cover;
}

.permission-count {
    display: grid;
    gap: 1px;
    min-width: 116px;
}

.permission-count strong {
    color: var(--brand-strong);
    font-weight: 900;
}

.permission-count span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.user-modal-panel {
    width: min(1180px, calc(100vw - 36px));
}

.user-password-panel {
    width: min(680px, calc(100vw - 36px));
}

.user-modal-form {
    display: grid;
    gap: 14px;
}

.user-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 14px;
}

.user-form-grid .field {
    min-width: 0;
}

.user-form-grid label:not(.check-field) {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 800;
}

.user-form-grid input,
.user-form-grid select {
    min-height: 40px;
    padding-block: 7px;
}

.user-active-field {
    align-self: end;
}

.bulk-sms-section {
    padding: 16px;
}

.bulk-sms-warning {
    margin-bottom: 14px;
    padding: 12px 14px;
    color: #7a4c0b;
    background: #fff7df;
    border: 1px solid #e5c879;
    border-radius: 8px;
    font-weight: 800;
}

.bulk-sms-filter-form {
    margin-bottom: 14px;
    box-shadow: none;
}

.bulk-sms-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.bulk-sms-main {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.bulk-sms-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.bulk-sms-summary article {
    min-height: 84px;
    padding: 13px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.bulk-sms-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.bulk-sms-summary strong {
    display: block;
    margin-top: 5px;
    color: var(--brand-strong);
    font-size: 25px;
    line-height: 1.2;
}

.bulk-sms-compose {
    display: grid;
    gap: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.bulk-sms-compose textarea {
    min-height: 156px;
    resize: vertical;
}

.bulk-sms-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bulk-sms-expired-cards {
    align-self: end;
    min-height: 40px;
}

.family-sms-modal-panel {
    width: min(640px, calc(100vw - 32px));
}

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

.family-sms-target article {
    min-height: 78px;
    padding: 12px;
    background: #f7faf5;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.family-sms-target span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.family-sms-target strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
    font-size: 16px;
    line-height: 1.45;
}

.family-sms-form textarea {
    min-height: 150px;
}

.sms-field-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.sms-field-meta .field-hint {
    margin-top: 0;
}

.sms-counter {
    min-width: 62px;
    padding: 4px 8px;
    background: #f7faf5;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
}

.inline-alert {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.7;
}

.inline-alert.warning {
    color: #75530a;
    background: #fff8df;
    border-color: #ead389;
}

.field-error {
    display: block;
    margin-top: 6px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
}

.role-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.role-field-row .btn {
    min-height: 40px;
    white-space: nowrap;
}

.permission-quick-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    background: #f7faf5;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.permission-quick-actions .btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
}

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

.permission-group-card {
    overflow: hidden;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.permission-group-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: #eef4ee;
    border-bottom: 1px solid var(--line);
}

.permission-group-card h3 {
    margin: 0;
    color: var(--brand-strong);
    font-size: 15px;
    line-height: 1.35;
}

.permission-group-card header span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.permission-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    color: #34463b;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.permission-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 9px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #34463b;
    font-size: 13px;
    font-weight: 800;
}

.permission-item input {
    flex: 0 0 auto;
    width: 17px;
    min-height: 17px;
}

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

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

.account-password-grid .field {
    grid-column: auto;
}

.account-password-grid .field.full {
    grid-column: 1 / -1;
}

.users-active-toggle {
    padding-top: 28px;
}

.inline-check {
    white-space: nowrap;
}

.food-basket-recent-check {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: normal;
}

.food-basket-recent-check input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    flex: 0 0 auto;
}

.food-basket-recent-check input[type="number"] {
    min-width: 88px;
}

.logo-upload-field input[type="file"] {
    padding: 7px 9px;
}

.logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 118px;
    margin-bottom: 10px;
    padding: 12px;
    color: var(--muted);
    background: #fbfcfa;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    font-weight: 800;
}

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

.favicon-preview {
    min-height: 86px;
}

.favicon-preview img {
    max-width: 48px;
    max-height: 48px;
}

.notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid;
}

.notice.success {
    color: var(--brand-strong);
    background: #eef7f1;
    border-color: #bedbc8;
}

.notice.error {
    color: #7d2727;
    background: #fff3f2;
    border-color: #efc5c0;
}

.notice.warning {
    color: #75530a;
    background: #fff8df;
    border-color: #ead389;
}

.notice ul {
    margin: 8px 18px 0 0;
}

.app-swal-popup {
    direction: rtl;
    font-family: 'Cairo', Tahoma, Arial, sans-serif;
    border-radius: 8px;
}

.app-swal-title {
    color: var(--ink);
    font-weight: 800;
}

.app-swal-content {
    color: var(--muted);
    font-weight: 700;
}

.app-swal-list {
    margin: 0;
    padding: 0;
    list-style-position: inside;
    text-align: right;
}

.app-swal-list li + li {
    margin-top: 5px;
}

.app-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 24, 18, .48);
}

.app-dialog {
    width: min(440px, 100%);
    padding: 20px;
    text-align: right;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(12, 24, 18, .26);
}

.app-dialog h2 {
    margin: 0 0 8px;
    color: var(--brand-strong);
    font-size: 20px;
    font-weight: 800;
}

.app-dialog-warning h2,
.app-dialog-error h2 {
    color: var(--danger);
}

.app-dialog-content {
    color: var(--muted);
    font-weight: 700;
}

.app-dialog-actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 18px;
}

.empty-state {
    padding: 38px;
    text-align: center;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.pagination-summary {
    color: var(--muted);
    font-size: 13px;
}

.pagination-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 6px 11px;
    color: var(--brand-strong);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
}

.page-link.active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.page-link.disabled {
    color: #a4aca6;
    background: #f3f5f1;
    cursor: not-allowed;
}

.note-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.note-row:last-of-type {
    border-bottom: 0;
}

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

.print-only {
    display: none;
}

.print-document {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
    color: #fff;
    background: var(--brand);
}

.print-header-title {
    flex: 1;
    text-align: center;
}

.print-logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 82px;
    height: 68px;
    padding: 6px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px;
}

.print-logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.print-header h1 {
    margin: 0;
    font-size: 24px;
}

.print-header p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, .82);
}

.print-header-meta {
    display: grid;
    gap: 4px;
    min-width: 170px;
    padding: 12px;
    text-align: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
}

.print-section {
    padding: 18px 22px;
    border-top: 1px solid var(--line);
}

.print-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.print-info-grid,
.print-summary-grid,
.print-signatures {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.print-info-grid.compact {
    margin-top: 10px;
}

.print-info-grid > div,
.print-summary-grid > div,
.print-signatures > div {
    min-height: 58px;
    padding: 10px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

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

.print-info-grid span,
.print-summary-grid span,
.print-signatures span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.print-info-grid strong,
.print-summary-grid strong,
.print-signatures strong {
    display: block;
    margin-top: 3px;
}

.print-summary-grid {
    grid-template-columns: repeat(5, 1fr);
}

.print-table {
    min-width: 0;
    font-size: 13px;
}

.print-table th,
.print-table td {
    padding: 8px;
}

.pledge-text {
    padding: 14px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.print-signatures {
    margin-top: 12px;
    grid-template-columns: repeat(3, 1fr);
}

.print-footer {
    display: none;
}

.print-page-footer {
    display: none;
}

.financial-print-document {
    width: min(1040px, 100%);
    margin-inline: auto;
}

.financial-print-header {
    padding: 16px 20px;
}

.financial-print-header .print-logo-box {
    width: 66px;
    height: 54px;
}

.financial-print-header h1 {
    font-size: 21px;
}

.financial-print-header p,
.financial-print-header .print-header-meta {
    font-size: 12px;
}

.financial-print-header .print-header-meta {
    min-width: 150px;
    padding: 8px 10px;
}

.financial-print-meta {
    padding: 12px 24px;
}

.financial-report-summary {
    display: grid;
    grid-template-columns: 1.25fr 1.5fr .75fr 1fr 1.35fr 1fr;
    margin: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.financial-report-summary.meeting-report-summary {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
    .financial-report-summary.meeting-report-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.financial-report-summary > div {
    min-width: 0;
    padding: 7px 9px;
    border-left: 1px solid var(--line);
}

.financial-report-summary > div:last-child {
    border-left: 0;
}

.financial-report-summary dt,
.financial-report-summary dd {
    margin: 0;
}

.financial-report-summary dt {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.4;
}

.financial-report-summary dd {
    margin-top: 2px;
    color: #1f2a24;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.financial-print-table-section {
    padding: 14px 28px 18px;
}

.financial-print-table-section h2 {
    margin-bottom: 9px;
    font-size: 15px;
}

.financial-print-table {
    width: 94%;
    margin-inline: auto;
    table-layout: fixed;
    font-size: 12px;
}

.financial-print-table th,
.financial-print-table td,
.financial-print-subtable th,
.financial-print-subtable td {
    padding: 5px 6px;
    vertical-align: middle;
}

.financial-print-table th:nth-child(1),
.financial-print-table td:nth-child(1) {
    width: 34px;
    text-align: center;
}

.financial-print-table th:nth-child(2),
.financial-print-table td:nth-child(2) {
    width: 82px;
}

.financial-print-table th:nth-child(6),
.financial-print-table td:nth-child(6),
.financial-print-table th:nth-child(7),
.financial-print-table td:nth-child(7) {
    width: 78px;
}

.financial-print-table th:nth-child(8),
.financial-print-table td:nth-child(8) {
    width: 50px;
    text-align: center;
}

.financial-print-table th:nth-child(9),
.financial-print-table td:nth-child(9) {
    width: 92px;
}

.financial-print-table tfoot th {
    color: var(--brand-strong);
    background: #e8f2ea;
    border-top: 2px solid var(--brand);
    font-size: 12px;
}

.financial-print-total-row th {
    color: var(--brand-strong);
    background: #e8f2ea;
    border-top: 2px solid var(--brand);
    font-size: 12px;
    padding: 5px 6px;
    text-align: right;
}

.financial-print-total-row th.amount-cell {
    text-align: center;
}

.budget-plan-print-table th:nth-child(1),
.budget-plan-print-table td:nth-child(1) {
    width: 13%;
}

.budget-plan-print-table th:nth-child(2),
.budget-plan-print-table td:nth-child(2) {
    width: 34%;
}

.budget-plan-print-table th:nth-child(3),
.budget-plan-print-table td:nth-child(3),
.budget-plan-print-table th:nth-child(4),
.budget-plan-print-table td:nth-child(4),
.budget-plan-print-table th:nth-child(5),
.budget-plan-print-table td:nth-child(5),
.budget-plan-print-table th:nth-child(6),
.budget-plan-print-table td:nth-child(6) {
    width: 11%;
    text-align: center;
}

.budget-plan-print-table th:nth-child(7),
.budget-plan-print-table td:nth-child(7) {
    width: 9%;
    text-align: center;
}

.board-members-print-table th:nth-child(1),
.board-members-print-table td:nth-child(1) {
    width: 5%;
    text-align: center;
}

.board-members-print-table th:nth-child(2),
.board-members-print-table td:nth-child(2) {
    width: 30%;
}

.board-members-print-table th:nth-child(3),
.board-members-print-table td:nth-child(3) {
    width: 20%;
}

.board-members-print-table th:nth-child(4),
.board-members-print-table td:nth-child(4) {
    width: 15%;
    text-align: center;
}

.board-members-print-table th:nth-child(5),
.board-members-print-table td:nth-child(5) {
    width: 10%;
    text-align: center;
}

.board-members-print-table th:nth-child(6),
.board-members-print-table td:nth-child(6) {
    width: 20%;
}

.budget-statement-print-table th:nth-child(1),
.budget-statement-print-table td:nth-child(1),
.budget-statement-print-table th:nth-child(2),
.budget-statement-print-table td:nth-child(2) {
    width: 22%;
}

.budget-statement-print-table th:nth-child(3),
.budget-statement-print-table td:nth-child(3),
.budget-statement-print-table th:nth-child(4),
.budget-statement-print-table td:nth-child(4),
.budget-statement-print-table th:nth-child(5),
.budget-statement-print-table td:nth-child(5),
.budget-statement-print-table th:nth-child(6),
.budget-statement-print-table td:nth-child(6) {
    width: 14%;
    text-align: center;
}

.volunteers-print-table th:nth-child(1),
.volunteers-print-table td:nth-child(1) {
    width: 4%;
    text-align: center;
}

.volunteers-print-table th:nth-child(2),
.volunteers-print-table td:nth-child(2) {
    width: 18%;
}

.volunteers-print-table th:nth-child(3),
.volunteers-print-table td:nth-child(3) {
    width: 11%;
    text-align: center;
}

.volunteers-print-table th:nth-child(4),
.volunteers-print-table td:nth-child(4) {
    width: 5%;
    text-align: center;
}

.volunteers-print-table th:nth-child(5),
.volunteers-print-table td:nth-child(5) {
    width: 13%;
}

.volunteers-print-table th:nth-child(6),
.volunteers-print-table td:nth-child(6) {
    width: 10%;
    text-align: center;
}

.volunteers-print-table th:nth-child(7),
.volunteers-print-table td:nth-child(7) {
    width: 14%;
    text-align: center;
}

.volunteers-print-table th:nth-child(8),
.volunteers-print-table td:nth-child(8) {
    width: 25%;
}

.amount-cell {
    text-align: left;
    direction: ltr;
    font-weight: 800;
    white-space: nowrap;
}

.financial-print-breakdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.financial-print-breakdown h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.financial-print-subtable {
    width: 100%;
    min-width: 0;
}

.financial-print-signatures .print-signatures strong {
    min-height: 36px;
}

.purchase-voucher-print-document {
    width: min(920px, 100%);
    margin-inline: auto;
}

.purchase-voucher-print-header {
    background: linear-gradient(135deg, #0f6b3d, #18845a);
}

.purchase-voucher-hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr .8fr;
    gap: 12px;
    padding: 18px 22px;
    background: #f4faf5;
    border-top: 1px solid #cfe3d3;
    border-bottom: 1px solid #cfe3d3;
}

.purchase-voucher-hero > div {
    display: grid;
    gap: 5px;
    min-height: 82px;
    padding: 14px;
    background: #fff;
    border: 1px solid #cfe3d3;
    border-radius: 8px;
}

.purchase-voucher-hero span,
.purchase-voucher-stores span,
.purchase-voucher-terms li {
    color: var(--muted);
}

.purchase-voucher-hero strong {
    color: var(--brand-strong);
    font-size: 26px;
    letter-spacing: 0;
}

.purchase-voucher-amount strong {
    color: #0f6b3d;
    font-size: 30px;
}

.purchase-voucher-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.purchase-voucher-stores {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.purchase-voucher-stores > div {
    display: grid;
    gap: 4px;
    min-height: 68px;
    padding: 10px;
    background: #fbfcfa;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.purchase-voucher-terms ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0 18px 0 0;
}

.purchase-voucher-redemptions-table {
    width: 100%;
}

.purchase-voucher-qr-section {
    break-inside: avoid;
    page-break-inside: avoid;
}

.purchase-voucher-qr-box {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    background: #f4faf5;
    border: 1px solid #cfe3d3;
    border-radius: 10px;
}

.purchase-voucher-qr-box #voucher-qr-code {
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
}

.purchase-voucher-qr-box #voucher-qr-code svg {
    width: 100%;
    height: 100%;
    display: block;
}

.purchase-voucher-qr-text {
    display: grid;
    gap: 4px;
}

.purchase-voucher-qr-text strong {
    color: var(--brand-strong);
    font-size: 15px;
}

.purchase-voucher-qr-text span {
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 960px) {
    body.has-app-sidebar {
        background: var(--bg);
    }

    .app-sidebar {
        position: static;
        width: auto;
        height: auto;
        max-height: none;
        margin: 10px;
        border-left: 0;
        border-radius: 14px;
        box-shadow: var(--shadow);
    }

    .app-sidebar-brand {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
    }

    .app-sidebar-user {
        margin-bottom: 12px;
    }

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

    .app-sidebar-nav-toggle {
        display: flex;
    }

    .app-sidebar-nav {
        display: none;
        flex-direction: column;
        gap: 10px;
        padding-bottom: 6px;
        max-height: 65vh;
        overflow-y: auto;
    }

    .app-sidebar.is-nav-open .app-sidebar-nav {
        display: flex;
    }

    .app-sidebar-group {
        width: 100%;
    }

    .app-sidebar-settings {
        margin-top: 0;
    }

    .app-sidebar-link.active::before {
        display: none;
    }

    .has-app-sidebar .topbar {
        margin-right: 0;
    }

    .topbar,
    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .brand-block {
        align-items: flex-start;
    }

    .page-shell {
        width: min(100% - 22px, 1380px);
        margin-top: 16px;
    }

    .has-app-sidebar .page-shell {
        width: min(100% - 22px, 1380px);
        margin: 16px auto 30px;
    }

    .app-footer,
    .has-app-sidebar .app-footer {
        width: min(100% - 22px, 1380px);
        margin: 0 auto 18px;
    }

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

    .registered-filter-head {
        align-items: stretch;
        flex-direction: column;
    }

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

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

    .gharimun-form-grid .wide {
        grid-column: 1 / -1;
    }

    .gharimun-attachment-list {
        grid-template-columns: 1fr;
    }

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

    .filter-form .field {
        grid-column: auto;
    }

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

    .password-fields {
        grid-template-columns: 1fr;
    }

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

    .user-form-grid,
    .permission-grid {
        grid-template-columns: 1fr;
    }

    .bulk-sms-layout {
        grid-template-columns: 1fr;
    }

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

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

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

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

    .family-info-groups {
        grid-template-columns: 1fr;
    }

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

    .admin-sidebar {
        position: static;
    }

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

    .summary-band {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .print-info-grid,
    .print-summary-grid,
    .print-signatures {
        grid-template-columns: repeat(2, 1fr);
    }

    .financial-print-breakdown {
        grid-template-columns: 1fr;
    }

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

    .financial-report-summary > div:nth-child(2n) {
        border-left: 0;
    }
}

@media (max-width: 620px) {
    .auth-panel {
        padding: 22px;
    }

    .auth-brand-head {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .auth-options-row {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .food-basket-selection-bar,
    .sms-field-meta {
        align-items: stretch;
        flex-direction: column;
    }

    .food-basket-selection-bar .btn {
        width: 100%;
    }

    .sms-counter {
        width: fit-content;
    }

    .admin-sidebar-nav {
        grid-template-columns: 1fr;
    }

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

    .advanced-filters-grid {
        grid-template-columns: 1fr;
    }

    .modal-backdrop {
        align-items: stretch;
        padding: 10px;
    }

    .modal-panel {
        width: 100%;
        max-height: calc(100vh - 20px);
    }

    .modal-header,
    .family-card-hero {
        align-items: stretch;
        flex-direction: column;
    }

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

    .family-members-head {
        align-items: stretch;
        flex-direction: column;
    }

    .modal-header-actions,
    .family-card-tags {
        justify-content: flex-start;
    }

    .family-signal-grid,
    .family-info-list {
        grid-template-columns: 1fr;
    }

    .user-summary-grid,
    .permission-list,
    .password-grid,
    .account-password-grid {
        grid-template-columns: 1fr;
    }

    .bulk-sms-summary {
        grid-template-columns: 1fr;
    }

    .family-sms-target {
        grid-template-columns: 1fr;
    }

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

    .financial-report-summary {
        grid-template-columns: 1fr;
    }

    .financial-report-summary > div {
        border-left: 0;
        border-bottom: 1px solid var(--line);
    }

    .financial-report-summary > div:last-child {
        border-bottom: 0;
    }

    .financial-print-table {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .registered-filter-form .advanced-filters-grid,
    .registered-filter-form .advanced-ranges-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    .registered-filter-form .advanced-filters-grid,
    .registered-filter-form .advanced-ranges-grid {
        grid-template-columns: 1fr;
    }
}

.filter-form.sponsorship-filter-form {
    display: grid;
    grid-template-columns: minmax(250px, 360px) 130px 150px minmax(150px, 190px) auto;
    align-items: end;
    gap: 8px;
    padding: 10px 12px;
    overflow-x: visible;
}

.filter-form.sponsorship-filter-form .field,
.filter-form.sponsorship-filter-form .filter-search,
.filter-form.sponsorship-filter-form .filter-status,
.filter-form.sponsorship-filter-form .filter-actions {
    width: auto;
    min-width: 0;
    max-width: none;
    grid-column: auto;
}

.filter-form.sponsorship-filter-form label {
    margin-bottom: 3px;
    font-size: 12px;
    line-height: 1.2;
}

.filter-form.sponsorship-filter-form input,
.filter-form.sponsorship-filter-form select,
.filter-form.sponsorship-filter-form .btn {
    min-height: 36px;
    padding-block: 6px;
}

.filter-form.sponsorship-filter-form .filter-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-start;
}

.filter-form.sponsorship-filter-form .filter-actions .btn {
    padding-inline: 12px;
}

@media (max-width: 1100px) {
    .filter-form.sponsorship-filter-form {
        grid-template-columns: minmax(220px, 1fr) 120px 140px minmax(135px, 170px) auto;
    }
}

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

    body {
        background: #fff;
        font-size: 11px;
    }

    .topbar,
    .app-sidebar,
    .toolbar,
    .filter-form,
    .print-toolbar,
    .tabs,
    .admin-sidebar,
    .app-footer,
    .btn,
    .notice {
        display: none !important;
    }

    .page-shell {
        width: auto;
        margin: 0;
        padding: 0 10mm 14mm;
    }

    .section,
    .summary-band,
    .table-wrap,
    .print-block,
    .print-document {
        box-shadow: none;
    }

    .print-document {
        position: relative;
        padding-bottom: 14mm;
        border: 0;
        border-radius: 0;
    }

    .print-page-footer {
        right: 0;
        left: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 7mm;
        padding-top: 3px;
        color: #555;
        background: #fff;
        border-top: 1px solid #999;
        font-size: 10px;
    }

    .print-page-footer {
        position: absolute;
    }

    .print-footer {
        display: flex;
        position: fixed;
        right: 0;
        left: 0;
        bottom: 0;
        align-items: center;
        justify-content: space-between;
        height: 7mm;
        padding-top: 3px;
        color: #555;
        background: #fff;
        border-top: 1px solid #999;
        font-size: 10px;
    }

    .print-header {
        padding: 10px 0 12px;
        color: #111;
        background: #fff;
        border-bottom: 2px solid #111;
    }

    .print-header p {
        color: #555;
    }

    .print-header-meta {
        color: #111;
        background: #fff;
        border-color: #111;
    }

    .print-logo-box {
        width: 22mm;
        height: 18mm;
        color: #111;
        background: #fff;
        border-color: #111;
    }

    .print-section {
        padding: 10px 0;
        break-inside: avoid;
    }

    .print-section h2 {
        margin-bottom: 8px;
        padding: 5px 8px;
        background: #eee;
        border: 1px solid #999;
        font-size: 14px;
    }

    .print-info-grid,
    .print-summary-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }

    .print-signatures {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .print-info-grid > div,
    .print-summary-grid > div,
    .print-signatures > div,
    .pledge-text {
        min-height: auto;
        padding: 6px;
        background: #fff;
        border-color: #999;
        border-radius: 0;
    }

    .print-info-grid span,
    .print-summary-grid span,
    .print-signatures span {
        color: #555;
        font-size: 10px;
    }

    .print-table,
    table {
        min-width: 0;
        font-size: 10px;
    }

    .financial-print-table {
        width: 94%;
        table-layout: fixed;
        font-size: 8.8px;
    }

    .financial-print-table thead {
        display: table-header-group;
    }

    .financial-print-table tfoot {
        display: table-footer-group;
    }

    th,
    td {
        padding: 5px;
        border-color: #999;
    }

    th {
        background: #eee;
    }

    .financial-print-table tfoot th {
        color: #111;
        background: #eee;
        border-top: 2px solid #111;
        font-size: 9.5px;
    }

    .financial-print-document {
        width: 186mm;
        max-width: 100%;
        margin: 0 auto;
        border: 1px solid #999;
        border-radius: 0;
    }

    .financial-print-header {
        padding: 10px 12px;
    }

    .financial-print-header .print-logo-box {
        width: 50px;
        height: 42px;
        border-radius: 0;
    }

    .financial-print-header h1 {
        font-size: 16px;
    }

    .financial-print-header p,
    .financial-print-header .print-header-meta {
        font-size: 9px;
    }

    .financial-print-header .print-header-meta {
        min-width: 116px;
        padding: 5px 6px;
        border-radius: 0;
    }

    .financial-print-meta {
        padding: 8px 12px;
    }

    .financial-report-summary {
        grid-template-columns: 1.2fr 1.7fr .7fr .9fr 1.2fr 1fr;
        border-color: #999;
        border-radius: 0;
    }

    .financial-report-summary > div {
        padding: 4px 5px;
        border-color: #999;
    }

    .financial-report-summary dt {
        color: #555;
        font-size: 8.5px;
    }

    .financial-report-summary dd {
        font-size: 9.2px;
    }

    .financial-print-table-section {
        padding: 8px 12px 10px;
    }

    .financial-print-breakdown {
        grid-template-columns: repeat(2, 1fr);
        break-inside: avoid;
    }

    .financial-print-totals,
    .financial-print-signatures {
        break-inside: avoid;
    }

    .print-only {
        display: block;
    }

    body.print-family-modal {
        background: #fff;
    }

    body.print-family-modal,
    body.print-family-modal * {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body.print-family-modal > * {
        visibility: hidden;
    }

    body.print-family-modal .page-shell,
    body.print-family-modal [data-registered-family-results],
    body.print-family-modal .family-modal.is-printing,
    body.print-family-modal .family-modal.is-printing * {
        visibility: visible;
    }

    body.print-family-modal .topbar,
    body.print-family-modal .app-sidebar {
        display: none !important;
    }

    body.print-family-modal .page-shell > :not([data-registered-family-results]),
    body.print-family-modal [data-registered-family-results] > :not(.family-modal.is-printing),
    body.print-family-modal [data-registered-family-results] .family-modal:not(.is-printing) {
        display: none !important;
    }

    body.print-family-modal .page-shell {
        width: auto;
        margin: 0;
        padding: 0;
    }

    body.print-family-modal .family-modal.is-printing {
        position: static;
        display: block !important;
        padding: 0;
        background: #fff;
    }

    body.print-family-modal .family-modal.is-printing .modal-panel {
        width: auto;
        max-height: none;
        overflow: visible;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    body.print-family-modal .family-modal.is-printing .modal-header {
        position: static;
        padding: 0 0 8px;
        border-bottom: 2px solid var(--brand);
    }

    body.print-family-modal .family-modal.is-printing .modal-header-actions {
        display: none !important;
    }

    body.print-family-modal .family-modal.is-printing .modal-body {
        padding: 10px 0 0;
    }

    body.print-family-modal .family-card-hero,
    body.print-family-modal .family-signal,
    body.print-family-modal .family-info-group {
        break-inside: avoid;
    }

    body.print-family-modal .family-card-hero {
        padding: 12px;
    }

    body.print-family-modal .family-card-hero strong {
        font-size: 18px;
    }

    body.print-family-modal .family-signal-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    body.print-family-modal .family-signal {
        min-height: 76px;
        padding: 8px;
    }

    body.print-family-modal .family-info-groups {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }

    body.print-family-modal .family-info-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    body.print-family-modal .family-info-group {
        padding: 9px;
    }

    body.print-family-modal .family-info-item {
        min-height: 48px;
        padding: 6px 7px;
    }

    body.print-family-modal .family-assistance-sections {
        gap: 7px;
        margin-top: 8px;
    }

    body.print-family-modal .family-assistance-section {
        padding: 8px;
        break-inside: avoid;
    }

    body.print-family-modal .family-assistance-title {
        margin-bottom: 5px;
    }

    body.print-family-modal .family-assistance-title h3 {
        font-size: 12px;
    }

    body.print-family-modal .family-assistance-title > strong {
        min-width: 28px;
        height: 24px;
        font-size: 10px;
    }

    body.print-family-modal .family-assistance-list {
        gap: 4px;
    }

    body.print-family-modal .family-assistance-row {
        grid-template-columns: minmax(150px, 1.6fr) repeat(3, minmax(72px, .7fr));
        gap: 4px;
        padding: 5px;
    }

    body.print-family-modal .family-assistance-row span,
    body.print-family-modal .family-assistance-title span {
        font-size: 8px;
    }

    body.print-family-modal .family-assistance-row strong {
        font-size: 9px;
    }

    body.print-family-modal .family-assistance-empty {
        padding: 6px;
        font-size: 9px;
    }

    body.print-family-modal .family-print-members {
        margin-top: 8px;
        break-inside: auto;
    }

    body.print-family-modal .family-print-members h3 {
        margin: 0 0 5px;
        padding: 5px 8px;
        color: var(--brand-strong);
        background: #edf7ef;
        border: 1px solid #c4dfc8;
        border-radius: 6px;
        font-size: 11px;
    }

    body.print-family-modal .family-print-members .table-wrap {
        overflow: visible;
        border-radius: 0;
        box-shadow: none;
    }

    body.print-family-modal .family-print-members .family-members-table {
        min-width: 0;
        table-layout: fixed;
        font-size: 8px;
        line-height: 1.25;
    }

    body.print-family-modal .family-print-members .family-members-table th,
    body.print-family-modal .family-print-members .family-members-table td {
        padding: 3px 4px;
        white-space: normal;
    }

    body.print-family-modal .family-print-members .family-members-table th {
        color: #1d2520;
        background: #edf1eb;
    }
}

@media print {
    body,
    .purchase-voucher-print-document,
    .purchase-voucher-print-document * {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body:has(.purchase-voucher-print-document) .page-shell {
        width: auto;
        margin: 0;
        padding: 0;
    }

    .purchase-voucher-print-document {
        width: 170mm;
        max-width: 100%;
        margin: 0 auto;
        padding-bottom: 0;
        border: 1px solid #999;
        break-after: avoid;
        page-break-after: avoid;
    }

    .purchase-voucher-print-header {
        padding: 7px 10px;
        color: #fff;
        background: #0f6b3d;
        border-bottom: 0;
    }

    .purchase-voucher-print-header .print-logo-box,
    .purchase-voucher-print-header .print-header-meta {
        color: #fff;
        background: rgba(255, 255, 255, .12);
        border-color: rgba(255, 255, 255, .55);
        border-radius: 0;
    }

    .purchase-voucher-print-header h1 {
        font-size: 16px;
    }

    .purchase-voucher-print-header p {
        color: rgba(255, 255, 255, .86);
        font-size: 9px;
    }

    .purchase-voucher-hero {
        grid-template-columns: 1.2fr 1fr .75fr;
        gap: 5px;
        padding: 6px 10px;
        background: #eef7f0;
        border-color: #999;
    }

    .purchase-voucher-hero > div {
        min-height: auto;
        padding: 6px 7px;
        border-color: #999;
        border-radius: 0;
    }

    .purchase-voucher-hero strong,
    .purchase-voucher-amount strong {
        color: #0f3f27;
        font-size: 16px;
    }

    .purchase-voucher-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .purchase-voucher-print-document .print-section {
        padding: 6px 10px;
    }

    .purchase-voucher-print-document .print-section h2 {
        margin-bottom: 5px;
        padding: 3px 6px;
        font-size: 11px;
    }

    .purchase-voucher-print-document .print-info-grid,
    .purchase-voucher-print-document .print-summary-grid,
    .purchase-voucher-print-document .print-signatures {
        gap: 4px;
    }

    .purchase-voucher-print-document .print-info-grid > div,
    .purchase-voucher-print-document .print-summary-grid > div,
    .purchase-voucher-print-document .print-signatures > div {
        min-height: auto;
        padding: 4px 5px;
    }

    .purchase-voucher-print-document .print-info-grid span,
    .purchase-voucher-print-document .print-summary-grid span,
    .purchase-voucher-print-document .print-signatures span {
        font-size: 8.5px;
    }

    .purchase-voucher-print-document .print-info-grid strong,
    .purchase-voucher-print-document .print-summary-grid strong,
    .purchase-voucher-print-document .print-signatures strong {
        margin-top: 1px;
        font-size: 9.4px;
    }

    .purchase-voucher-stores {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .purchase-voucher-stores > div {
        min-height: auto;
        padding: 4px 5px;
        background: #fff;
        border-color: #999;
        border-radius: 0;
    }

    .purchase-voucher-terms ul {
        gap: 2px;
        padding-right: 14px;
        font-size: 8.8px;
    }

    .purchase-voucher-redemptions-table {
        table-layout: fixed;
        font-size: 8.2px;
    }

    .purchase-voucher-print-document .financial-print-signatures .print-signatures strong {
        min-height: 18px;
    }

    .purchase-voucher-qr-box {
        padding: 8px 10px;
        background: #eef7f0;
        border-color: #999;
        border-radius: 0;
        gap: 10px;
    }

    .purchase-voucher-qr-box #voucher-qr-code {
        width: 80px;
        height: 80px;
    }

    .purchase-voucher-qr-text strong {
        font-size: 11px;
    }

    .purchase-voucher-qr-text span {
        font-size: 9px;
    }
}

.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 24px 12px 40px;
}

.org-chart-level {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    position: relative;
    margin-top: 40px;
}

.org-chart-level:first-child {
    margin-top: 0;
}

.org-chart-level:not(:first-child)::before {
    content: '';
    position: absolute;
    top: -40px;
    right: 50%;
    width: 1px;
    height: 40px;
    background: var(--line-strong);
}

.org-chart-box {
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 12px 18px;
    text-align: center;
    background: #fff;
    min-width: 170px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.org-chart-box strong {
    display: block;
    color: var(--brand-strong);
    margin-bottom: 6px;
    font-size: 14px;
}

.org-chart-box span {
    display: block;
    font-size: 13px;
    color: #4a5a51;
}

.org-chart-box span + span {
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px dashed var(--line);
}
