:root {
    --brand: #0f766e;
    --brand-dark: #115e59;
    --gold: #f4b942;
    --ink: #17324d;
    --surface: #f5f7fa;
}

html, body {
    min-height: 100%;
}

body {
    background: var(--surface);
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.app-header {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    color: #fff;
    box-shadow: 0 2px 12px rgba(15, 118, 110, .18);
}

.app-header .navbar {
    padding: .8rem 0;
}

.app-header .navbar-brand,
.app-header .association-brand-name,
.app-header .nav-link,
.app-header .navbar-text {
    color: #fff !important;
}

.app-header .nav-link {
    border-radius: .5rem;
    padding-right: .8rem !important;
    padding-left: .8rem !important;
}

.app-header .nav-link:hover {
    background: rgba(255,255,255,.14);
}

.app-nav-container {
    max-width: 1680px;
    padding-right: clamp(.75rem, 2vw, 2rem);
    padding-left: clamp(.75rem, 2vw, 2rem);
}

.app-nav-links {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center;
    gap: .35rem;
}

.app-nav-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: .45rem .8rem !important;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff !important;
    font-size: clamp(.72rem, .9vw, .9rem);
    line-height: 1.25;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.app-nav-pill:hover,
.app-nav-pill:focus-visible {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .65);
    color: #fff !important;
    transform: translateY(-1px);
}

.app-nav-pill.active {
    background: #fff;
    border-color: #fff;
    color: var(--brand-dark) !important;
    font-weight: 700;
}

.app-user-menu {
    white-space: nowrap;
}

.app-header .navbar-toggler {
    border-color: rgba(255, 255, 255, .6);
}

@media (max-width: 1199.98px) {
    .app-nav-links {
        padding-top: .65rem;
        padding-bottom: .25rem;
    }
}

@media (max-width: 575.98px) {
    .app-header .navbar {
        padding: .65rem 0;
    }

    .app-nav-pill {
        min-height: 2.2rem;
        padding-right: .65rem !important;
        padding-left: .65rem !important;
        font-size: .72rem;
    }

    .app-user-menu {
        margin-top: .6rem;
        justify-content: space-between;
    }
}

.nav-tabs {
    flex-wrap: wrap;
    gap: .35rem;
}

.nav-tabs .nav-link {
    white-space: nowrap;
    border-radius: .6rem .6rem 0 0;
}

.page-title {
    color: var(--ink);
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.metric-card {
    background: #fff;
    border: 0;
    border-right: 4px solid var(--brand);
    border-radius: .8rem;
    box-shadow: 0 3px 14px rgba(23, 50, 77, .06);
    height: 100%;
}

.metric-card .metric-label {
    color: #64748b;
    font-size: .9rem;
}

.metric-card .metric-value {
    color: var(--ink);
    font-size: 1.65rem;
    font-weight: 700;
}

.metric-card.gold { border-right-color: var(--gold); }
.metric-card.danger { border-right-color: #dc3545; }
.metric-card.info { border-right-color: #2563eb; }

.table-card {
    background: #fff;
    border: 0;
    border-radius: .8rem;
    box-shadow: 0 3px 14px rgba(23, 50, 77, .06);
}

.table thead th {
    background: #eef7f5;
    color: var(--brand-dark);
    white-space: nowrap;
}

.inventory-card .card-header {
    border-bottom: 1px solid #e2e8f0;
}

.inventory-table {
    min-width: 980px;
}

.inventory-table th,
.inventory-table td {
    vertical-align: middle;
}

.inventory-table tbody tr {
    transition: background-color .15s ease;
}

.inventory-table tbody tr:hover {
    background-color: #f8fbfb;
}

.inventory-member-name {
    color: var(--ink);
    font-weight: 700;
}

.inventory-progress {
    width: 100%;
    min-width: 110px;
    height: .45rem;
    overflow: hidden;
    background: #e2e8f0;
    border-radius: 999px;
}

.inventory-progress span {
    display: block;
    height: 100%;
    background: var(--brand);
    border-radius: inherit;
}

.inventory-progress-fasting span {
    background: var(--gold);
}

.inventory-table tr.inventory-deceased-row {
    background: #fffaf0;
}

.inventory-table tr.inventory-deceased-row:hover {
    background: #fff4d6;
}

.inventory-note {
    margin-top: .75rem;
    color: #64748b;
    font-size: .78rem;
    text-align: center;
}

.arrears-months {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    min-width: 320px;
}

.arrears-month {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: .3rem .4rem;
    border: 1px solid #f0b8b8;
    border-radius: .5rem;
    background: #fff5f5;
    color: #a11a1a;
    text-decoration: none;
    line-height: 1.25;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.arrears-month:hover {
    background: #ffe9e9;
    color: #7d1414;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(160, 24, 24, .18);
}

.arrears-month.paid {
    border-color: #b7e2cd;
    background: #f2fbf6;
    color: #1c6b46;
    pointer-events: none;
    opacity: .85;
}

.arrears-month-label {
    font-size: .8rem;
    font-weight: 700;
}

.arrears-month-year {
    font-size: .68rem;
    opacity: .75;
}

.arrears-month-amount {
    font-size: .68rem;
    font-weight: 700;
}

.directory-sheet {
    background: #fff;
    border-radius: .6rem;
    padding: 1rem;
}

.directory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .6rem;
    margin-bottom: .6rem;
    border-bottom: 2px solid var(--brand);
}

.directory-title {
    text-align: left;
    font-weight: 700;
    color: var(--ink);
}

.directory-table {
    font-size: .78rem;
}

.directory-table th,
.directory-table td {
    padding: .2rem .3rem;
    vertical-align: middle;
}

.directory-table thead th {
    background: #eef7f5;
    color: var(--brand-dark);
}

.directory-group td {
    background: #f1f5f9;
    font-weight: 700;
    color: var(--ink);
}

@page directory {
    size: A4 portrait;
    margin: 1cm;
}

@media print {
    .directory-sheet {
        padding: 0;
    }

    .directory-table {
        font-size: 9px;
    }

    .directory-table th,
    .directory-table td {
        padding: 1px 3px;
    }

    .directory-table thead {
        display: table-header-group;
    }

    .directory-table tr {
        break-inside: avoid;
    }
}

.badge-status {
    font-size: .78rem;
    padding: .35rem .55rem;
}

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

.btn-brand:hover, .btn-brand:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .15);
}

.login-card {
    max-width: 430px;
    margin: 8vh auto;
}

.receipt {
    max-width: 760px;
    margin: auto;
    background: #fff;
    border-radius: .8rem;
    box-shadow: 0 3px 14px rgba(23, 50, 77, .08);
}

.statement-sheet {
    page: statement;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: .6rem;
    box-shadow: 0 4px 18px rgba(23, 50, 77, .08);
}

.statement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--brand);
}

