@font-face {
    font-family: 'VazirmatnLocal';
    src: url('../fonts/Vazirmatn-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'VazirmatnLocal';
    src: url('../fonts/Vazirmatn-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'VazirmatnLocal';
    src: url('../fonts/Vazirmatn-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'VazirmatnLocal';
    src: url('../fonts/Vazirmatn-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'VazirmatnLocal';
    src: url('../fonts/Vazirmatn-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    --app-primary: #0f3f74;
    --app-primary-deep: #082443;
    --app-secondary: #0f766e;
    --app-accent: #c78a24;
    --app-ink: #10223a;
    --app-muted: #5c6b7f;
    --app-bg: #eff4f7;
    --app-surface: #ffffff;
    --app-border: #d8e0ea;
    --app-danger: #b42318;
    --app-success: #15803d;
    --app-radius: 20px;
    --app-shadow: 0 20px 52px rgba(8, 36, 67, 0.13);
    --app-shadow-soft: 0 10px 30px rgba(16, 34, 58, 0.08);
}

* {
    box-sizing: border-box;
}

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

body.app-body {
    margin: 0;
    min-height: 100vh;
    color: var(--app-ink);
    font-family: 'VazirmatnLocal', Tahoma, sans-serif;
    background:
        radial-gradient(circle at 10% 12%, rgba(15, 118, 110, 0.16), transparent 28%),
        radial-gradient(circle at 85% 10%, rgba(15, 63, 116, 0.16), transparent 34%),
        linear-gradient(145deg, #f4f8fb 0%, #eef3f8 52%, #f4f7fb 100%);
}

body.app-body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -3;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 74px,
            rgba(15, 63, 116, 0.028) 74px,
            rgba(15, 63, 116, 0.028) 76px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 74px,
            rgba(15, 118, 110, 0.02) 74px,
            rgba(15, 118, 110, 0.02) 76px
        );
    mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
}

.bg-ornament {
    position: fixed;
    pointer-events: none;
    z-index: -2;
    filter: blur(2px);
}

.bg-ornament-1 {
    top: -110px;
    left: -70px;
    width: 290px;
    height: 290px;
    border-radius: 70px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.2), rgba(15, 63, 116, 0.14));
    transform: rotate(16deg);
}

.bg-ornament-2 {
    right: -80px;
    bottom: -140px;
    width: 360px;
    height: 360px;
    border-radius: 90px;
    background: linear-gradient(160deg, rgba(199, 138, 36, 0.14), rgba(15, 118, 110, 0.12));
    transform: rotate(-14deg);
}

.bg-ornament-1::after,
.bg-ornament-2::after {
    content: '';
    position: absolute;
    inset: 14%;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.32);
}

a {
    color: inherit;
}

.app-navbar {
    position: relative;
    z-index: 1032;
    width: min(1320px, calc(100% - 1.25rem));
    margin: 0.8rem auto 0;
    padding: 0.38rem 0;
    overflow: visible;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background:
        linear-gradient(120deg, rgba(8, 36, 67, 0.96), rgba(15, 63, 116, 0.95) 52%, rgba(15, 118, 110, 0.94)),
        linear-gradient(45deg, rgba(255, 255, 255, 0.04), transparent 45%);
    box-shadow: 0 26px 60px rgba(8, 36, 67, 0.22);
}

.app-navbar::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 -130px;
    width: 250px;
    transform: skewX(-16deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    pointer-events: none;
}

.app-navbar .container-xxl,
.app-navbar .navbar-collapse,
.app-navbar .navbar-nav,
.app-navbar .nav-item {
    position: relative;
    z-index: 2;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: #fff;
    text-decoration: none;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 15px;
    font-size: 1.26rem;
    font-weight: 900;
    color: #fff;
    background:
        radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.3), transparent 35%),
        linear-gradient(145deg, rgba(199, 138, 36, 0.8), rgba(15, 118, 110, 0.7));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.brand-mark strong {
    display: block;
    font-size: 0.98rem;
    line-height: 1.25;
}

.brand-mark small {
    display: block;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.86);
}

.app-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.44);
    border-radius: 12px;
    padding: 0.35rem 0.56rem;
}

