/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

@media (max-width: 768px) {
    html {
        zoom: 1.2;
    }

    .landing-container,
    .login-wrapper,
    .dashboard-container {
        min-height: calc(100vh / 1.2);
    }

    .members-page {
        height: calc(100vh / 1.2);
        max-height: calc(100vh / 1.2);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
}

/* Landing Page Styles */
.landing-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
}

.landing-main {
    flex: 1;
}

.hero-section {
    background: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.hero-description {
    font-size: 1.2rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 6px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.filter-button-row {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    max-width: 100%;
}

.year-controls {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    align-items: stretch;
    flex-wrap: nowrap;
}

.year-controls .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    line-height: 1;
    min-height: 30px;
    background-color: #dbe7ff;
    color: #243056;
    border: 1px solid #c5d4fb;
}

.year-controls .btn:hover {
    background-color: #c9daff;
    color: #243056;
    transform: none;
    box-shadow: none;
}

.year-nav {
    min-width: 36px;
}

.year-nav i {
    font-size: 1rem;
    line-height: 1;
    display: block;
}

.year-controls .btn:disabled,
.year-controls .btn:disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.about-section,
.mission-section {
    background: #f8f9fa;
    padding: 3rem 0;
    margin-top: 2rem;
}

.about-section h2,
.mission-section h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.about-section p,
.mission-section p {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
}

.landing-footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

.landing-footer p {
    margin: 0;
}

/* Login Page Styles */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

html:has(.login-page) {
    zoom: 1;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body.login-page {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

.login-page .login-wrapper {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0 !important;
    overflow: hidden;
}

.login-page .login-container {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.login-page .login-box {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(400px, calc(100% - 2rem));
    max-width: none;
    transform: translate(-50%, -50%);
}

.login-page .login-footer {
    position: static;
    flex: 0 0 auto;
}

@media (max-width: 768px) {
    .login-page .login-container {
        padding: 0.35rem 0.65rem;
    }

    .login-page .login-box {
        width: min(400px, calc(100% - 0.75rem));
        padding: 0.8rem 0.9rem 0.65rem;
    }

    .login-page .login-box h2 {
        margin-bottom: 0.35rem;
        font-size: 1.35rem;
    }

    .login-page .login-box .logo {
        font-size: 1.15rem;
        margin-bottom: 0.15rem;
    }

    .login-page .login-brand-logo {
        max-height: 52px;
        margin-bottom: 0.3rem;
    }

    .login-page .form-group {
        margin-bottom: 0.45rem;
    }

    .login-page .form-group label {
        margin-bottom: 0.15rem;
        font-size: 0.9rem;
    }

    .login-page .form-group input {
        padding: 8px 10px;
        font-size: 16px;
    }

    .login-page .btn-full {
        padding: 8px;
        margin-top: 0.4rem;
    }

    .login-page .login-links {
        margin-top: 0.35rem;
    }

    .login-page .login-lang-switch {
        margin-top: 0.45rem;
    }

    .login-page .alert {
        padding: 8px;
        margin-bottom: 0.4rem;
        font-size: 0.85rem;
    }

    .login-page .login-footer {
        padding: 0.2rem 0;
    }

    .login-page .login-footer p {
        font-size: 0.75rem;
    }
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Login Footer */
.login-footer {
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    text-align: center;
    padding: 1rem 0;
}

.login-footer p {
    margin: 0;
    font-size: 0.9rem;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.login-lang-switch {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}

.login-links {
    text-align: center;
    margin-top: 0.75rem;
}

.login-links + .login-links {
    margin-top: 1rem;
}

.login-links a {
    color: #667eea;
    text-decoration: none;
}

.login-box .logo {
    text-align: center;
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.login-box img {
    max-width: 100%;
    height: auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-full {
    width: 100%;
    padding: 12px;
    margin-top: 1rem;
}

.alert {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: linear-gradient(135deg, #ff87b3 0%, #764ba2 100%);
    color: white;
    /* padding: 1rem 0; */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Dashboard Header Navigation Styles */
.topnav {
    padding: 6px 0;
}

.brand-and-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.portal-brand-title {
    min-width: 0;
}

.brand-logo {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
}

.portal-brand h1,
.brand-and-toggle h1 {
    font-size: 1.5rem;
    margin: 0;
}

.settings-file-preview-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
}

.settings-file-preview {
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
}

.login-brand-logo,
.landing-brand-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80px;
    margin: 0 auto 0.75rem;
    object-fit: contain;
}

.settings-letterhead-preview {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    border: 1px solid #e0e0e0;
    background: #fff;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-menu .welcome {
    margin-right: 6px;
    color: #333;
    font-size: 0.85rem;
}

.nav-menu .btn {
    padding: 3px 6px;
    font-size: 1rem;
}

.nav-links,
.nav-links-a,
.nav-links-b {
    display: flex;
    /* align-items: center; */
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .portal-brand {
        flex: 1;
        overflow: hidden;
    }

    .portal-brand-title {
        flex: 1;
        overflow: hidden;
    }

    .portal-brand h1 {
        display: inline-block;
        white-space: nowrap;
        max-width: none;
    }

    .portal-brand.is-overflowing h1 {
        animation: portal-brand-scroll var(--brand-duration, 8s) ease-in-out infinite alternate;
    }

    .nav-toggle {
        display: inline-block;
        flex-shrink: 0;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-top: 8px;
    }
    
    .nav-menu.open {
        display: flex;
    }

    .nav-menu .nav-welcome,
    .nav-menu .nav-links {
        width: 100%;
    }

    .nav-menu .nav-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 10px;
    }

    .nav-menu .nav-links-a,
    .nav-menu .nav-links-b {
        display: flex;
        flex-direction: column;
        /* align-items: stretch; */
        gap: 10px;
        min-width: 0;
    }
    .nav-menu .nav-links-a {
        align-content: flex-start;
    }
    .nav-menu .nav-links-b {
        align-content: flex-end;
    }

    .nav-menu .nav-links .btn {
        display: block;
        /* width: 100%; */
        box-sizing: border-box;
        text-align: center;
    }

    .login-container {
        padding: 1rem;
    }

    .login-box {
        padding: 1.5rem;
    }

    .login-brand-logo,
    .landing-brand-logo {
        max-height: 64px;
    }
}

@keyframes portal-brand-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(var(--brand-shift, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
    .portal-brand.is-overflowing h1 {
        animation: none;
    }
}

.dashboard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-nav h1 {
    font-size: 1.5rem;
}

.dashboard-nav .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-nav .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.dashboard-content {
    padding: 0.5rem 0;
    flex: 1;
}

/* Dashboard Footer */
.dashboard-footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 0.25rem 0;
    margin-top: auto;
    /* position: sticky;
    bottom: 0; */
}
.login-wrapper .login-footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 0.25rem 0;
    margin-top: auto;
    position: sticky;
    bottom: 0;
}

.dashboard-footer p {
    margin: 0;
    font-size: 0.9rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.profile-container ~ .page-header {
    margin-bottom: 1rem;
}

.page-header h2 {
    color: #333;
    font-size: 2rem;
}

.lang-switch {
    display: flex;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.lang-switch .btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    background: #ccc;
    color: #333;
}

.lang-switch .btn.is-active {
    background: #667eea;
    color: #fff;
}

.password-lang-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.password-lang-bar h2 {
    margin: 0;
}

body.lang-bn {
    font-family: 'Nirmala UI', 'Kalpurush', 'Segoe UI', sans-serif;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    min-width: 0;
    max-width: 100%;
}

.member-search {
    position: relative;
    flex: 1 1 220px;
    width: 100%;
    min-width: 0;
    max-width: 360px;
}

.member-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: #8b93b0;
    pointer-events: none;
}

.member-search input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 40px 0 42px;
    border: 1px solid #e4e7f1;
    border-radius: 999px;
    background: #fff;
    font-size: 0.95rem;
    color: #333;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.member-search input::placeholder {
    color: #98a0b8;
}

.member-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.16);
}

.member-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 26px;
    height: 26px;
    transform: translateY(-50%);
    border: none;
    border-radius: 50%;
    background: #eef0f6;
    color: #5b6178;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.member-search-clear:hover {
    background: #e2e5f0;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
}

.table-container .dataTables_wrapper {
    padding: 12px 16px 16px;
}
.table-container .dataTables_length,
.table-container .dataTables_filter,
.table-container .dataTables_info,
.table-container .dataTables_paginate {
    margin: 8px 0;
    font-size: 0.9rem;
}
.table-container .dataTables_filter input,
.table-container .dataTables_length select {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.table-container .dataTables_paginate .paginate_button {
    padding: 4px 8px !important;
    border-radius: 4px !important;
}
.table-container .dataTables_paginate .paginate_button.current {
    background: #667eea !important;
    color: #fff !important;
    border: 1px solid #5a6fd6 !important;
}
#smsLogsTable td.sms-log-message,
#expensesTable td.expense-description {
    white-space: normal;
    max-width: 420px;
    word-break: break-word;
}
#expensesTable td.expense-amount {
    text-align: right;
    white-space: nowrap;
}

.members-page {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.members-page .dashboard-content {
    min-height: 0;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.members-page .dashboard-content > .container {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.members-page .page-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    container-type: inline-size;
}

.member-add-btn .member-add-icon {
    display: none;
}

.member-tools-toggle {
    display: none;
}

.member-header-tools {
    display: contents;
}

.member-tools-arrow {
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -4px;
}

.member-tools-toggle[aria-expanded="true"] .member-tools-arrow {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.members-page .page-header h2 {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
}

.members-page .table .hidden-member-col {
    display: none;
}

.members-page.show-invited-by .table .hidden-member-col {
    display: table-cell;
}

.member-name-link {
    padding: 0;
    border: 0;
    background: none;
    color: #3f51b5;
    font: inherit;
    font-weight: 600;
    font-size: 120%;
    white-space: normal;
    overflow-wrap: break-word;
    cursor: pointer;
    text-align: left;
}

.member-name-link:hover {
    text-decoration: underline;
}

.member-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
}

.member-trash-icon {
    font-size: 14px;
    line-height: 1;
}

.members-page .page-header > .btn {
    flex: 0 0 auto;
}

.members-page .page-header .member-search {
    margin-left: auto;
    flex: 1 1 220px;
    width: auto;
    max-width: 360px;
    min-width: 160px;
}

.members-page .table-container {
    flex: 1;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    overflow-y: auto;
    overscroll-behavior-y: auto;
}

.members-page .table {
    border-collapse: separate;
    border-spacing: 0;
}

.members-page .table td {
    padding: 5px;
}

.members-page .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #667eea;
}

.members-page .table thead th.sortable:hover {
    background-color: #667eea;
    background-image: linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.12));
}