.statement-brand .association-brand-name {
    color: var(--ink);
}

.statement-title {
    padding: .45rem 1.5rem;
    color: #fff;
    background: var(--brand);
    border-radius: .4rem;
    font-weight: 700;
}

.statement-info {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.statement-info > div {
    padding: .4rem .55rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: .35rem;
}

.statement-info span {
    color: #64748b;
}

.statement-monthly-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    margin-bottom: .75rem;
    padding: .55rem .8rem;
    color: var(--brand-dark);
    background: #eef7f5;
    border: 1px solid #b9d9d3;
    border-radius: .4rem;
    font-weight: 700;
}

.statement-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    padding: .65rem .8rem;
    margin-bottom: 1rem;
    color: var(--ink);
    background: #eef7f5;
    border-radius: .4rem;
}

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

.statement-table {
    min-width: 1200px;
    table-layout: fixed;
    text-align: center;
    font-size: .75rem;
}

.statement-table th,
.statement-table td {
    padding: .35rem .25rem;
    vertical-align: middle;
    border-color: #94a3b8 !important;
}

.statement-table thead th {
    color: var(--brand-dark);
    background: #e2eef0;
}

.statement-table .statement-subhead th {
    color: #475569;
    background: #f1f5f9;
    font-size: .68rem;
}

.statement-dates-row td {
    min-height: 42px;
    background: #fff;
}

.statement-amounts-row td {
    background: #f8fafc;
    font-weight: 600;
}

.statement-amounts-row small,
.statement-dates-row small {
    display: block;
    margin-top: .15rem;
    font-size: .62rem;
    font-weight: 400;
}

.statement-note {
    margin-top: .8rem;
    color: #475569;
    font-size: .78rem;
    text-align: center;
}

.statement-signatures {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin-top: 2.5rem;
    text-align: center;
    font-size: .85rem;
}

.statement-signatures span {
    display: inline-block;
    width: 65%;
    margin-top: 1.5rem;
    border-top: 1px solid #334155;
}

@page {
    size: landscape;
    margin: 1cm;
}

@media print {
    .app-header, footer, .no-print { display: none !important; }
    body { background: #fff; }
    .receipt { box-shadow: none; }
    .statement-sheet { max-width: none; padding: 0; border: 0; box-shadow: none; }
    .statement-info { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .table-card { box-shadow: none; }
    .table-responsive { overflow: visible; }
    .table thead { display: table-header-group; }
    .table tr { break-inside: avoid; }
    .statement-table { min-width: 0; font-size: 8px; }
    .statement-table th, .statement-table td { padding: 2px; }
    .inventory-table { min-width: 0; font-size: .68rem; }
    .inventory-table th, .inventory-table td { padding: .3rem .25rem; }
    .inventory-table .btn { display: none; }
    .inventory-progress { min-width: 70px; }
}

.association-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: inherit;
    white-space: nowrap;
}

.association-brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
}

.association-brand.placeholder-logo .association-brand-logo {
    width: 38px;
    height: 38px;
}

.association-brand-name {
    font-weight: 700;
}

.report-brand {
    padding: .35rem 0;
}

.report-brand .association-brand-name {
    color: var(--ink);
}

.badge-status.text-bg-success {
    background-color: #198754 !important;
}

.badge-status.text-bg-danger {
    background-color: #dc3545 !important;
}