.app-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(199, 138, 36, 0.26);
}

.app-navbar .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.app-navbar .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    border-radius: 10px;
    padding: 0.48rem 0.78rem;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus,
.app-navbar .nav-link.show,
.app-navbar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.app-nav-toggle {
    border: 0;
    background: transparent;
    line-height: 1.2;
}

.app-nav-toggle::after {
    margin-right: 0.42rem;
    margin-left: 0;
}

.app-dropdown,
.app-navbar .dropdown-menu {
    margin-top: 0.4rem;
    padding: 0.4rem;
    border-radius: 16px;
    border: 1px solid var(--app-border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 40px rgba(8, 36, 67, 0.19);
    z-index: 2400;
}

.app-dropdown .dropdown-item {
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    margin: 0.1rem 0;
    font-size: 0.9rem;
    color: var(--app-ink);
}

.app-dropdown .dropdown-item:hover,
.app-dropdown .dropdown-item:focus {
    color: var(--app-primary-deep);
    background: rgba(15, 118, 110, 0.12);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    min-height: 33px;
    padding: 0 0.74rem;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.logout-form {
    margin: 0;
}

.app-btn-light {
    --bs-btn-color: #fff;
    --bs-btn-border-color: rgba(255, 255, 255, 0.62);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.85);
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.14);
}

.app-btn-solid {
    border-radius: 10px;
    font-weight: 700;
}

.app-main {
    margin-top: 1.25rem;
}

.btn {
    border-radius: 12px;
    font-weight: 700;
}

.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: #0b2f56;
    --bs-btn-hover-border-color: #0b2f56;
}

.btn-success {
    --bs-btn-bg: var(--app-secondary);
    --bs-btn-border-color: var(--app-secondary);
    --bs-btn-hover-bg: #0b5d56;
    --bs-btn-hover-border-color: #0b5d56;
}

.btn-outline-primary {
    --bs-btn-color: var(--app-primary);
    --bs-btn-border-color: rgba(15, 63, 116, 0.45);
    --bs-btn-hover-bg: var(--app-primary);
    --bs-btn-hover-border-color: var(--app-primary);
}

.btn-outline-secondary {
    --bs-btn-color: #3f5169;
    --bs-btn-border-color: #c5cfdb;
    --bs-btn-hover-bg: #54647a;
    --bs-btn-hover-border-color: #54647a;
}

.btn-danger {
    --bs-btn-bg: #be2530;
    --bs-btn-border-color: #be2530;
    --bs-btn-hover-bg: #a71924;
    --bs-btn-hover-border-color: #a71924;
}

.app-alert {
    border: 1px solid rgba(15, 63, 116, 0.1);
    border-radius: 14px;
    box-shadow: var(--app-shadow-soft);
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.page-head h1,
.page-head h2,
.page-head h3,
.page-head h4 {
    margin: 0;
    font-weight: 800;
    color: var(--app-primary-deep);
}

.page-head p {
    margin: 0.28rem 0 0;
    color: var(--app-muted);
    font-size: 0.9rem;
}

.card,
.panel-card {
    border: 1px solid rgba(216, 224, 234, 0.9);
    border-radius: 22px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 253, 0.97)),
        radial-gradient(circle at 100% 0%, rgba(15, 118, 110, 0.08), transparent 30%);
    box-shadow: var(--app-shadow-soft);
}

.card-header {
    background:
        linear-gradient(90deg, rgba(15, 63, 116, 0.11), rgba(15, 118, 110, 0.08)),
        #f7fafc;
    border-bottom: 1px solid var(--app-border);
    font-weight: 800;
    color: var(--app-primary-deep);
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    padding: 1.4rem;
    border-radius: 26px;
    border: 1px solid rgba(15, 63, 116, 0.12);
    background:
        linear-gradient(132deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 251, 0.94)),
        radial-gradient(circle at 13% 18%, rgba(15, 118, 110, 0.18), transparent 34%);
    box-shadow: var(--app-shadow);
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    bottom: -95px;
    left: -52px;
    width: 230px;
    height: 230px;
    border-radius: 64px;
    background: rgba(199, 138, 36, 0.16);
    transform: rotate(18deg);
}

