:root {
    --brand-primary: #34495e;
    --brand-red: #c0392b;
    --brand-gold: #f1c40f;
    --brand-green: #27ae60;
    --brand-brown: #8b4513;
    --brand-blue: #2980b9;
    --surface: #ffffff;
    --muted: #6c757d;
    --page-bg: #eef1f5;
}

html { height: 100%; }

html[lang="bn"] body {
    font-family: "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
    min-height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: radial-gradient(900px circle at 10% 5%, rgba(52, 73, 94, 0.12), transparent 55%),
                radial-gradient(800px circle at 90% 90%, rgba(241, 196, 15, 0.14), transparent 50%),
                var(--page-bg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body > form#form1 {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body > form#form1 > main { flex: 1 0 auto; }
body > form#form1 > footer { flex-shrink: 0; }

.site-navbar {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #2c3e50 100%) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.site-navbar-logo-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.site-navbar-logo {
    max-width: 36px;
    max-height: 36px;
    object-fit: contain;
}

.site-navbar-brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
}

.site-footer {
    background: var(--brand-primary);
    color: rgba(255, 255, 255, 0.9);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.hero-panel {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-blue) 55%, var(--brand-green) 100%);
    color: #fff;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 12px 40px rgba(52, 73, 94, 0.25);
}

.hero-panel .btn-light {
    font-weight: 600;
}

.feature-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}

.feature-icon.red { background: var(--brand-red); }
.feature-icon.gold { background: var(--brand-gold); color: #333; }
.feature-icon.green { background: var(--brand-green); }
.feature-icon.blue { background: var(--brand-blue); }
.feature-icon.brown { background: var(--brand-brown); }

.auth-login-shell {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.auth-login-card { border-radius: 1rem; overflow: hidden; }

.auth-login-card .card-header {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-blue)) !important;
    border: 0;
}

.auth-login-logo { max-height: 80px; }

