:root {
    --brand-primary: #8d1f24;
    --brand-primary-dark: #6f171b;
    --brand-secondary: #f8efe7;
    --brand-accent: #cc8b1f;
    --text-dark: #1f2933;
    --muted: #5f6b77;
    --border-soft: #ecdcca;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Noto Sans Devanagari', 'Mangal', sans-serif;
    font-size: 16px;
    line-height: 1.55;
    background: linear-gradient(180deg, #fffdf9 0%, #f7f2eb 100%);
    color: var(--text-dark);
    min-height: 100vh;
}

.bg-brand {
    background: linear-gradient(135deg, var(--brand-primary), #5e1115);
}

.navbar-main .brand-text {
    font-size: 1.05rem;
    line-height: 1.35;
    white-space: normal;
    max-width: 70vw;
}

.navbar-main .nav-link {
    font-weight: 500;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.navbar-main .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-links-wrap {
    gap: 0.15rem;
}

.card {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.05);
}

.section-title {
    color: var(--brand-primary);
    font-weight: 700;
    line-height: 1.35;
}

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

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

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

.badge-soft {
    background: #fcebd8;
    color: #8b4a00;
}

.table-responsive {
    border: 1px solid #eedfce;
    border-radius: 12px;
}

.table {
    margin-bottom: 0;
    white-space: nowrap;
}

.table thead th {
    background-color: #fff0df;
    color: #5d2814;
    border-bottom: 1px solid #f0d8be;
    font-weight: 600;
}

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

.form-label {
    font-weight: 600;
    margin-bottom: 0.42rem;
}

.form-control,
.form-select {
    min-height: 42px;
    font-size: 0.98rem;
}

.required::after {
    content: ' *';
    color: #dc3545;
}

.dashboard-card {
    border-left: 5px solid var(--brand-accent);
}

.profile-card {
    border-left: 5px solid var(--brand-primary);
}

.profile-edit-btn {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    min-height: 34px;
    min-width: 34px;
    padding: 0.2rem 0.5rem;
    z-index: 2;
}

.profile-photo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-photo-circle {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f3dac0;
    background-color: #fff;
}

.member-photo-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f3dac0;
    background-color: #fff;
}

.member-photo-thumb {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ead8c5;
    background: #fff;
}

.admin-family-photo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ead8c5;
    background: #fff;
}

.profile-field {
    margin-bottom: 0.55rem;
}

.profile-field-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.12rem;
}

.profile-field-value {
    font-weight: 600;
    color: #3d1d11;
    line-height: 1.35;
    word-break: break-word;
}

.profile-section-block {
    border-top: 1px dashed #ead8c5;
    padding-top: 0.75rem;
    margin-top: 0.65rem;
}

.profile-section-block:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.profile-section-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #6f171b;
    margin-bottom: 0.5rem;
}

.small-muted {
    color: var(--muted);
    font-size: 0.92rem;
}

.auth-wrap {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    padding-inline: 0.2rem;
}

.page-heading-row,
.section-action-row,
.form-actions,
.action-group,
.export-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form-actions {
    margin-top: 1rem;
}

.action-group {
    gap: 0.4rem;
}

.site-footer {
    background-color: #fff8ef;
}

@media (max-width: 991.98px) {
    .navbar-main .navbar-collapse {
        margin-top: 0.6rem;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        padding-top: 0.55rem;
    }

    .navbar-main .nav-link {
        padding-inline: 0.2rem;
    }
}

@media (max-width: 767.98px) {
    main {
        padding-top: 0.9rem !important;
    }

    .display-6 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1rem;
    }

    .card-body {
        padding: 1rem !important;
    }

    .btn-mobile-full {
        width: 100%;
    }

    .page-heading-row,
    .section-action-row,
    .form-actions,
    .export-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .btn,
    .section-action-row .btn,
    .export-actions .btn,
    .action-group .btn {
        width: 100%;
    }

    .table-responsive .table {
        min-width: 760px;
    }

    .profile-photo-circle {
        width: 108px;
        height: 108px;
    }

    .member-photo-preview {
        width: 96px;
        height: 96px;
    }

    .profile-edit-btn {
        top: 0.65rem;
        right: 0.65rem;
    }
}

@media (min-width: 768px) {
    .auth-wrap {
        padding-inline: 0;
    }
}

@media (min-width: 1200px) {
    body {
        font-size: 16.5px;
    }
}