.hero-copy,
.hero-side {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--app-secondary);
    margin-bottom: 0.52rem;
}

.eyebrow::before {
    content: '';
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: var(--app-accent);
}

.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.56rem;
    margin-top: 0.95rem;
}

.hero-metrics span {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.45rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 63, 116, 0.1);
    background: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
    color: #30465f;
}

.hero-metrics strong {
    color: var(--app-primary-deep);
}

.hero-side {
    min-width: 310px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.94rem;
}

.hero-graphic {
    position: relative;
    width: 230px;
    height: 120px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(15, 63, 116, 0.12);
    background:
        linear-gradient(180deg, rgba(15, 63, 116, 0.09), rgba(15, 118, 110, 0.11)),
        repeating-linear-gradient(90deg, rgba(15, 63, 116, 0.08) 0 1px, transparent 1px 16px);
}

.tower {
    position: absolute;
    bottom: 13px;
    width: 44px;
    border-radius: 10px 10px 5px 5px;
    background:
        repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0 7px, rgba(255, 255, 255, 0.24) 7px 12px),
        linear-gradient(180deg, var(--app-primary), var(--app-secondary));
    box-shadow: 0 12px 24px rgba(8, 36, 67, 0.2);
}

.tower-a {
    right: 34px;
    height: 72px;
}

.tower-b {
    right: 88px;
    height: 90px;
}

.tower-c {
    right: 142px;
    height: 57px;
}

.pulse-dot {
    position: absolute;
    left: 28px;
    top: 24px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--app-accent);
    box-shadow: 0 0 0 11px rgba(199, 138, 36, 0.16);
    animation: pulseDot 2.8s ease-in-out infinite;
}

@keyframes pulseDot {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.stat-card {
    border: 1px solid rgba(216, 224, 234, 0.9);
    border-radius: 18px;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 251, 0.95)),
        radial-gradient(circle at 0 100%, rgba(15, 118, 110, 0.1), transparent 40%);
    box-shadow: 0 10px 20px rgba(16, 34, 58, 0.06);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 34px rgba(16, 34, 58, 0.11);
}

.stat-label {
    color: var(--app-muted);
    font-size: 0.85rem;
}

.stat-value {
    color: var(--app-primary-deep);
    font-size: 1.42rem;
    font-weight: 800;
}

.fin-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(216, 224, 234, 0.92);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(16, 34, 58, 0.08);
}

.fin-card::after {
    content: '';
    position: absolute;
    inset: auto -18px -22px auto;
    width: 80px;
    height: 80px;
    border-radius: 24px;
    transform: rotate(22deg);
    background: rgba(15, 118, 110, 0.08);
}

.fin-card .title,
.fin-card .value {
    position: relative;
    z-index: 1;
}

.fin-card .title {
    margin-bottom: 0.4rem;
    font-size: 0.86rem;
    color: var(--app-muted);
}

.fin-card .value {
    margin: 0;
    font-size: 1.34rem;
    font-weight: 800;
}

.charge-status-strip {
    border: 1px solid rgba(216, 224, 234, 0.92);
    border-radius: 16px;
    background: #fff;
    padding: 0.9rem;
    box-shadow: 0 10px 22px rgba(16, 34, 58, 0.07);
}

.charge-status-strip span {
    display: block;
    color: var(--app-muted);
    font-size: 0.82rem;
}

.charge-status-strip strong {
    display: block;
    margin-top: 0.42rem;
    font-size: 1.3rem;
    color: var(--app-primary-deep);
}

.charge-status-strip.open {
    border-right: 6px solid #dc2626;
}

.charge-status-strip.partial {
    border-right: 6px solid #d97706;
}

.charge-status-strip.paid {
    border-right: 6px solid #15803d;
}

.charge-status-strip.overdue {
    border-right: 6px solid #9a3412;
}

.excel-like-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, #f0f6fb, #e6eff7);
    color: #0a2e55;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.excel-like-table td,
.excel-like-table th {
    min-width: 86px;
    text-align: center;
    vertical-align: middle;
}

.excel-like-table td:nth-child(3),
.excel-like-table td:nth-child(4) {
    min-width: 170px;
    text-align: right;
}