.app-form-card {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.app-form-section {
    border-left: 4px solid var(--brand-gold);
    padding-left: 1rem;
    margin: 1.5rem 0 1rem;
}

.app-form-section h5 {
    margin: 0;
    font-weight: 700;
    color: var(--brand-primary);
}

.photo-upload-box {
    border: 2px dashed #ced4da;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    background: #fafbfc;
}

/* Status column badges (lists & detail) */
.badge.status-badge-pending,
.status-badge-pending { background-color: #ffc107; color: #212529; }
.badge.status-badge-approved,
.badge.status-badge-active,
.badge.status-badge-paid,
.badge.status-badge-new,
.status-badge-approved,
.status-badge-active,
.status-badge-paid,
.status-badge-new { background-color: var(--brand-green); color: #fff; }
.badge.status-badge-rejected,
.badge.status-badge-unpaid,
.status-badge-rejected,
.status-badge-unpaid { background-color: var(--brand-red); color: #fff; }
.badge.status-badge-partial,
.status-badge-partial { background-color: #fd7e14; color: #fff; }
.badge.status-badge-suspended,
.status-badge-suspended { background-color: #6f42c1; color: #fff; }
.badge.status-badge-inactive,
.badge.status-badge-read,
.badge.status-badge-default,
.status-badge-inactive,
.status-badge-read,
.status-badge-default { background-color: #6c757d; color: #fff; }
.badge.status-badge-payable,
.status-badge-payable { background-color: #0dcaf0; color: #212529; }

/* Collapsible list filters */
.ato-filter-toggle {
    min-width: 2.25rem;
}
.ato-filter-toggle.active,
.ato-filter-toggle[aria-expanded="true"] {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}
.ato-filter-panel.collapsing {
    transition: height 0.3s ease;
}
.ato-filter-panel:not(.show) {
    margin-bottom: 0 !important;
}
.ato-filter-panel .card {
    border-top: 3px solid var(--brand-primary);
}

/* List tables → row cards on mobile */
@media (max-width: 767.98px) {
    .ato-list-table-wrap {
        overflow-x: visible;
        position: relative;
    }

    .card-body.p-0 > .ato-list-table-wrap {
        padding: 0.75rem;
    }

    .ato-list-table-wrap .ato-responsive-table {
        width: 100%;
        border: 0;
        margin-bottom: 0;
        border-collapse: separate;
        border-spacing: 0;
    }

    /* Header row inside tbody (GridView) or leftover thead */
    .ato-list-table-wrap.ato-mobile-list .ato-responsive-table tr.ato-mobile-header-row {
        display: none !important;
    }

    .ato-list-table-wrap .ato-responsive-table > tbody {
        display: block;
        width: 100%;
    }

    .ato-list-table-wrap .ato-responsive-table > tfoot {
        display: block;
        width: 100%;
    }

    .ato-list-table-wrap .ato-responsive-table > tbody > tr {
        display: block;
        width: 100%;
        margin-bottom: 0.75rem;
        padding: 0.85rem 1rem;
        background: var(--surface);
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 0.65rem;
        box-shadow: 0 2px 8px rgba(52, 73, 94, 0.08);
    }

    .ato-list-table-wrap .ato-responsive-table.table-striped > tbody > tr:nth-of-type(odd) {
        background: var(--surface);
    }

    .ato-list-table-wrap .ato-responsive-table > tbody > tr:last-child {
        margin-bottom: 0;
    }

    .ato-list-table-wrap .ato-responsive-table > tbody > tr > td {
        display: block;
        width: 100% !important;
        max-width: 100%;
        padding: 0.45rem 0;
        border: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        text-align: left !important;
        word-break: break-word;
    }

    .ato-list-table-wrap .ato-responsive-table > tbody > tr > td:last-child {
        border-bottom: 0;
    }

    .ato-list-table-wrap .ato-responsive-table .ato-mobile-label {
        display: block;
        font-weight: 600;
        font-size: 0.72rem;
        line-height: 1.3;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--muted);
        margin-bottom: 0.2rem;
    }

    .ato-list-table-wrap .ato-responsive-table > tbody > tr > td.ato-mobile-pager,
    .ato-list-table-wrap .ato-responsive-table > tbody > tr > td[colspan] {
        text-align: center !important;
        padding: 0.75rem 0 0.25rem;
        border-bottom: 0;
    }

    .ato-list-table-wrap .ato-responsive-table > tbody > tr > td.ato-mobile-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-top: 0.35rem;
        padding-top: 0.65rem;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        border-bottom: 0;
        text-align: left !important;
    }

    .ato-list-table-wrap .ato-responsive-table > tbody > tr > td.ato-mobile-actions .btn,
    .ato-list-table-wrap .ato-responsive-table > tbody > tr > td.ato-mobile-actions a.btn {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        text-align: center;
    }
}

.admin-dash-stat-link .card {
    border-radius: 1rem;
    transition: transform 0.15s ease;
}

.admin-dash-stat-link:hover .card {
    transform: translateY(-2px);
}

.breadcrumb-bar {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.detail-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.15rem;
}

.detail-value {
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.detail-photo {
    max-width: 140px;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.about-body {
    line-height: 1.7;
    color: #333;
}

.somiti-profile-logo {
    max-height: 96px;
    max-width: 160px;
    object-fit: contain;
}

.somiti-profile-hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 55%);
}

.contact-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.1);
    font-size: 1.25rem;
}

.contact-card .text-success + .contact-card-icon,
.contact-card-icon.text-success {
    background: rgba(25, 135, 84, 0.1);
}

.contact-card-icon.text-danger {
    background: rgba(220, 53, 69, 0.1);
}

.contact-card-value {
    color: #333;
    line-height: 1.6;
}

.global-toast-container {
    z-index: 1080;
    max-width: min(420px, calc(100vw - 1.5rem));
}

.global-toast-container .toast {
    min-width: 280px;
}

/* Flatpickr — align with Bootstrap form controls */
.flatpickr-input.form-control,
input.form-control.ato-date,
input.form-control.ato-datetime {
    background-color: #fff;
}

.flatpickr-calendar {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.12);
    border-radius: 0.5rem;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--primary, #0d6efd);
    border-color: var(--primary, #0d6efd);
}

/* bootstrap-multiselect filters on admin list pages */
.ato-filter-panel .multiselect-native-select,
.ato-filter-panel .multiselect-native-select .btn-group {
    width: 100%;
    display: block;
}

.ato-filter-panel .multiselect.form-select {
    width: 100%;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ato-filter-panel .multiselect-container {
    width: 100%;
    max-width: 100%;
}

.ato-filter-panel .multiselect-container .multiselect-filter {
    padding: 0.35rem 0.5rem;
}

.ato-filter-panel .multiselect-container .multiselect-filter .form-control {
    font-size: 0.875rem;
}
