:root {
    --primary: #2E865F;
    /* Emerald Green (Safe) */
    --primary-light: #E8F5E9;
    --alert: #E57373;
    /* Coral Red (Deficit) */
    --dark: #1B2B25;
    /* Dark Green-Black */
    --grey-light: #F4F6F5;
    --grey-med: #E0E0E0;
    --white: #FFFFFF;
    --text-main: #1B2B25;
    --text-sub: #6c757d;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f0f2f5;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* FRAME */
.app-frame {
    width: 100%;
    height: 100%;
    max-width: 414px;
    max-height: 896px;
    background: var(--grey-light);
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 500px) {
    .app-frame {
        height: 90vh;
        border-radius: 40px;
        border: 10px solid #000;
    }
}

/* HEADER */
.top-bar {
    padding: 50px 24px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
}

.user-welcome h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
}

.user-welcome span {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-role {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    margin-bottom: 5px;
    display: inline-block;
    letter-spacing: 0.5px;
}

.badge-role.treasurer {
    background: #FFECB3;
    color: #FF6F00;
}

.badge-role.member {
    background: #E3F2FD;
    color: #1565C0;
}

.notification-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--grey-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--dark);
}

/* DASHBOARD CONTENT */
.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 100px;
    /* Added padding bottom for nav */
}

/* STATUS CARD */
.status-card {
    background: var(--dark);
    color: var(--white);
    padding: 25px;
    border-radius: 24px;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px rgba(46, 134, 95, 0.2);
    position: relative;
    overflow: hidden;
}

.status-card::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.status-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 5px;
}

.status-amount {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.status-sub {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 5px;
    opacity: 0.6;
}

.treasurer-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 12px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-val-sm {
    font-size: 1rem;
    font-weight: 600;
}

/* QUICK ACTIONS */
.quick-actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.quick-action-btn {
    flex: 1;
    background: var(--white);
    padding: 15px;
    border-radius: 16px;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark);
    transition: 0.2s;
    cursor: pointer;
}

.quick-action-btn:active {
    transform: scale(0.98);
}

.quick-action-btn i {
    font-size: 1.2rem;
    color: var(--primary);
}

/* DUAL WIDGETS */
.dual-widgets {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.widget-card {
    flex: 1;
    background: var(--white);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.widget-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-sub);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-val-lg {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
}

.widget-val-sm {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 600;
}

/* EMERGENCY FUND */
.emergency-badge {
    background: #E0F2F1;
    color: #00695C;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 25px;
    border: 1px dashed #4DB6AC;
}

/* RECENT ACTIVITY */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sec-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--dark);
}

.tx-list {
    margin-bottom: 25px;
}

.tx-item {
    background: var(--white);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.tx-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tx-avatar {
    width: 40px;
    height: 40px;
    background: var(--grey-med);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-sub);
}

.tx-desc {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--dark);
}

.tx-date {
    font-size: 0.75rem;
    color: var(--text-sub);
}

.tx-amt {
    font-weight: 700;
    font-size: 1rem;
}

.tx-amt.neg {
    color: var(--text-main);
}

.tx-amt.pos {
    color: var(--primary);
}

/* MEMBERS GRID */
.members-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.member-card {
    background: var(--white);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.member-role {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--grey-light);
    color: var(--text-sub);
    margin-top: 5px;
    font-weight: 700;
}

.member-stats {
    margin-top: 12px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
}

.member-stat-col {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-sub);
    font-weight: 600;
}

.stat-val {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--dark);
}

/* BOTTOM NAV */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    padding: 10px 24px 20px;
    border-top: 1px solid var(--grey-med);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 900;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-sub);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    transition: 0.2s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

/* --- MODAL STYLES (V3.1) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.modal-body {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 30px 30px 0 0;
    padding: 24px;
    z-index: 1001;
    transform: translateY(100%);
    transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

body.modal-active .modal-overlay {
    opacity: 1;
    pointer-events: all;
}

body.modal-active .modal-body {
    transform: translateY(0);
}

.modal-handle {
    width: 40px;
    height: 5px;
    background: var(--grey-med);
    border-radius: 10px;
    margin: 0 auto 20px;
}

/* TABS */
.tx-tabs {
    display: flex;
    background: var(--grey-light);
    padding: 4px;
    border-radius: 12px;
    margin: 15px 0 25px;
}

.tx-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-sub);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.tx-tab.active {
    background: white;
    color: var(--dark);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* AMOUNT INPUT */
.amt-input-group {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

.curr-sign {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-sub);
    margin-right: 5px;
}

.main-amt-inp {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--dark);
    width: 200px;
    border: none;
    outline: none;
    background: transparent;
    text-align: center;
}

/* FORM FIELDS */
.form-row {
    margin-bottom: 25px;
}

.inp-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.inp-field input {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--grey-med);
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
}

.inp-field input:focus {
    border-color: var(--primary);
}

/* SPLIT LIST */
.split-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 0.9rem;
}

.split-toggle {
    background: var(--grey-light);
    padding: 3px;
    border-radius: 8px;
    display: flex;
    gap: 5px;
    cursor: pointer;
}

.split-toggle span {
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    color: var(--text-sub);
}

.split-toggle span.active {
    background: white;
    color: var(--dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.split-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--grey-light);
}

.split-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.split-inp {
    width: 80px;
    text-align: right;
    border: none;
    background: var(--grey-light);
    padding: 8px;
    border-radius: 8px;
    font-weight: 700;
}

.validator-msg {
    text-align: center;
    padding: 10px;
    margin-top: 10px;
    background: #FFEBEE;
    color: var(--alert);
    font-weight: 700;
    border-radius: 8px;
    font-size: 0.9rem;
}

.validator-msg.hidden {
    display: none;
}

.btn-full {
    width: 100%;
    padding: 18px;
    background: var(--dark);
    color: var(--primary);
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 20px;
    cursor: pointer;
}