.excel-like-table tbody tr:nth-child(odd) {
    background: rgba(15, 63, 116, 0.03);
}

.excel-like-table tbody tr:hover {
    background: rgba(15, 118, 110, 0.08);
}

#chargeMonthTrendChart,
#chargeStatusPieChart,
#chargeBlockDebtChart,
#residentMonthlyReportChart {
    width: 100% !important;
    min-height: 290px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.section-title h4 {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 800;
    color: var(--app-primary-deep);
}

.org-section,
.ops-map {
    border: 1px solid rgba(216, 224, 234, 0.95);
    border-radius: 24px;
    padding: 1.15rem;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--app-shadow-soft);
    backdrop-filter: blur(5px);
}

.leader-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 1.2rem;
    color: #fff;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.22), transparent 28%),
        linear-gradient(135deg, var(--app-primary-deep), var(--app-primary) 56%, var(--app-secondary));
    box-shadow: var(--app-shadow);
}

.leader-card::after {
    content: '';
    position: absolute;
    left: -40px;
    bottom: -48px;
    width: 140px;
    height: 140px;
    border-radius: 38px;
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(24deg);
}

.leader-card h5,
.leader-card p,
.leader-card small,
.leader-card a,
.leader-badge {
    position: relative;
    z-index: 1;
}

.leader-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 98px;
    height: 53px;
    padding: 0 0.9rem;
    margin-bottom: 0.9rem;
    border-radius: 16px;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.2);
}

.leader-card h5 {
    margin-bottom: 0.34rem;
    font-weight: 900;
}

.leader-card p {
    margin-bottom: 0.65rem;
    color: rgba(255, 255, 255, 0.88);
}

.leader-card small {
    color: rgba(255, 255, 255, 0.8);
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.board-member-card,
.board-empty {
    border: 1px solid rgba(15, 63, 116, 0.12);
    border-radius: 18px;
    min-height: 112px;
    padding: 0.9rem;
    background:
        linear-gradient(145deg, #fff, #f7fafd),
        repeating-linear-gradient(135deg, rgba(15, 118, 110, 0.04) 0 1px, transparent 1px 11px);
}

.board-member-card span,
.board-member-card strong,
.board-member-card small {
    display: block;
}

.board-member-card span {
    font-size: 0.78rem;
    color: var(--app-secondary);
    font-weight: 700;
}

.board-member-card strong {
    margin-top: 0.45rem;
    color: var(--app-primary-deep);
}

.board-member-card small {
    margin-top: 0.48rem;
    color: var(--app-muted);
}

.board-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    color: var(--app-muted);
    grid-column: 1 / -1;
}

.board-empty a {
    color: var(--app-primary);
    font-weight: 800;
    text-decoration: none;
}

.command-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.95rem;
}

.command-card {
    position: relative;
    overflow: hidden;
    min-height: 156px;
    padding: 1rem;
    border: 1px solid rgba(216, 224, 234, 0.9);
    border-radius: 22px;
    text-decoration: none;
    color: var(--app-ink);
    background:
        linear-gradient(148deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 251, 0.96)),
        repeating-linear-gradient(45deg, rgba(15, 63, 116, 0.04) 0 1px, transparent 1px 12px);
    box-shadow: 0 10px 26px rgba(16, 34, 58, 0.07);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.command-card::before {
    content: '';
    position: absolute;
    left: -34px;
    bottom: -42px;
    width: 118px;
    height: 118px;
    border-radius: 30px;
    background: rgba(199, 138, 36, 0.14);
    transform: rotate(16deg);
}

.command-card strong,
.command-card small,
.command-icon {
    position: relative;
    z-index: 1;
}

.command-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--app-primary), var(--app-secondary));
    box-shadow: 0 12px 24px rgba(15, 63, 116, 0.18);
}

.command-card strong {
    display: block;
    margin-top: 0.7rem;
    font-size: 1rem;
}

.command-card small {
    display: block;
    margin-top: 0.32rem;
    line-height: 1.75;
    color: var(--app-muted);
}

.command-card:hover {
    color: var(--app-primary-deep);
    border-color: rgba(15, 118, 110, 0.34);
    box-shadow: var(--app-shadow);
    transform: translateY(-3px);
}