.badge-status.text-bg-warning {
    background-color: #b02a37 !important;
}

.member-results {
    display: grid;
    gap: .3rem;
    max-height: 320px;
    overflow-y: auto;
}

.member-result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: .45rem .7rem;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: #fff;
    text-align: right;
    transition: background-color .12s ease, border-color .12s ease;
}

.member-result:hover {
    background: #f0fdfa;
    border-color: var(--brand);
}

.member-result.active {
    background: #eef7f5;
    border-color: var(--brand);
}

.member-result-name {
    font-weight: 600;
    color: var(--ink);
}

.member-result-meta {
    font-size: .75rem;
    color: #64748b;
}

.year-grid th,
.year-grid td {
    padding: .15rem .2rem;
    text-align: center;
    vertical-align: middle;
    font-size: .74rem;
}

.year-grid .cell-link {
    display: block;
    font-weight: 700;
    text-decoration: none;
    color: #7d1414;
}

.year-grid .cell-date {
    font-size: .62rem;
    color: #64748b;
}

.year-grid td.cell-paid {
    background: #f2fbf6;
}

.year-grid td.cell-paid .cell-link {
    color: #1c6b46;
}

.year-grid td.cell-due {
    background: #fff5f5;
}

.year-grid td.cell-empty {
    background: #f8fafc;
    color: #cbd5e1;
}
.portal-hero {
    text-align: center;
    padding: 1.5rem 1rem 1rem;
}

.portal-hero-compact {
    text-align: right;
    padding: 0 0 .5rem;
}

.portal-logo {
    display: inline-block;
    padding: .5rem 1rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 18px rgba(15, 118, 110, .12);
}

.portal-tagline {
    margin: .6rem 0 0;
    color: #64748b;
    font-size: .95rem;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.portal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 1.6rem 1.2rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    text-align: center;
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 4px 16px rgba(23, 50, 77, .06);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.portal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(23, 50, 77, .14);
    color: var(--ink);
}

.portal-card-icon {
    font-size: 2.4rem;
    line-height: 1;
}

.portal-card-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.portal-card-text {
    margin: 0;
    color: #64748b;
    font-size: .85rem;
}

.portal-card-link {
    margin-top: .4rem;
    font-size: .8rem;
    font-weight: 700;
}

.portal-incoming {
    border-top: 4px solid var(--brand);
}

.portal-incoming .portal-card-link {
    color: var(--brand);
}

.portal-outgoing {
    border-top: 4px solid #dc3545;
}

.portal-outgoing .portal-card-link {
    color: #dc3545;
}

.portal-religious {
    border-top: 4px solid var(--gold);
}

.portal-religious .portal-card-link {
    color: #b8860b;
}

.section-label {
    margin-bottom: .5rem;
    font-weight: 700;
    color: var(--brand-dark);
    border-right: 4px solid var(--brand);
    padding-right: .5rem;
}

.portal-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .6rem;
}

.portal-link {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .7rem .9rem;
    border: 1px solid #e2e8f0;
    border-radius: .7rem;
    background: #fff;
    text-decoration: none;
    color: var(--ink);
    transition: border-color .12s ease, background-color .12s ease;
}

.portal-link:hover {
    border-color: var(--brand);
    background: #f6fdfc;
    color: var(--ink);
}

.portal-link strong {
    font-size: .95rem;
}

.portal-link span {
    font-size: .76rem;
    color: #64748b;
}

.portal-link-accent {
    border-color: var(--gold);
    background: #fffdf5;
}
.print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .6rem .9rem;
    margin-bottom: .6rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-bottom: 3px solid var(--brand);
    border-radius: .6rem;
}

.print-header-brand .association-brand-name {
    color: var(--ink);
}

.print-header-title strong {
    display: block;
    font-size: 1.15rem;
    color: var(--ink);
}

.print-header-subject {
    font-size: .85rem;
    color: #475569;
}

.print-header-meta {
    display: flex;
    gap: 1rem;
    font-size: .78rem;
    text-align: left;
}

.print-header-meta span {
    display: block;
    color: #64748b;
}

.print-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .5rem;
    margin-bottom: .8rem;
}

.print-total {
    padding: .45rem .7rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
}

.print-total span {
    display: block;
    font-size: .75rem;
    color: #64748b;
}

.print-total strong {
    font-size: 1rem;
    color: var(--ink);
}

.print-note {
    font-size: .78rem;
    color: #475569;
    text-align: center;
}

@media print {
    .print-header {
        border: 0;
        border-bottom: 2px solid #000;
        padding: 0 0 .4rem;
        margin-bottom: .5rem;
    }

    .print-header-title strong {
        font-size: 12pt;
    }

    .print-header-subject,
    .print-header-meta,
    .print-total span,
    .print-note {
        font-size: 8pt;
    }

    .print-total strong {
        font-size: 10pt;
    }

    .print-total {
        padding: 2px 5px;
    }

    .print-header,
    .print-total {
        break-inside: avoid;
    }
}
.advance-box {
    padding: .7rem .9rem;
    background: #fffdf5;
    border: 1px solid var(--gold);
    border-radius: .6rem;
}