:root {
    --app-blue: #0068c9;
    --app-blue-dark: #0055a8;
    --app-bg: #eef2f6;
    --app-border: #d9e1ea;
    --app-text: #263445;
    --app-muted: #6d7b8c;
}

body {
    background: var(--app-bg);
    color: var(--app-text);
    font-size: 14px;
    overflow-x: hidden;
}

table,
table th,
table td {
    white-space: nowrap !important;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

/* Clear visual separation between the member and administrator panels. */
.theme-member { --app-blue: #087d67; --app-blue-dark: #056653; --app-bg: #eff8f5; --app-border: #cfe5dd; }
.theme-admin { --app-blue: #2e3f9d; --app-blue-dark: #222f79; --app-bg: #f2f3fb; --app-border: #d9ddf3; }
.theme-member .brand-mark { background: #087d67; }.theme-member .avatar { background: linear-gradient(135deg, #079b76, #36bf9f); }.theme-member .side-nav a:hover, .theme-member .side-nav a.active, .theme-member .side-nav-group summary:hover, .theme-member .side-nav-group summary.active { background: #e2f6ef; color: #056653; }
.theme-admin .brand-mark { background: #2e3f9d; }.theme-admin .avatar { background: linear-gradient(135deg, #384cc0, #7652c7); }.theme-admin .side-nav a:hover, .theme-admin .side-nav a.active, .theme-admin .side-nav-group summary:hover, .theme-admin .side-nav-group summary.active { background: #ebedff; color: #2e3f9d; }
.login-theme-member .topbar { background: linear-gradient(115deg, #087d67, #0b9b76); box-shadow: 0 4px 16px rgba(5, 102, 83, .2); }
.login-theme-admin .topbar { background: linear-gradient(115deg, #2e3f9d, #623d9c); box-shadow: 0 4px 16px rgba(46, 63, 157, .22); }

.dashboard-hero { min-height: 144px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px; overflow: hidden; position: relative; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #087d67, #114d5a); box-shadow: 0 12px 26px rgba(5, 102, 83, .2); }
.dashboard-hero::after { content: ''; position: absolute; width: 190px; height: 190px; right: -55px; top: -70px; border: 28px solid rgba(255,255,255,.11); border-radius: 50%; }.admin-dashboard .dashboard-hero { background: linear-gradient(135deg, #2e3f9d, #623d9c); box-shadow: 0 12px 26px rgba(46, 63, 157, .2); }.dashboard-hero > * { position: relative; z-index: 1; }.dashboard-eyebrow { margin-bottom: 5px; font-size: 10px; font-weight: 800; letter-spacing: .12em; color: rgba(255,255,255,.76); }.dashboard-hero p { color: rgba(255,255,255,.84); }
.dashboard-stats .stat-card { height: 100%; min-height: 88px; padding: 12px !important; border: 0; border-radius: 14px; box-shadow: 0 5px 15px rgba(24, 50, 77, .07); transition: transform .16s ease, box-shadow .16s ease; }.dashboard-stats .stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(24, 50, 77, .12); }.member-dashboard .dashboard-stats .stat-card { border-top: 3px solid #38ae92; }.admin-dashboard .dashboard-stats .stat-card { border-top: 3px solid #6978d6; }.dashboard-stats .text-secondary { font-size: 12px; line-height: 1.3; }.dashboard-stats .display-6 { color: #18344b; font-size: 1.8rem; line-height: 1.1; }.dashboard-total { background: linear-gradient(135deg, #e3f8ef, #f9fffc) !important; }.dashboard-referral-card { border: 0; border-radius: 15px; box-shadow: 0 5px 15px rgba(24, 50, 77, .06); }
.member-dashboard-group { scroll-margin-top: 16px; }.member-dashboard-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--app-border); }.member-dashboard-group-heading .btn { flex: 0 0 auto; }.member-help-actions { display: flex; flex-wrap: wrap; gap: 8px; }.member-dashboard-group .stat-card { min-width: 0; overflow-wrap: anywhere; }
.member-dashboard .dashboard-stats .stat-card::after { content: "View  →"; display: block; margin-top: 5px; color: #087d67; font-size: 11px; font-weight: 700; line-height: 1.2; text-align: right; }
.member-dashboard .dashboard-stats .stat-card:hover::after { color: #056653; text-decoration: underline; }

.app-shell {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: 238px;
    flex: 0 0 238px;
    background: #fff;
    border-right: 1px solid var(--app-border);
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    z-index: 1040;
    overflow-y: auto;
}

.sidebar-backdrop {
    display: none;
}

.brand {
    height: 54px;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 0 18px;
    color: #0f2f4f;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid var(--app-border);
}

.brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.brand span {
    line-height: 1.2;
}

.brand-mark {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--app-blue);
    color: #fff;
    font-size: 12px;
}

.profile-mini {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--app-border);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #0b74d1, #24a0ed);
    font-weight: 700;
}

.profile-name {
    font-weight: 700;
    font-size: 13px;
}

.profile-sub,
.topbar-sub {
    color: var(--app-muted);
    font-size: 11px;
}

.side-nav {
    padding: 10px;
}

.side-nav a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    color: #344054;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 2px;
}

.side-nav a:hover,
.side-nav a.active {
    background: #e9f3ff;
    color: var(--app-blue);
    font-weight: 600;
}

.side-nav-group {
    margin-bottom: 2px;
}

.side-nav-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 6px;
    color: #344054;
    cursor: pointer;
    font-size: 13px;
    list-style: none;
}

.side-nav-group summary::-webkit-details-marker {
    display: none;
}

.side-nav-group summary:hover,
.side-nav-group summary.active {
    background: #e9f3ff;
    color: var(--app-blue);
    font-weight: 600;
}

.side-nav-chevron {
    transition: transform 160ms ease;
}

.side-nav-group[open] .side-nav-chevron {
    transform: rotate(180deg);
}

.side-nav-children {
    margin: 2px 0 4px 12px;
    padding-left: 8px;
    border-left: 1px solid var(--app-border);
}

.side-nav-children a {
    font-size: 12px;
    padding: 7px 9px;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    min-height: 54px;
    background: var(--app-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 18px;
    box-shadow: 0 2px 8px rgba(0, 74, 150, 0.18);
}

.sidebar-toggle {
    display: none;
    width: 38px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}

.sidebar-toggle span {
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 99px;
    display: block;
}

.topbar-heading {
    min-width: 0;
}

.topbar-title {
    font-weight: 700;
}

.topbar .topbar-sub {
    color: rgba(255, 255, 255, 0.76);
}

.content-wrap {
    width: min(100%, 1180px);
    padding: 18px;
    flex: 1;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    padding: 12px 18px;
    color: #4b5563;
    font-size: 11px;
}

.mobile-bottom-nav { display: none; }

.stat-card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.app-card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.badge-soft {
    background: #e9f3ff;
    color: var(--app-blue-dark);
}

.btn-primary {
    --bs-btn-bg: var(--app-blue);
    --bs-btn-border-color: var(--app-blue);
    --bs-btn-hover-bg: var(--app-blue-dark);
    --bs-btn-hover-border-color: var(--app-blue-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--app-blue);
    --bs-btn-border-color: var(--app-blue);
    --bs-btn-hover-bg: var(--app-blue);
    --bs-btn-hover-border-color: var(--app-blue);
}

.btn:disabled,
.btn.disabled,
button:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    box-shadow: none;
}

.btn-success:disabled,
.btn-success.disabled {
    background-color: #8fc0b3;
    border-color: #8fc0b3;
    color: rgba(255, 255, 255, 0.96);
}

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

.table thead th {
    color: #344054;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
}

.auth-shell {
    width: min(100% - 24px, 480px);
    max-width: 480px;
}

.auth-shell .app-card {
    overflow: hidden;
    border: 1px solid rgba(20, 47, 78, .08);
    border-radius: 20px;
    box-shadow: 0 18px 46px rgba(20, 47, 78, .12);
}

.auth-shell--member .app-card {
    border-top: 4px solid #12a783;
}

.auth-shell--admin .app-card {
    border-top: 4px solid #5265d9;
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin: -16px -16px 22px;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #e9f8f4 0%, #edf5ff 52%, #f9f1ff 100%);
}

.auth-brand img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    border-radius: 0;
    object-fit: cover;
    object-position: center;
}

.auth-shell--member .auth-brand {
    background: linear-gradient(135deg, #dff8ed 0%, #e9fbf8 52%, #eff7ff 100%);
}

.auth-shell--admin .auth-brand {
    background: linear-gradient(135deg, #e8eaff 0%, #f1edff 52%, #edf4ff 100%);
}

.auth-shell--member h1 {
    color: #087d67;
}

.auth-shell--admin h1 {
    color: #2e3f9d;
}

.auth-shell--member .form-control:focus {
    border-color: #12a783;
    box-shadow: 0 0 0 .2rem rgba(18, 167, 131, .16);
}

.auth-shell--member form button[type="submit"] {
    color: #fff;
    background: #087d67;
    border-color: #087d67;
}

.auth-shell--member form button[type="submit"]:hover {
    background: #056653;
    border-color: #056653;
}

.auth-shell--admin .form-control:focus {
    border-color: #5265d9;
    box-shadow: 0 0 0 .2rem rgba(82, 101, 217, .16);
}

.auth-shell--admin form button[type="submit"] {
    color: #fff;
    background: #2e3f9d;
    border-color: #2e3f9d;
}

.auth-shell--admin form button[type="submit"]:hover {
    background: #222f79;
    border-color: #222f79;
}

.auth-shell--member .app-install .btn {
    color: #087d67;
    border-color: #9bd9c8;
}

.auth-shell--member .app-install .btn:hover {
    color: #fff;
    background: #087d67;
    border-color: #087d67;
}

.auth-shell--admin .app-install .btn {
    color: #2e3f9d;
    border-color: #b9c1f4;
}

.auth-shell--admin .app-install .btn:hover {
    color: #fff;
    background: #2e3f9d;
    border-color: #2e3f9d;
}

.auth-shell h1 {
    text-align: center;
}

.app-install {
    display: grid;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--app-border);
}

.app-install small {
    line-height: 1.4;
    text-align: center;
}

.help-slip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; margin-top: 16px; }
.help-slip { --slip-accent: #1976d2; --slip-tint: #eef6ff; overflow: hidden; border: 1px solid #dbe5f0; border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(21, 48, 81, .08); }
.help-slip--direct { --slip-accent: #0877d1; --slip-tint: #eaf5ff; }.help-slip--level, .help-slip--upgrade { --slip-accent: #7439c7; --slip-tint: #f4edff; }.help-slip--auto_pool, .help-slip--other { --slip-accent: #098b62; --slip-tint: #e8faf3; }.help-slip--rejected, .help-slip--expired { --slip-accent: #c44343; --slip-tint: #fff0f0; }
.help-slip-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 16px 12px; color: #fff; background: linear-gradient(135deg, var(--slip-accent), #172d4d); }.help-slip-kicker, .help-party-label { font-size: 10px; font-weight: 800; letter-spacing: .1em; }.help-slip-kicker { opacity: .82; }.help-slip-number { font-size: 22px; font-weight: 800; line-height: 1.1; }.help-status { padding: 5px 9px; border-radius: 999px; color: #17324f; background: #fff; font-size: 11px; font-weight: 800; }.help-status--accepted { color: #08724f; background: #d7f7e8; }.help-status--rejected, .help-status--expired { color: #a72c2c; background: #ffe0e0; }
.help-slip-type { display: inline-block; margin: 14px 16px 3px; padding: 4px 8px; border-radius: 999px; color: var(--slip-accent); background: var(--slip-tint); font-size: 11px; font-weight: 800; }.help-slip-purpose { margin: 3px 16px 5px; color: #66758a; font-size: 11px; }.help-slip-amount { padding: 0 16px 14px; color: #152b45; font-size: 28px; line-height: 1; font-weight: 800; }.help-party { margin: 0 16px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; display: grid; gap: 2px; }.help-party--receiver { background: var(--slip-tint); }.help-party strong { font-size: 14px; }.help-party > span:not(.help-party-label) { color: #617184; font-size: 12px; }.help-party a { color: inherit; text-decoration: none; }.help-flow-arrow { width: 24px; height: 24px; margin: -1px auto; position: relative; z-index: 1; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--slip-accent); font-weight: 800; }.help-upi-pay { display: grid; gap: 2px; margin: 10px 16px 0; padding: 10px 12px; border: 1px solid #a9daca; border-radius: 10px; color: #056445; background: #ebfbf4; text-decoration: none; }.help-upi-pay span { font-size: 11px; }.help-upi-pay strong { font-size: 12px; }
.help-slip-level { display: grid; gap: 3px; width: fit-content; max-width: calc(100% - 32px); margin: 3px 16px 8px; padding: 7px 10px; border-radius: 7px; color: #592da0; background: #f4edff; font-size: 12px; }.help-slip-level strong { font-weight: 800; }
.help-slip-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 16px; }.help-slip-meta div { min-width: 0; display: grid; gap: 3px; }.help-slip-meta span { color: #738195; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }.help-slip-meta strong { color: #34485e; font-size: 11px; line-height: 1.3; }.help-slip-action { padding: 0 16px 16px; display: grid; gap: 8px; }.help-pending-note { margin: 0 16px 16px; padding: 9px 10px; border-radius: 8px; color: #8a5600; background: #fff5d8; font-size: 11px; line-height: 1.4; }.help-empty-state { min-height: 210px; display: grid; place-content: center; justify-items: center; gap: 7px; color: #6d7b8c; text-align: center; }.help-empty-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #0877d1; background: #eaf5ff; font-size: 22px; font-weight: 800; }
.help-slip-section { margin: 0 12px 12px; padding: 10px; border: 1px solid #e6edf4; border-radius: 12px; background: #fff; }.help-slip-section-title { margin: 0 2px 8px; color: #6c7c90; font-size: 10px; font-weight: 800; letter-spacing: .08em; }.help-slip-section .help-party { margin: 0; }.help-slip-section .help-slip-meta { padding: 4px 2px; }.help-slip-section .help-upi-pay { margin: 8px 0 0; overflow-wrap: anywhere; }.help-slip-section .help-upi-pay strong { overflow-wrap: anywhere; }

.tree-visual {
    display: grid;
    justify-items: center;
    gap: 18px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid var(--app-border);
    border-radius: 8px;
}

.tree-branches {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 18px;
    width: min(100%, 520px);
}

.tree-node {
    min-height: 76px;
    width: min(100%, 230px);
    display: grid;
    align-content: center;
    gap: 3px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.tree-node span,
.tree-node small {
    color: var(--app-muted);
}

.tree-user-node { display: grid; justify-items: center; gap: 1px; min-height: 76px; padding: 5px 8px; }
.tree-user-node strong { max-width: 100%; font-size: 11px; letter-spacing: 0; overflow-wrap: anywhere; }
.tree-user-name { display: block; max-width: 100%; font-size: 11px; line-height: 1.1; overflow-wrap: anywhere; white-space: normal; }
.tree-user-icon { position: relative; display: block; width: 26px; height: 30px; color: #64748b; }
.tree-user-icon::before { content: ''; position: absolute; top: 0; left: 7px; width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.tree-user-icon::after { content: ''; position: absolute; left: 2px; bottom: 0; width: 22px; height: 15px; border-radius: 12px 12px 3px 3px; background: currentColor; }
.tree-user-node.stage-blue .tree-user-icon { color: #1597d4; }
.tree-user-node.stage-green .tree-user-icon { color: #11b8b0; }
.tree-user-node.stage-white .tree-user-icon { color: #f5a623; }
.tree-user-link { color: inherit; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.tree-user-link:hover { color: inherit; text-decoration: none; transform: translateY(-2px); box-shadow: 0 5px 14px rgba(15, 23, 42, .14); }
.tree-map { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 10px 13px; border: 1px solid #d9e2ec; border-radius: 8px; color: #405268; background: #f8fafc; font-size: 12px; }
.tree-map strong { color: #172b45; font-size: 13px; }.tree-map-flow { color: #2563eb; font-weight: 700; }.tree-map small { flex-basis: 100%; color: #718096; }
.tree-map-dot { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 50%; vertical-align: -1px; }.tree-map-dot-white { background: #f5a623; }.tree-map-dot-blue { background: #1597d4; }.tree-map-dot-green { background: #11b8b0; }

@media (max-width: 575.98px) {
    .help-slip-grid { grid-template-columns: minmax(0, 1fr); }
    .help-slip-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .help-slip-number { font-size: 18px; overflow-wrap: anywhere; }
}

.root-node {
    border-color: #8cc7ff;
    background: #e9f3ff;
}

.tree-current-user { outline: 3px solid #d47b00; outline-offset: 3px; z-index: 1; }

.member-tree-visual,
.placement-tree-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: #7c8999 #e2e8f0;
    scrollbar-width: thin;
}

.member-tree-visual { padding: 18px; background: #f8fafc; border: 1px solid var(--app-border); border-radius: 8px; }
.member-tree-content { width: 856px; min-width: 856px; }
.member-tree-content > .tree-node { position: relative; width: min(100%, 140px); margin: 0 auto 24px; }
.member-tree-content > .root-has-children::after { content: ''; position: absolute; z-index: 0; left: 50%; bottom: -24px; width: 432px; height: 24px; transform: translateX(-50%); background: linear-gradient(#cbd5e1, #cbd5e1) center top / 2px 100% no-repeat, linear-gradient(#cbd5e1, #cbd5e1) center bottom / 100% 2px no-repeat; }
.tree-scroll-hint { margin: -8px 0 16px; }
.member-tree-visual::-webkit-scrollbar,
.placement-tree-wrap::-webkit-scrollbar { height: 12px; }
.member-tree-visual::-webkit-scrollbar-track,
.placement-tree-wrap::-webkit-scrollbar-track { border-radius: 999px; background: #e2e8f0; }
.member-tree-visual::-webkit-scrollbar-thumb,
.placement-tree-wrap::-webkit-scrollbar-thumb { border: 3px solid #e2e8f0; border-radius: 999px; background: #7c8999; }

.vacant-node {
    color: var(--app-muted);
    border-style: dashed;
}

.placement-tree-wrap { padding: 1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 1rem; }
.bfs-level-row { position: relative; display: flex; justify-content: center; gap: 8px; min-width: max-content; margin: 0 auto 12px; padding-top: 12px; }
.bfs-level-row::before { content: ''; position: absolute; top: 0; left: 25%; right: 25%; border-top: 2px solid #cbd5e1; }
.bfs-level-row:first-child { padding-top: 0; }.bfs-level-row:first-child::before { display: none; }
.bfs-tree-slot { position: relative; width: 180px; flex: 0 0 180px; }.bfs-tree-slot::before { content: ''; position: absolute; top: -12px; left: 50%; height: 12px; border-left: 2px solid #cbd5e1; }
.member-tree-content .bfs-level-row { display: grid; grid-template-columns: repeat(8, 100px); justify-content: start; gap: 8px; width: 856px; min-width: 856px; margin: 0 auto 12px; padding-top: 12px; }
.member-tree-content .bfs-level-row::before { display: none; }
.member-tree-content .bfs-tree-slot { display: flex; position: relative; width: auto; min-width: 0; flex: none; justify-content: center; }
.member-tree-content .bfs-tree-slot::before { top: -12px; left: 50%; height: 12px; border-left: 2px solid #cbd5e1; }
.member-tree-content .bfs-tree-slot.has-tree-children::after { content: ''; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px; background: linear-gradient(to right, transparent 24%, #cbd5e1 24%, #cbd5e1 76%, transparent 76%) left bottom / 100% 2px no-repeat, linear-gradient(#cbd5e1, #cbd5e1) center top / 2px 100% no-repeat; }
.member-tree-content .bfs-tree-slot .placement-node { width: 100px; min-height: 76px; }
.member-tree-content .bfs-tree-slot .vacant-node { display: flex; align-items: center; }
.member-tree-content .bfs-level-row:first-child .bfs-tree-slot::before { display: block; }
.admin-bfs-tree .bfs-level-row { display: grid; grid-template-columns: repeat(8, 100px); justify-content: start; gap: 8px; width: 856px; min-width: 856px; margin: 0 auto 12px; padding-top: 12px; }
.admin-bfs-tree .bfs-level-row::before { display: none; }
.admin-bfs-tree .bfs-level-row:first-child { padding-top: 0; }
.admin-bfs-tree .bfs-tree-slot { display: flex; position: relative; width: auto; min-width: 0; flex: none; justify-content: center; }
.admin-bfs-tree .bfs-tree-slot::before { top: -12px; left: 50%; height: 12px; border-left: 2px solid #cbd5e1; }
.admin-bfs-tree .bfs-level-row:first-child .bfs-tree-slot::before { display: none; }
.admin-bfs-tree .bfs-tree-slot.has-tree-children::after { content: ''; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px; background: linear-gradient(to right, transparent 24%, #cbd5e1 24%, #cbd5e1 76%, transparent 76%) left bottom / 100% 2px no-repeat, linear-gradient(#cbd5e1, #cbd5e1) center top / 2px 100% no-repeat; }
.admin-bfs-tree .bfs-tree-slot .placement-node { width: 100px; min-height: 76px; }
.admin-bfs-tree .bfs-tree-slot .vacant-node { display: flex; align-items: center; }
.placement-branch { list-style: none; margin: 0; padding-left: 1.5rem; min-width: max-content; }
.placement-branch > li { position: relative; margin: .75rem 0; }
.placement-branch > li::before { content: ''; position: absolute; top: 1.5rem; left: -1rem; width: .85rem; border-top: 2px solid #cbd5e1; }
.placement-branch > li::after { content: ''; position: absolute; top: -1rem; bottom: -1rem; left: -1rem; border-left: 2px solid #cbd5e1; }
.placement-branch > li:first-child::after { top: 1.5rem; }.placement-branch > li:last-child::after { bottom: calc(100% - 1.5rem); }
.placement-tree-wrap > .placement-branch { padding-left: 0; }.placement-tree-wrap > .placement-branch > li::before, .placement-tree-wrap > .placement-branch > li::after { display: none; }
.placement-node { width: 270px; padding: .75rem; border: 1px solid #cbd5e1; border-left-width: 5px; border-radius: .7rem; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.placement-id, .placement-meta { color: #64748b; font-size: .75rem; }.placement-legend { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .82rem; }
.stage-white, .stage-blue, .stage-green { border-radius: .4rem; padding: .2rem .45rem; font-weight: 600; }.stage-white { background: #fff; border: 1px solid #94a3b8; color: #334155; }.stage-blue { background: #dbeafe; border-color: #2563eb; color: #1d4ed8; }.stage-green { background: #dcfce7; border-color: #16a34a; color: #15803d; }
.placement-node.stage-blue { border-left-color: #2563eb; }.placement-node.stage-green { border-left-color: #16a34a; }

@media (max-width: 991.98px) {
    .app-sidebar {
        width: 280px;
        max-width: calc(100vw - 42px);
        height: 100vh;
        min-height: 100vh;
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1100;
        transform: translateX(-100%);
        -webkit-transform: translateX(-100%);
        transition: transform 180ms ease;
        will-change: transform;
        box-shadow: 12px 0 28px rgba(15, 23, 42, 0.18);
    }

body.sidebar-open .app-sidebar {
    transform: translateX(0);
    -webkit-transform: translateX(0);
}

body.sidebar-open {
    overflow: hidden;
}

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.42);
        z-index: 1090;
        display: none;
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .sidebar-toggle {
        display: inline-flex;
        position: relative;
        z-index: 1120;
        cursor: pointer;
        touch-action: manipulation;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 1020;
        padding: 8px 12px;
    }

    .topbar-actions {
        flex: 0 0 auto;
    }

    .content-wrap {
        width: 100%;
        padding: 14px;
    }

    .app-card,
    .stat-card {
        border-radius: 7px;
    }

    .table-responsive {
        border: 1px solid var(--app-border);
        border-radius: 7px;
    }

    .app-footer {
        display: block;
        padding: 10px 14px;
    }

    .tree-branches {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 13px;
    }

    .sidebar-toggle {
        min-width: 44px;
        min-height: 44px;
    }

    .topbar-title {
        font-size: 14px;
    }

    .topbar .btn {
        padding: 5px 9px;
        font-size: 12px;
    }

    .content-wrap {
        padding: 12px 10px 82px;
    }

    .content-wrap input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
    .content-wrap select,
    .content-wrap textarea,
    .content-wrap form .btn {
        min-height: 44px;
    }

    .auth-shell {
        width: 100%;
    }

    .auth-shell .app-card {
        padding: 16px 14px !important;
    }

    .auth-brand {
        margin-bottom: 8px;
    }

    .auth-brand img {
        width: 100%;
        height: auto;
    }

    .auth-shell .form-control,
    .auth-shell .btn {
        min-height: 44px;
    }

    .content-wrap > section.row {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.75rem;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    .content-wrap > section.row .d-flex > .btn {
        flex: 1 1 100%;
    }

    .app-card {
        padding: 16px !important;
    }

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

    .dashboard-hero { min-height: 0; align-items: flex-start; flex-direction: column; padding: 18px; border-radius: 14px; }.dashboard-hero h1 { font-size: 1.35rem; }.dashboard-hero .btn { width: 100%; }.dashboard-hero > .d-flex { width: 100%; }.dashboard-stats .stat-card { min-height: 72px; padding: 9px !important; border-radius: 11px; }.dashboard-stats .h2 { margin: 4px 0 0; font-size: 1rem; }.dashboard-stats .display-6 { margin-top: 3px; font-size: 1.3rem; }.member-dashboard-group-heading { align-items: stretch; flex-direction: column; }.member-dashboard-group-heading .btn { width: 100%; }.member-help-actions { width: 100%; flex-direction: column; }.member-help-actions .btn { width: 100%; }.member-dashboard-group { padding: 14px !important; }

    .help-slip-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }.help-slip { border-radius: 13px; }.help-slip-top { padding: 14px 14px 10px; }.help-slip-type { margin-left: 14px; }.help-slip-amount { padding-left: 14px; padding-right: 14px; }.help-party { margin-left: 14px; margin-right: 14px; }.help-slip-meta { padding-left: 14px; padding-right: 14px; }.help-slip-action { padding: 0 14px 14px; }.help-pending-note { margin-left: 14px; margin-right: 14px; }

    .mobile-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1050; display: flex; gap: 3px; min-height: 61px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; overscroll-behavior-x: contain; background: rgba(255,255,255,.96); border-top: 1px solid var(--app-border); box-shadow: 0 -5px 18px rgba(20,42,66,.10); -webkit-overflow-scrolling: touch; }.mobile-bottom-nav a { min-width: 66px; flex: 1 0 66px; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 3px 6px; border-radius: 9px; color: #65758a; text-decoration: none; white-space: nowrap; }.mobile-bottom-nav a > span { font-size: 18px; line-height: 20px; font-weight: 700; }.mobile-bottom-nav small { font-size: 10px; font-weight: 700; }.mobile-bottom-nav a.active { color: var(--app-blue); background: color-mix(in srgb, var(--app-blue) 12%, #fff); }
}