.ops-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.74rem;
}

.ops-card {
    position: relative;
    min-height: 140px;
    overflow: hidden;
    border-radius: 18px;
    padding: 0.9rem;
    color: #fff;
    background: linear-gradient(160deg, #113560, #0f766e);
    box-shadow: 0 16px 30px rgba(15, 118, 110, 0.16);
}

.ops-card::after {
    content: '';
    position: absolute;
    inset: auto -20px -24px auto;
    width: 74px;
    height: 74px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.16);
    transform: rotate(19deg);
}

.ops-card strong,
.ops-card span,
.ops-card small,
.ops-code {
    position: relative;
    z-index: 1;
    display: block;
}

.ops-code {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    margin-bottom: 0.68rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    background: rgba(255, 255, 255, 0.18);
}

.ops-card strong {
    font-size: 0.95rem;
    margin-bottom: 0.34rem;
}

.ops-card span {
    font-size: 0.82rem;
    margin-bottom: 0.2rem;
}

.ops-card small {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.82);
}

.resident-kpi {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(216, 224, 234, 0.92);
    padding: 0.95rem 1rem;
    background: #fff;
    box-shadow: 0 10px 24px rgba(16, 34, 58, 0.07);
}

.resident-kpi::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    border-radius: 0 12px 12px 0;
}

.resident-kpi.debt::before {
    background: #dc2626;
}

.resident-kpi.paid::before {
    background: #15803d;
}

.resident-kpi.due::before {
    background: #d97706;
}

.resident-kpi span {
    display: block;
    font-size: 0.84rem;
    color: var(--app-muted);
}

.resident-kpi strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.12rem;
    color: var(--app-primary-deep);
}

.unit-mini-card {
    border: 1px solid rgba(216, 224, 234, 0.9);
    border-radius: 16px;
    min-height: 108px;
    padding: 0.84rem;
    background: linear-gradient(140deg, #fff, #f4f8fb);
}

.unit-mini-card strong,
.unit-mini-card span,
.unit-mini-card small {
    display: block;
}

.unit-mini-card strong {
    color: var(--app-primary-deep);
    font-size: 0.95rem;
}

.unit-mini-card span {
    margin-top: 0.48rem;
    color: #3d516b;
    font-size: 0.83rem;
}

.unit-mini-card small {
    margin-top: 0.42rem;
    color: var(--app-muted);
}

.resident-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    border: 1px solid rgba(216, 224, 234, 0.92);
    background:
        radial-gradient(circle at 8% 12%, rgba(15, 118, 110, 0.12), transparent 30%),
        linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 251, 0.94));
    box-shadow: 0 12px 24px rgba(16, 34, 58, 0.07);
}

.resident-hero h3 {
    margin: 0 0 0.35rem;
    color: var(--app-primary-deep);
    font-weight: 900;
}

.resident-hero p {
    color: #3e516a;
}

.resident-pay-batch {
    border: 1px solid rgba(216, 224, 234, 0.9);
    border-radius: 16px;
    padding: 0.8rem;
    background: linear-gradient(145deg, #fff, #f7fbff);
}

.resident-pay-batch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 0.7rem;
}

.resident-pay-month {
    border: 1px solid rgba(216, 224, 234, 0.9);
    border-radius: 12px;
    padding: 0.66rem;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.resident-pay-month:hover {
    border-color: rgba(15, 118, 110, 0.44);
    box-shadow: 0 8px 16px rgba(16, 34, 58, 0.08);
}

.css-chart {
    display: grid;
    gap: 0.7rem;
}

.chart-row {
    display: grid;
    grid-template-columns: minmax(96px, 120px) 1fr minmax(90px, auto);
    align-items: center;
    gap: 0.7rem;
}

.chart-label {
    color: var(--app-primary-deep);
    font-size: 0.83rem;
    font-weight: 700;
}

.chart-track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: #e2ebf3;
    overflow: hidden;
}

.chart-bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--bar-width, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--app-primary), var(--app-secondary));
}

.chart-row strong {
    color: #1a3b63;
    font-size: 0.84rem;
    text-align: left;
}

.file-link {
    border-radius: 999px;
    font-size: 0.79rem;
}