.members-page .table th.member-name-col,
.members-page .table td.member-name-col {
    min-width: 200px;
    white-space: normal;
    overflow-wrap: break-word;
}

.members-page .table td.member-name-col .member-name-link {
    display: inline;
    max-width: 100%;
}

/* Apply no-wrap to all tables across the codebase */
table th,
table td {
    white-space: nowrap;
}

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

.table thead {
    background-color: #667eea;
    color: white;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th.sortable {
    cursor: pointer;
    user-select: none;
}

.table th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.table th.sortable::after {
    content: ' \2195';
    font-size: 0.75em;
    opacity: 0.55;
}

.table th.sortable.sort-asc::after {
    content: ' \25B2';
    opacity: 1;
}

.table th.sortable.sort-desc::after {
    content: ' \25BC';
    opacity: 1;
}

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

table tbody tr.row-glow td {
    background-color: #efeaff !important;
    box-shadow: inset 0 0 14px rgba(102, 126, 234, 0.28);
    animation: row-glow 0.45s ease;
}

table tbody tr.row-glow td:first-child {
    box-shadow: inset 4px 0 0 #667eea, inset 0 0 14px rgba(102, 126, 234, 0.28);
}

@keyframes row-glow {
    from { background-color: #d9d2ff; }
    to { background-color: #efeaff; }
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-edit {
    background-color: #28a745;
    color: white;
}

.btn-edit:hover {
    background-color: #218838;
}

.btn-warning {
    background-color: #ffc107;
    color: #000;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
}

.status-unpaid {
    background-color: #fff3cd;
    color: #856404;
}

.payment-history-note {
    color: #666;
    font-size: 0.85rem;
    margin: 0 0 0.75rem;
}

.payment-history-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.payment-history-year {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
}

.payment-history-year select,
.year-select select {
    font: inherit;
    font-weight: 500;
    padding: 4px 8px;
    border: 1px solid #d5d9e6;
    border-radius: 6px;
    background: #fff;
    color: #222;
}

.year-select {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.payment-history-year-print {
    display: none;
}

.member-details-print-sheet .payment-history-year-print {
    display: inline;
}

.payment-row-unpaid {
    background-color: #fffdf5;
}

.payment-row-deactivated {
    background-color: #fafafa;
    color: #777;
}

.payment-row-receipt {
    cursor: pointer;
}

.payment-row-receipt:hover td {
    background: #eef2ff;
}

.receipt-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.receipt-overlay[hidden] {
    display: none;
}

.receipt-dialog {
    width: min(560px, 90%);
    margin: auto;
}

.receipt-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
    color: #1e293b;
    /* font-size: 1.2rem; */
}

.receipt-head {
    display: flex;
    gap: 14px;
    align-items: center;
    background: #667eea;
    color: #fff;
    padding: 20px 22px;
}

.receipt-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    flex: 0 0 auto;
}

.receipt-head h3 {
    margin: 0 0 4px;
    font-size: 1.55rem;
    color: #fff;
}

.receipt-head p,
.receipt-tagline {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.92);
}

.receipt-body {
    padding: 20px 22px 22px;
}

.receipt-title {
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 1.2rem;
    color: #4338ca;
    margin-bottom: 16px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 4px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.receipt-row span {
    color: #64748b;
    flex: 0 0 auto;
}

.receipt-row strong {
    text-align: right;
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
}

.receipt-note {
    padding: 12px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.receipt-note span {
    color: #64748b;
    font-size: 1.05rem;
}

.receipt-note p {
    margin: 4px 0 0;
    font-size: 1.2rem;
}

.receipt-amount {
    margin-top: 18px;
    background: #eef2ff;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.receipt-amount span {
    display: block;
    color: #64748b;
    font-size: 1.05rem;
}

.receipt-amount strong {
    display: block;
    font-size: 2.15rem;
    color: #3730a3;
    margin-top: 4px;
}

.receipt-thanks {
    text-align: center;
    color: #64748b;
    margin: 16px 0 0;
    font-size: 1.1rem;
}

.receipt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.receipt-actions .btn {
    flex: 1 1 30%;
    font-size: 1.05rem;
    padding: 12px 10px;
}

.receipt-actions .btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #25d366;
    color: #fff;
}

.btn-whatsapp:hover {
    background-color: #1ebe57;
    color: #fff;
}

.btn-whatsapp svg {
    width: 1.15em;
    height: 1.15em;
    fill: currentColor;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .receipt-overlay {
        padding: 8px;
    }

    /* .receipt-card {
        font-size: 1.35rem;
    } */

    .receipt-head {
        padding: 18px 16px;
    }

    .receipt-logo {
        width: 64px;
        height: 64px;
    }

    .receipt-head h3 {
        font-size: 1.7rem;
    }

    .receipt-head p,
    .receipt-tagline {
        font-size: 1.15rem;
    }

    .receipt-body {
        padding: 18px 16px 20px;
    }

    .receipt-title {
        font-size: 1.35rem;
    }

    .receipt-row {
        padding: 4px 0;
    }

    .receipt-note span,
    .receipt-amount span {
        font-size: 1.15rem;
    }

    .receipt-note p {
        font-size: 1.35rem;
    }

    .receipt-amount strong {
        font-size: 2.4rem;
    }

    .receipt-thanks {
        font-size: 1.2rem;
    }

    .receipt-actions {
        flex-wrap: nowrap;
    }

    .receipt-actions .btn {
        flex: 1 1 0;
        min-width: 0;
        font-size: 0.98rem;
        padding: 12px 4px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

/* Compact Password Modal */
.password-modal {
    padding: 1.25rem;
    max-width: 500px;
}

.password-modal .modal-header {
    margin-bottom: 1rem;
}

.password-modal .modal-header h3 {
    font-size: 1.25rem;
}

.password-modal .form-group {
    margin-bottom: 0.75rem;
}

.password-modal .form-group label {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.password-modal .form-group input {
    padding: 8px 12px;
    font-size: 0.95rem;
}

.password-modal .form-row {
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Compact Member Modal */
.member-modal {
    padding: 1.25rem;
    max-width: 650px;
}

.member-modal .modal-header {
    margin-bottom: 1rem;
}

.member-modal .modal-header h3 {
    font-size: 1.25rem;
}

.member-modal .form-group {
    margin-bottom: 0.75rem;
}

.member-modal .form-group label {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

#memberModal .form-group > label,
#memberModal .member-picker > label,
#memberModal .member-category-label {
    display: block;
    background: #ccccdb;
    padding: 4px 8px;
    border-radius: 4px;
}

.member-modal .form-group input,
.member-modal .form-group select,
.member-modal .form-group textarea {
    padding: 8px 12px;
    font-size: 0.95rem;
}

.member-modal .form-group textarea {
    padding: 8px 12px;
}

.member-modal .form-row {
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.member-category-label { display: block; margin-bottom: 0.4rem; font-weight: 600; }
.member-category-choices { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.member-category-choice { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.member-category-choice input { width: auto; margin: 0; }
.member-category-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.member-category-row input,
.member-category-add input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font: inherit; }
.member-category-row .btn,
.member-category-add .btn { flex: 0 0 auto; }
.member-category-row .btn:disabled,
.member-category-row .btn:disabled:hover { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.member-category-add { display: flex; gap: 8px; align-items: center; }
.members-by-type-modal { max-width: 920px; }
.members-by-type-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.member-type-chip.is-selected,
.member-type-chip.is-selected:hover { background: #667eea; color: #fff; border-color: #5a6fd6; }
.member-type-section { margin-bottom: 16px; }
.member-type-section h4 { margin: 0 0 8px; color: #667eea; }
.members-by-type-table-wrap { max-height: 60vh; overflow: auto; }
.member-type-phone { color: #666; font-size: 0.85rem; font-weight: 400; }
.members-by-type-modal .member-category-choices { gap: 6px 12px; }

.member-modal .photo-preview {
    max-width: 120px;
    max-height: 120px;
    margin-top: 8px;
}

.member-modal .photo-preview-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.phone-numbers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.phone-number-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.phone-primary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #444;
    white-space: nowrap;
}

.phone-primary input {
    width: auto;
    margin: 0;
}

.phone-primary-tag {
    color: #667eea;
    font-size: 0.75rem;
    font-weight: 700;
}

.phone-number-row input[type="tel"] {
    flex: 1;
    min-width: 140px;
}

.member-modal .field-hint {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: #666;
}

.member-phones {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.25;
}

.member-phones a,
.member-phones span,
.member-card-grid strong .member-phones a,
.member-card-grid strong .member-phones span {
    color: #000;
    font-weight: 400;
    text-decoration: none;
}

.member-phones .phone-primary-number,
.member-card-grid strong .member-phones .phone-primary-number {
    font-weight: 700;
}

.member-phones a:hover {
    text-decoration: underline;
}

/* Compact Donation Modal */
.donation-modal {
    padding: 1.25rem;
    max-width: 760px;
}

.month-year-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.month-year-bar label {
    margin: 0;
}

.donation-modal .month-year-bar input {
    width: 110px;
    margin: 0;
}

.month-entry-wrap {
    max-height: 240px;
    overflow: auto;
    border: 1px solid #e4e7f1;
    border-radius: 8px;
    background: #fafbff;
}

.month-entry-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.month-entry-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #eef0fb;
    color: #667eea;
    font-size: 0.75rem;
    text-align: left;
    padding: 0.4rem 0.5rem;
}

.month-entry-table td {
    padding: 0.3rem 0.45rem;
    border-top: 1px solid #e6e8f0;
    vertical-align: middle;
    white-space: nowrap;
}

.month-entry-table tr.is-paid td {
    color: #98a0b8;
}

.month-checks-empty {
    margin: 0;
    color: #667;
    font-size: 0.85rem;
}

.month-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 500;
}

.donation-modal .month-check input {
    width: auto;
    margin: 0;
    padding: 0;
}

.month-check.is-paid {
    color: #98a0b8;
}

.month-check em {
    font-style: normal;
    font-size: 0.68rem;
    color: #dc3545;
}

.donation-modal .month-entry-table input[type="number"],
.donation-modal .month-entry-table input[type="text"],
.donation-modal .month-entry-table input[type="date"] {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 6px 8px;
    box-sizing: border-box;
}

.month-entry-table .month-amount-col {
    width: 110px;
}

.month-entry-table .month-date-col {
    width: 9.5rem;
}

.month-entry-table .month-note-col {
    width: 34%;
}

@media (max-width: 768px) {
    .modal-content table {
        width: max-content !important;
        min-width: 100%;
    }

    .month-entry-table .month-amount-col,
    .month-entry-table td:nth-child(2) {
        width: 110px;
        min-width: 110px;
    }

    .month-entry-table .month-date-col,
    .month-entry-table td:nth-child(3) {
        width: 9.5rem;
        min-width: 9.5rem;
    }

    .month-entry-table .month-note-col,
    .month-entry-table td:nth-child(4) {
        width: 9rem;
        min-width: 9rem;
    }
}

#donationModal {
    z-index: 1100;
}

.member-picker { position: relative; }
.member-suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 2px 0 0; padding: 4px 0; list-style: none; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid #d5d9e6; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,0.15); }
.member-suggestions li { padding: 6px 10px; cursor: pointer; font-size: 0.92rem; }
.member-suggestions li small { display: block; color: #777; font-size: 0.78rem; }
.member-suggestions li.is-active,
.member-suggestions li:hover { background: #eef0fb; }
.member-suggestions li.is-selected { font-weight: 600; }
.member-suggestions li.member-suggestions-empty { color: #777; cursor: default; background: transparent; }
.donation-modal .member-picker input.is-locked {
    background: #f3f4f8;
    cursor: default;
}

.donation-modal .modal-header {
    margin-bottom: 1rem;
}

.donation-modal .modal-header h3 {
    font-size: 1.25rem;
}

.donation-modal .form-group {
    margin-bottom: 0.75rem;
}

.donation-modal .form-group label {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.donation-modal .form-group input,
.donation-modal .form-group select {
    padding: 8px 12px;
    font-size: 0.95rem;
}

.member-picker-field {
    position: relative;
}

.member-picker-field > input {
    width: 100%;
    box-sizing: border-box;
    padding-right: 32px;
}

.member-modal .member-picker-field > input,
.donation-modal .member-picker-field > input {
    padding-right: 32px;
}

.member-picker-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    border: none;
    border-radius: 50%;
    background: #eef0f6;
    color: #5b6178;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.member-picker-clear:hover {
    background: #e2e5f0;
}

.member-picker-clear[hidden] {
    display: none;
}

.donation-modal .form-row {
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.donation-modal #sms_message {
    font-family: 'Segoe UI', 'Nirmala UI', 'Kalpurush', Arial, sans-serif;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.donation-modal .btn-sm {
    min-width: 40px;
}

.sms-message-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sms-message-bar > label {
    margin-bottom: 0;
}

.sms-message-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.sms-message-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.donation-modal .send-sms-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

.donation-modal .send-sms-toggle input {
    width: auto;
    margin: 0;
    padding: 0;
}

#smsCharCount {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .donation-modal .sms-message-tools {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
    }

    .donation-modal .sms-message-actions {
        order: 1;
    }

    .donation-modal #smsCharCount {
        order: 2;
    }
}

/* View Member Modal Styles */
#memberDetails {
    max-height: 70vh;
    overflow-y: auto;
}

.member-details-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-details-export-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

.member-details-close-icon {
    display: none;
}

@media (max-width: 768px) {
    #viewMemberModal .modal-content {
        position: relative;
        width: calc(100% - 1rem);
        margin: 0.5rem auto;
        padding: 0.45rem 0.6rem 1rem;
    }

    #viewMemberModal .modal-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        column-gap: 0.5rem;
        row-gap: 0.35rem;
        margin-bottom: 0.75rem;
    }

    #viewMemberModal .modal-header h3 {
        grid-column: 1;
        grid-row: 1;
        margin: 0.1rem 0 0;
        font-size: 1.2rem;
    }

    #viewMemberModal .member-details-header-actions {
        display: contents;
    }

    #viewMemberModal .member-details-header-actions .close {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: start;
        margin: -0.15rem -0.15rem 0 0;
        padding: 0;
        line-height: 1;
        font-size: 1.85rem;
    }

    #viewMemberModal .member-details-export-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-end;
        gap: 0.4rem;
    }

    .member-details-header-actions .btn:not(.member-export-btn) {
        display: none;
    }

    .member-details-header-actions .member-export-btn {
        display: inline-flex;
        align-items: center;
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .member-details-actions {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: stretch;
        gap: 0.4rem;
    }

    .member-details-actions .btn {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        padding: 8px 6px;
        font-size: 0.75rem;
        line-height: 1.2;
        white-space: normal;
        text-align: center;
    }

    .member-details-actions .member-details-close {
        flex: 0 0 36px;
        width: 36px;
        min-width: 36px;
        padding: 0;
        font-size: 1.5rem;
        line-height: 1;
    }

    .member-details-close-label {
        display: none;
    }

    .member-details-close-icon {
        display: block;
    }
}

#memberDetails strong {
    font-weight: 600;
    color: #667eea;
}

#memberDetails span:not(.status-badge) {
    color: #333;
    word-break: break-word;
}

#memberDetails img {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.member-details-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.member-details-print-sheet {
    display: none;
    position: absolute;
    left: -12000px;
    top: 0;
    width: 190mm;
    background: #fff;
    color: #222;
    padding: 0 0 8px;
}

.member-print-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 2px;
}