.chat-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.24rem 0.58rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.chat-pill.new {
    color: #7b4c00;
    background: #ffedc2;
}

.chat-pill.read {
    color: #166534;
    background: #d4f5de;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table thead th {
    white-space: nowrap;
    border-bottom: 0;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--app-primary-deep);
    background:
        linear-gradient(90deg, rgba(15, 63, 116, 0.11), rgba(15, 118, 110, 0.08)),
        #edf4fb;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.9rem;
    border-color: #eaf0f7;
}

.table tbody tr:hover td {
    background: rgba(15, 63, 116, 0.035);
}

.actions-cell {
    white-space: nowrap;
}

.pagination .page-link {
    border-color: var(--app-border);
    color: var(--app-primary);
    border-radius: 10px;
    margin: 0 0.16rem;
}

.pagination .page-item.active .page-link,
.pagination .page-link:hover {
    color: #fff;
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.pagination .page-item.disabled .page-link {
    color: #8b9bb0;
}

.app-input,
.form-control,
.form-select,
textarea.form-control {
    border-color: var(--app-border);
    border-radius: 12px;
    min-height: 44px;
}

textarea.form-control {
    min-height: 108px;
}

.app-input:focus,
.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: rgba(15, 63, 116, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(15, 63, 116, 0.14);
}

.form-check-input {
    float: right;
    margin-right: 0;
    margin-left: 0.5rem;
}

.form-label {
    margin-bottom: 0.36rem;
    font-weight: 700;
    color: #173d69;
}

.form-field {
    margin-bottom: 0.94rem;
}

.form-help {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--app-muted);
}

.jalali-datepicker,
.jalali-datetimepicker {
    direction: ltr;
    text-align: center;
    cursor: pointer;
    background:
        linear-gradient(90deg, rgba(15, 118, 110, 0.07), transparent 35%),
        #fff;
}

.jalali-picker {
    position: absolute;
    z-index: 4000;
    min-width: 320px;
    padding: 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(216, 224, 234, 0.95);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 251, 253, 0.98)),
        radial-gradient(circle at 0 0, rgba(15, 118, 110, 0.13), transparent 34%);
    box-shadow: 0 24px 56px rgba(8, 36, 67, 0.2);
    direction: rtl;
    font-family: 'VazirmatnLocal', Tahoma, sans-serif;
}

.jalali-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.76rem;
    border-radius: 14px;
    padding: 0.42rem;
    color: #fff;
    background: linear-gradient(135deg, var(--app-primary-deep), var(--app-primary), var(--app-secondary));
}

.jalali-picker-header strong {
    font-weight: 800;
}

.jalali-nav-btn,
.jalali-day,
.jalali-save-btn,
.jalali-today-btn {
    border: 0;
    font-family: inherit;
}

.jalali-nav-btn {
    width: 33px;
    height: 33px;
    border-radius: 11px;
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.2);
}

.jalali-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.34rem;
}

.jalali-weekday,
.jalali-empty,
.jalali-day {
    min-height: 37px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.jalali-weekday {
    color: var(--app-secondary);
    font-size: 0.77rem;
    font-weight: 800;
}

.jalali-day {
    background: #f0f5fa;
    color: var(--app-ink);
    font-weight: 700;
    transition: transform 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.jalali-day:hover {
    transform: translateY(-1px);
    color: #fff;
    background: var(--app-secondary);
}

.jalali-day.is-selected {
    color: #fff;
    background: linear-gradient(135deg, var(--app-primary), var(--app-secondary));
    box-shadow: 0 8px 16px rgba(15, 118, 110, 0.2);
}

.jalali-time-row {
    margin-top: 0.78rem;
    display: grid;
    align-items: center;
    gap: 0.45rem;
    grid-template-columns: 62px auto 62px 1fr;
}

.jalali-time-row input {
    min-height: 36px;
    border-radius: 10px;
    border: 1px solid var(--app-border);
    text-align: center;
}

.jalali-save-btn,
.jalali-today-btn {
    min-height: 36px;
    border-radius: 10px;
    color: #fff;
    font-weight: 800;
}

.jalali-save-btn {
    background: var(--app-primary);
}

.jalali-picker-footer {
    margin-top: 0.72rem;
    display: flex;
    justify-content: flex-end;
}

.jalali-today-btn {
    background: var(--app-accent);
    padding: 0 0.9rem;
}

.login-card {
    position: relative;
    overflow: hidden;
    max-width: 520px;
    margin: 4rem auto;
    padding: 1.5rem;
    border-radius: 26px;
    border: 1px solid rgba(216, 224, 234, 0.94);
    background:
        radial-gradient(circle at 12% 12%, rgba(15, 118, 110, 0.12), transparent 30%),
        linear-gradient(180deg, #fff, #f8fbff);
    box-shadow: 0 28px 70px rgba(8, 36, 67, 0.16);
}

.login-card::after {
    content: '';
    position: absolute;
    left: -58px;
    bottom: -68px;
    width: 172px;
    height: 172px;
    border-radius: 50px;
    transform: rotate(24deg);
    background: linear-gradient(135deg, rgba(199, 138, 36, 0.28), rgba(15, 118, 110, 0.08));
}

.login-card > * {
    position: relative;
    z-index: 1;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--app-secondary);
    background: rgba(15, 118, 110, 0.12);
}

.payment-gateway-card .card-header {
    font-size: 0.95rem;
}

.gateway-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.66rem;
}

.gateway-meta-grid > div {
    border: 1px solid rgba(216, 224, 234, 0.88);
    border-radius: 12px;
    padding: 0.58rem 0.7rem;
    background: rgba(246, 250, 254, 0.88);
    font-size: 0.88rem;
}

@media (max-width: 1200px) {
    .hero-side {
        min-width: 100%;
        align-items: stretch;
    }

    .hero-graphic {
        width: 100%;
    }

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

@media (max-width: 992px) {
    .app-navbar {
        width: calc(100% - 1rem);
        margin: 0.54rem auto 0;
        border-radius: 18px;
    }

    .app-navbar .navbar-collapse {
        margin-top: 0.65rem;
        padding: 0.65rem;
        border-radius: 14px;
        background: rgba(7, 28, 53, 0.36);
        backdrop-filter: blur(3px);
    }

    .app-navbar .navbar-nav {
        gap: 0.2rem;
    }

    .app-navbar .nav-link,
    .app-navbar .dropdown-item {
        justify-content: flex-start;
        width: 100%;
    }

    .app-navbar .dropdown-menu {
        position: static;
        transform: none;
        margin-top: 0.28rem;
        box-shadow: none;
        border: 1px solid rgba(216, 224, 234, 0.7);
    }

    .brand-mark {
        max-width: calc(100% - 60px);
    }

    .brand-mark small {
        display: none;
    }

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

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

    .board-grid {
        grid-template-columns: 1fr;
    }

    .chart-row {
        grid-template-columns: minmax(88px, 110px) 1fr;
    }

    .chart-row strong {
        grid-column: 1 / -1;
        text-align: right;
    }
}

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

    .hero-metrics span,
    .page-head .btn,
    .page-head .d-flex {
        width: 100%;
    }

    .table {
        min-width: 660px;
    }

    .gateway-meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    body.app-body {
        background:
            radial-gradient(circle at 20% 10%, rgba(15, 118, 110, 0.13), transparent 36%),
            linear-gradient(150deg, #f7fafd, #eef3f8);
    }

    .bg-ornament-1,
    .bg-ornament-2 {
        display: none;
    }

    .app-main {
        margin-top: 0.85rem;
    }

    .dashboard-hero,
    .org-section,
    .ops-map,
    .card,
    .panel-card,
    .login-card {
        border-radius: 18px;
    }

    .dashboard-hero,
    .org-section,
    .ops-map {
        padding: 0.96rem;
    }

    .command-grid,
    .ops-grid {
        grid-template-columns: 1fr;
    }

    .hero-graphic {
        height: 94px;
    }

    .tower-a {
        right: 30px;
        height: 54px;
    }

    .tower-b {
        right: 79px;
        height: 70px;
    }

    .tower-c {
        right: 128px;
        height: 48px;
    }

    .section-title {
        flex-direction: column;
        align-items: stretch;
    }

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