.member-print-org { text-align: left; min-width: 0; }
.member-print-meta { margin-left: auto; text-align: right; flex: 0 0 auto; }
.member-print-head h1 { margin: 0; font-size: 16pt; color: #222; }
.member-print-head h2 { margin: 0; font-size: 13pt; color: #222; }
.member-print-head p { margin: 0; font-size: 9pt; color: #333; }
.member-print-meta p { white-space: nowrap; }

.member-details-print-sheet .member-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 12px;
}

.member-details-print-sheet .member-card-identity {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.member-details-print-sheet .member-card-photo {
    order: 2;
    margin-left: auto;
    flex: 0 0 auto;
}

.member-details-print-sheet .member-card-name,
.member-details-print-sheet .member-card-meta {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-top: 0;
}

.member-details-print-sheet .member-card-name {
    margin-right: 0.55rem;
}

.member-details-print-sheet .member-print-bn {
    display: inline;
    font-family: 'Nirmala UI', 'Kalpurush', 'Segoe UI', sans-serif;
    font-weight: 600;
}

.member-details-print-sheet .member-card-identity .member-print-info {
    width: 100%;
    margin-top: 4px;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 9pt;
}

.member-details-print-sheet .member-card-identity .member-print-info th,
.member-details-print-sheet .member-card-identity .member-print-info td {
    width: auto;
    font-size: 9pt;
    font-weight: 400;
    line-height: 1.35;
    padding: 1px 6px !important;
    text-align: left;
    vertical-align: top;
    white-space: normal;
}

.member-details-print-sheet .member-card-identity .member-print-info th {
    width: 1%;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    background: #eef0f6 !important;
}

.member-details-print-sheet .member-card-identity .member-print-info td {
    color: #222;
}

.member-details-print-sheet .member-card-identity .member-print-info a,
.member-details-print-sheet .member-card-identity .member-print-info span,
.member-details-print-sheet .member-card-identity .member-print-info .phone-primary-number {
    color: #222;
    font-size: 9pt;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
}

.member-details-print-sheet .member-print-contact {
    margin: 3px 0 0;
    color: #222;
    font-size: 9pt;
    font-weight: 400;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.member-details-print-sheet .member-print-contact a,
.member-details-print-sheet .member-print-contact span,
.member-details-print-sheet .member-print-contact .phone-primary-number {
    color: #222;
    font-size: 9pt;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
}

.member-details-print-sheet .member-print-contact .member-print-contact-label {
    font-weight: 700;
    color: #333;
    font-size: 9pt;
}

.member-details-print-sheet .member-card-identity .member-phones {
    display: inline;
}

.member-details-print-sheet .member-card-identity .member-phones a,
.member-details-print-sheet .member-card-identity .member-phones span {
    display: inline;
    white-space: normal;
}

.member-details-print-sheet .member-card-identity .member-phones a + a::before,
.member-details-print-sheet .member-card-identity .member-phones a + span::before,
.member-details-print-sheet .member-card-identity .member-phones span + a::before,
.member-details-print-sheet .member-card-identity .member-phones span + span::before {
    content: ", ";
}

.member-details-print-sheet .member-card {
    border: none;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 12px;
}

.member-details-print-sheet .member-print-columns {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.member-details-print-sheet .member-print-columns .member-print-info {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    table-layout: fixed;
}

.member-details-print-sheet .member-print-info th {
    width: 50%;
    text-align: left;
    vertical-align: top;
    background: #eef0f6 !important;
    color: #333;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.member-details-print-sheet .member-print-info td {
    width: 50%;
    text-align: left;
    vertical-align: top;
    color: #222;
    padding-left: 4px;
    padding-right: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.member-details-print-sheet .member-print-info .member-phones,
.member-details-print-sheet .member-print-info .member-phones a,
.member-details-print-sheet .member-print-info .member-phones span {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.member-details-print-sheet .member-print-address {
    width: 100%;
    margin-top: 0;
    table-layout: fixed;
}

.member-details-print-sheet .member-print-address th {
    width: 25%;
}

.member-details-print-sheet .member-print-address td {
    width: 75%;
}

.member-details-print-sheet .member-print-info td strong {
    color: #222;
    font-weight: 600;
}

.member-details-print-table {
    width: 100%;
    border-collapse: collapse;
}

.member-details-print-table > thead {
    display: table-header-group;
}

.member-details-print-table > tbody {
    display: table-row-group;
}

.member-details-print-table > thead > tr,
.member-details-print-table > tbody > tr {
    break-inside: avoid;
    page-break-inside: avoid;
}

.member-details-print-table > tbody > tr.member-print-flow {
    break-inside: auto;
    page-break-inside: auto;
}

.member-details-print-sheet .member-details-print-table > tbody > tr.member-print-flow > td.member-print-cell {
    padding-top: 10px !important;
}

.member-details-print-sheet .member-print-history thead {
    display: table-header-group;
}

.member-details-print-sheet .member-print-history tr {
    break-inside: avoid;
    page-break-inside: avoid;
}

.member-details-print-sheet .member-print-history-caption th {
    border: none !important;
    background: transparent !important;
    color: #667eea !important;
    font-size: 1em;
    font-weight: 700;
    text-align: left !important;
    padding: 0 0 4px !important;
}

.member-details-print-sheet .member-print-banner,
.member-details-print-sheet .member-print-cell {
    border: none !important;
    background: #fff !important;
    text-align: left !important;
    padding: 0 !important;
}

.member-details-print-sheet .member-print-banner {
    padding: 0 !important;
}

.member-details-print-sheet .member-print-info th,
.member-details-print-sheet .member-print-info td,
.member-details-print-sheet .member-print-line th,
.member-details-print-sheet .member-print-line td {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.member-details-print-sheet .member-print-line {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    table-layout: fixed;
}

.member-details-print-sheet .member-print-line th,
.member-details-print-sheet .member-print-line td,
.member-details-print-sheet .member-print-line .status-badge {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    vertical-align: top;
}

.member-details-print-sheet .member-print-line .status-badge {
    padding: 0 6px;
}

.member-details-print-sheet .member-card,
.member-details-print-sheet table {
    break-inside: auto;
}

.member-details-print-sheet table {
    width: 100%;
    border-collapse: collapse;
}

.member-details-print-sheet th,
.member-details-print-sheet td {
    border: 1px solid #ddd;
}

.member-details-print-sheet .status-badge,
.member-details-print-sheet .member-card {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

@media print {
    body.print-member-details .dashboard-container,
    body.print-member-details .modal,
    body.print-member-details .receipt-overlay,
    body.print-member-details .ledger-print-sheet {
        display: none !important;
    }

    body.print-member-details .member-details-print-sheet {
        display: block !important;
        position: static !important;
        left: auto !important;
        width: auto !important;
        z-index: auto !important;
        background: #fff !important;
    }

    body.print-member-details .member-details-print-table > thead,
    body.print-member-details .member-print-history thead {
        display: table-header-group !important;
    }
}

.member-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border: 1px solid #e6e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.06);
}

.member-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.member-card-photo {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e6e8f0;
}

#memberDetails .member-card-photo,
.member-details-print-sheet .member-card-photo {
    width: 96px;
    height: 96px;
}

.member-card-name {
    margin: 0;
    font-size: 1.05rem;
    color: #222;
}

.member-card-name-bn,
.member-bn-line {
    display: block;
    margin-top: 0.15rem;
    color: #222;
    font-family: 'Nirmala UI', 'Kalpurush', 'Segoe UI', sans-serif;
    font-weight: 600;
    line-height: 1.35;
}

.member-card-name-bn {
    margin: 0.15rem 0 0;
    font-size: 1rem;
}

.member-category-line {
    margin: 0.2rem 0 0;
    color: #444;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.member-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    margin-top: 0.25rem;
    color: #667;
    font-size: 0.8rem;
}

.member-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.45rem;
}

.member-card-grid > div {
    min-width: 0;
    padding: 0.4rem 0.55rem;
    background: #f7f8fc;
    border-radius: 8px;
}

.member-card-grid span {
    display: block;
    margin-bottom: 0.1rem;
    color: #667eea;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.member-card-grid strong {
    display: block;
    color: #222;
    font-size: 0.88rem;
    font-weight: 600;
    word-break: break-word;
}

.member-card-grid strong a,
.invited-members-list a {
    color: #3f51b5;
    font-weight: 600;
    text-decoration: none;
}

.member-card-grid strong a:hover,
.invited-members-list a:hover {
    text-decoration: underline;
}

.invited-members-list {
    margin: 0.2rem 0 0;
    padding-left: 1.25rem;
    color: #222;
    font-size: 0.88rem;
    font-weight: 600;
}

.invited-members-list li + li {
    margin-top: 0.15rem;
}

.member-card-wide {
    grid-column: 1 / -1;
}

.invite-panel {
    margin-top: 0.45rem;
    padding: 0.45rem 0.55rem;
    background: #f7f8fc;
    border-radius: 8px;
}

.invite-panel summary {
    cursor: pointer;
    color: #667eea;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.invite-panel-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.invite-panel-body > div {
    min-width: 0;
    padding: 0.4rem 0.55rem;
    background: #fff;
    border-radius: 8px;
}

.invite-panel-body span {
    display: block;
    margin-bottom: 0.1rem;
    color: #667eea;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.invite-panel-body strong {
    display: block;
    color: #222;
    font-size: 0.88rem;
    font-weight: 600;
    word-break: break-word;
}

@media (max-width: 768px) {
    .invite-panel-body {
        grid-template-columns: 1fr;
    }
}

#memberDetails .member-card-grid span,
#memberProfile .member-card-grid span {
    color: #667eea;
}

#memberDetails .member-card-grid strong,
#memberProfile .member-card-grid strong {
    color: #222;
}

#memberDetails .member-card-meta,
#memberProfile .member-card-meta {
    color: #667;
}

@media (max-width: 768px) {
    .member-card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    color: #667eea;
    font-size: 1.5rem;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    border: none;
    background: none;
}

.close:hover {
    color: #000;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: white;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.photo-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 10px;
    object-fit: cover;
}

/* Profile Styles */
.profile-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.profile-section {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.profile-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.profile-section .form-group {
    margin-bottom: 0.75rem;
}

.profile-section .form-group label {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.profile-section .form-group input {
    padding: 8px 12px;
    font-size: 0.95rem;
}

.profile-section small {
    font-size: 0.75rem;
}

.profile-section .form-row {
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.filters, .ledger-filters{
    background-color: #9df1d1;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-button-row > .btn,
    .year-controls .btn {
        padding: 4px 8px;
        font-size: 0.78rem;
        min-height: 28px;
        line-height: 1;
    }
    .year-select {
        font-size: 0.78rem;
    }
    .year-select select {
        min-height: 28px;
        padding: 4px 8px;
    }
    .year-nav {
        min-width: 28px;
        padding-left: 6px;
        padding-right: 6px;
    }
    .year-nav i {
        font-size: 0.75rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .page-header h2 {
        font-size: 1.4rem;
    }

    .members-page .page-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .member-profile-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .member-profile-header h2 {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 1.25rem;
    }

    .member-profile-header .lang-switch {
        margin-left: auto;
    }

    .members-page .page-header h2 {
        flex: 1 1 auto;
        font-size: 1.15rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .members-page .page-header > .btn {
        flex: 0 1 auto;
        min-width: 0;
        padding: 6px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .members-page .page-header .member-search {
        flex: 1 0 100%;
        width: 100%;
        max-width: none;
        min-width: 0;
        margin-left: 0;
    }

    .members-page .page-header > .member-tools-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 32px;
        height: 32px;
        min-width: 32px;
        padding: 0;
        font-size: 0;
    }

    .members-page .member-header-tools {
        display: none;
        flex: 1 0 100%;
        flex-direction: column;
        gap: 8px;
    }

    .members-page .member-header-tools.is-open {
        display: flex;
    }

    .members-page .member-header-tools .btn {
        width: 100%;
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .dashboard-nav .user-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .profile-container {
        padding: 1.5rem;
    }
}

@container (max-width: 480px) {
    .members-page .page-header > .member-add-btn .member-add-label {
        display: none;
    }

    .members-page .page-header > .member-add-btn .member-add-icon {
        display: block;
        line-height: 1;
    }

    .members-page .page-header > .member-add-btn {
        flex: 0 0 auto;
        width: 36px;
        height: 36px;
        padding: 0;
        font-size: 1.5rem;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .members-page .page-header > .member-tools-toggle {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
}

