/* APWOCHE Investment Group - Premium Theme v2 */
:root {
    --primary: #0f5e2e;
    --primary-dark: #0a3f1e;
    --primary-light: #1a8a47;
    --primary-glow: rgba(15, 94, 46, 0.15);
    --primary-bg: #e8f5e9;
    --gold: #d4a017;
    --gold-light: #f5e6b8;
    --gold-glow: rgba(212, 160, 23, 0.2);
    --gold-bg: #fff8e1;
    --white: #ffffff;
    --bg: #f0f2f5;
    --text: #1a1a2e;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-gold: 0 4px 16px rgba(212, 160, 23, 0.25);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --radius-round: 50%;
    --welfare: #e74c3c;
    --savings: #2196f3;
    --development: #2e7d32;
    --loan: #ff9800;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container { max-width: 520px; margin: 0 auto; padding-bottom: 20px; position: relative; }

/* PREMIUM HEADER */
.header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0d7a3a 40%, var(--primary-light) 100%);
    padding: 24px 20px 18px;
    position: relative;
    overflow: hidden;
}
.header::before {
    content: '';
    position: absolute;
    top: -80px; right: -40px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}
.header::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}
.header::before,
.header::after { animation: headerGlow 4s ease-in-out infinite alternate; }
@keyframes headerGlow { 0% { opacity: 0.6; transform: scale(1); } 100% { opacity: 1; transform: scale(1.1); } }
.header-top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.logo-area { display: flex; align-items: center; gap: 12px; }
.header-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}
.logo-area h1 { font-size: 22px; color: var(--white); letter-spacing: 1.5px; font-weight: 800; }
.logo-area .subtitle { font-size: 11px; color: var(--gold-light); display: block; }
.header-badge {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    padding: 6px 12px; border-radius: 20px;
    font-size: 11px; color: var(--gold-light);
    backdrop-filter: blur(4px);
}
.header-badge i { font-size: 12px; }

/* PAYBILL BANNER */
.paybill-banner {
    background: linear-gradient(135deg, var(--gold), #e6b422 60%, var(--gold-light));
    padding: 14px 20px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.paybill-banner::before {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.paybill-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 1;
}
.paybill-left { display: flex; align-items: center; gap: 12px; }
.paybill-left i { font-size: 26px; color: var(--primary-dark); }
.paybill-left small { font-size: 10px; color: var(--primary-dark); opacity: 0.8; display: block; }
.paybill-left strong { font-size: 15px; color: var(--primary-dark); display: block; font-weight: 800; }
.paybill-left span { font-size: 11px; color: var(--primary-dark); opacity: 0.9; }
.paybill-status {
    display: flex; align-items: center; gap: 4px;
    background: var(--primary-dark);
    padding: 5px 12px; border-radius: 20px;
    font-size: 10px; color: var(--white);
    font-weight: 600;
}

/* OFFICIALS BAR */
.officials-bar {
    display: flex;
    background: var(--white);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.official { display: flex; align-items: center; gap: 10px; flex: 1; }
.official i { font-size: 20px; color: var(--primary); }
.official small { font-size: 10px; color: var(--text-light); display: block; font-weight: 500; }
.official strong { font-size: 13px; color: var(--text); font-weight: 700; }
.divider-v { width: 1px; height: 36px; background: var(--border); margin: 0 12px; }

/* SECTIONS */
.main-content { padding: 16px 16px 80px; position: relative; }
.main-content::before {
    content: '';
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}
.main-content > * { position: relative; z-index: 1; }
.section { margin-bottom: 20px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.section-header h2 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.section-header h2 i { color: var(--primary); font-size: 15px; }
.update-badge {
    background: var(--primary);
    color: var(--white);
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.meeting-cycle { font-size: 10px; color: var(--text-light); background: var(--primary-bg); padding: 3px 8px; border-radius: 8px; }

/* ACCOUNTS GRID */
.accounts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.stat-card { background: var(--white); border-radius: var(--radius-sm); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-number { font-size: 32px; font-weight: 800; color: var(--primary); display: block; }
.stat-label { font-size: 12px; color: var(--text-light); display: block; margin-top: 4px; }
.members-list { display: flex; flex-direction: column; gap: 8px; }
.member-card { display: flex; align-items: center; gap: 12px; background: var(--white); padding: 12px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.member-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.member-avatar span { font-size: 16px; font-weight: 700; color: var(--primary); }
.member-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.member-info strong { font-size: 14px; color: var(--text); }
.member-info small { font-size: 11px; color: var(--text-light); }
.role-chairman { font-size: 10px; font-weight: 700; color: var(--gold); text-transform: uppercase; }
.role-treasurer { font-size: 10px; font-weight: 700; color: var(--primary-light); text-transform: uppercase; }
.role-member { font-size: 10px; font-weight: 600; color: var(--text-light); text-transform: uppercase; }
.account-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.6);
}
.account-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.account-card:active { transform: scale(0.96); }
.account-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
}
.account-card.welfare::before { background: linear-gradient(90deg, var(--welfare), #f1948a); }
.account-card.savings::before { background: linear-gradient(90deg, var(--savings), #64b5f6); }
.account-card.development::before { background: linear-gradient(90deg, var(--development), #66bb6a); }
.account-card.loan::before { background: linear-gradient(90deg, var(--loan), #ffb74d); }

.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius-xs);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}
.account-card:hover .card-icon { transform: scale(1.1) rotate(-5deg); }
.account-card.welfare .card-icon { background: #fce4e4; color: var(--welfare); }
.account-card.savings .card-icon { background: #e3f2fd; color: var(--savings); }
.account-card.development .card-icon { background: #e8f5e9; color: var(--development); }
.account-card.loan .card-icon { background: #fff3e0; color: var(--loan); }

.card-label { font-size: 10px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.8px; }
.card-balance { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 8px; letter-spacing: -0.3px; }
.card-footer { display: flex; justify-content: space-between; align-items: center; }
.card-footer small { font-size: 10px; color: var(--text-light); }
.card-footer i { font-size: 11px; color: var(--primary); opacity: 0.5; transition: var(--transition); }
.account-card:hover .card-footer i { opacity: 1; transform: translateX(4px); }

/* LOAN BREAKDOWN */
.loan-breakdown {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.loan-breakdown::after {
    content: '';
    position: absolute;
    top: -50%; right: -50%;
    width: 100%; height: 100%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    pointer-events: none;
}
.lb-item { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; position: relative; z-index: 1; }
.lb-label { color: var(--text-light); }
.lb-value { font-weight: 700; color: var(--text); }
.lb-value.paid { color: var(--primary); }
.lb-value.balance { color: var(--gold); font-size: 15px; }
.lb-progress { margin: 10px 0; position: relative; z-index: 1; }
.lb-bar {
    width: 100%; height: 10px;
    background: var(--bg);
    border-radius: 5px;
    overflow: hidden;
}
.lb-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--primary-light));
    border-radius: 5px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.lb-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.lb-item { display: flex; justify-content: space-between; padding: 8px 0; }
.lb-item:first-child { padding-top: 0; }
.lb-label { font-size: 13px; color: var(--text-light); }
.lb-value { font-size: 14px; font-weight: 700; color: var(--text); }
.lb-value.paid { color: var(--development); }
.lb-value.balance { color: var(--loan); }
.lb-progress { padding: 0 0 4px; }
.lb-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.lb-fill { height: 100%; background: var(--development); border-radius: 3px; transition: width 0.6s ease; }

/* PAYMENT CARD */
.payment-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.payment-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-bg);
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    color: var(--primary-dark);
    margin-bottom: 16px;
}
.payment-info i { font-size: 16px; color: var(--primary); }
.payment-info strong { color: var(--primary); }
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s;
    outline: none;
    font-family: inherit;
}
.form-input:focus { border-color: var(--primary); }
.amount-options {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.amount-options button {
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--white);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.amount-options button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.btn-pay {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(15, 94, 46, 0.3);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}
.btn-pay:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(15, 94, 46, 0.4); }
.btn-pay:active { transform: scale(0.97); }
.btn-pay i { font-size: 18px; }
.tab-badge { background: #dc3545; color: white; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; margin-left: 4px; line-height: 1.4; }
.btn-pay-request { background: linear-gradient(135deg, var(--gold) 0%, #e6b422 100%); box-shadow: 0 4px 16px rgba(212, 160, 23, 0.35); }
.btn-pay-request:hover { box-shadow: 0 6px 24px rgba(212, 160, 23, 0.45) !important; }

/* CONTRIBUTION TABLE */
.contrib-table-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.contrib-table { width: 100%; border-collapse: collapse; }
.contrib-table thead { background: var(--primary); }
.contrib-table th {
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.contrib-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.contrib-table tbody tr:last-child td { border-bottom: none; }
.contrib-table tbody tr:hover { background: var(--primary-bg); }
.contrib-table .td-amount { font-weight: 700; color: var(--primary); }
.contrib-table .td-meeting { font-size: 11px; color: var(--text-light); }

/* MEETING CARDS */
.meeting-cards { display: flex; flex-direction: column; gap: 10px; }
.meeting-card {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    gap: 14px;
}
.meet-date {
    width: 52px; height: 58px;
    background: var(--primary-bg);
    border-radius: var(--radius-xs);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.meeting-card.next .meet-date { background: var(--gold-bg); }
.meet-day { font-size: 20px; font-weight: 800; color: var(--primary); line-height: 1; }
.meeting-card.next .meet-day { color: var(--gold); }
.meet-month { font-size: 10px; color: var(--text-light); text-transform: uppercase; }
.meeting-card.next .meet-month { color: var(--gold); }
.meet-info { flex: 1; }
.meet-info strong { font-size: 14px; color: var(--text); display: block; }
.meet-info span { font-size: 11px; color: var(--text-light); }
.meet-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.past-badge { background: var(--border); color: var(--text-light); }
.next-badge { background: var(--gold); color: var(--primary-dark); }
.meeting-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-light);
    padding: 0 4px;
}
.meeting-note i { color: var(--gold); font-size: 14px; }

/* TRANSACTIONS */
.transactions-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}
.tx-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}
.tx-empty i { font-size: 28px; margin-bottom: 8px; opacity: 0.4; }
.tx-empty p { font-size: 13px; }
.tx-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.tx-item:last-child { border-bottom: none; }
.tx-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.tx-icon.credit { background: #e8f5e9; color: var(--development); }
.tx-icon.debit { background: #fce4e4; color: var(--welfare); }
.tx-info { flex: 1; margin-left: 10px; }
.tx-info strong { font-size: 13px; color: var(--text); display: block; }
.tx-info small { font-size: 11px; color: var(--text-light); }
.tx-amount { font-size: 14px; font-weight: 700; }
.tx-amount.credit { color: var(--development); }
.tx-amount.debit { color: var(--welfare); }

/* FOOTER */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 11px;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--white);
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    max-width: 90%;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; visibility: visible; }
.toast.success { background: var(--development); }
.toast.error { background: var(--welfare); }
.toast.info { background: var(--savings); }

/* ============ AUTH SCREENS ============ */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }
.auth-wrap {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, #065a2a 50%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.auth-wrap::before {
    content: '';
    position: absolute;
    top: -40%; left: -20%;
    width: 80%; height: 80%;
    background: radial-gradient(circle, rgba(212,160,23,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.auth-wrap::after {
    content: '';
    position: absolute;
    bottom: -30%; right: -20%;
    width: 70%; height: 70%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    pointer-events: none;
}
.auth-box {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 36px 28px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.3);
}
.auth-icon {
    width: 64px; height: 64px;
    background: var(--gold);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px; color: var(--white);
}
.auth-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    display: block;
    border: 3px solid var(--gold);
}
.auth-box h1 { font-size: 24px; color: var(--text); letter-spacing: 1px; }
.auth-sub { font-size: 13px; color: var(--text-light); margin-bottom: 24px; }
.auth-form { text-align: left; }
.inp-grp {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 10px;
    padding: 0 14px;
    height: 48px;
    margin-bottom: 12px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.inp-grp:focus-within { border-color: var(--primary); }
.inp-grp i { color: var(--text-light); font-size: 16px; width: 20px; text-align: center; }
.inp-grp input {
    flex: 1;
    border: none;
    background: none;
    font-size: 15px;
    color: var(--text);
    outline: none;
    padding: 0 10px;
    font-family: inherit;
}
.btn-auth {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(15, 94, 46, 0.25);
    letter-spacing: 0.3px;
}
.btn-auth:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(15, 94, 46, 0.35); }
.btn-auth:active { transform: scale(0.97); }
.auth-alt { text-align: center; font-size: 13px; color: var(--text-light); margin-top: 16px; }
.auth-alt a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ============ HEADER UPDATES ============ */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}
.user-role-badge {
    background: var(--gold);
    color: var(--primary-dark);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}
.btn-icon {
    background: rgba(255,255,255,0.15);
    border: none;
    color: var(--white);
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.btn-icon:active { background: rgba(255,255,255,0.25); }
.header-user {
    color: var(--gold-light);
    font-size: 12px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}
.header-user strong { color: var(--white); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: #4caf50; display: inline-block; margin-right: 6px; box-shadow: 0 0 6px rgba(76,175,80,0.5); animation: pulse 2s infinite; }
.conn-dot.offline { background: #f44336; box-shadow: 0 0 6px rgba(244,67,54,0.5); }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

/* ============ TAB NAVIGATION ============ */
.tab-nav {
    display: flex;
    background: var(--white);
    box-shadow: 0 -1px 8px rgba(0,0,0,0.05);
    position: sticky;
    bottom: 0;
    z-index: 50;
    border-top: 1px solid var(--border);
}
.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px 6px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 10px;
    transition: var(--transition);
    position: relative;
}
.tab-btn i { font-size: 18px; margin-bottom: 2px; transition: var(--transition); }
.tab-btn span { font-size: 9px; font-weight: 500; }
.tab-btn.active { color: var(--primary); }
.tab-btn.active i { transform: translateY(-2px); }
.tab-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: var(--transition);
}
.tab-btn.active::after { transform: translateX(-50%) scaleX(1); }
.tab-panel { display: none; animation: panelIn 0.3s ease; }
.tab-panel.active { display: block; }
@keyframes panelIn { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }

/* ============ LOAN RULES ============ */
.loan-rules {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff3e0;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    color: #e65100;
    margin-bottom: 16px;
}
.loan-rules i { font-size: 16px; color: var(--loan); }

/* ============ CALC BOX ============ */
.calc-box {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}
.calc-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.calc-row span { color: var(--text-light); }
.calc-row strong { color: var(--text); }
.calc-row.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; }
.calc-row.total strong { color: var(--primary); font-size: 15px; }

/* ============ LOAN CARDS (Member & Admin) ============ */
.loans-list { display: flex; flex-direction: column; gap: 10px; }
.loan-app-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}
.loan-app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.loan-app-header .name { font-size: 14px; font-weight: 700; color: var(--text); }
.loan-app-header .date { font-size: 11px; color: var(--text-light); }
.loan-app-body { margin-bottom: 10px; }
.loan-app-body .amount { font-size: 22px; font-weight: 800; color: var(--text); }
.loan-app-body .purpose { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.loan-app-body .total-repay { font-size: 12px; color: var(--primary); font-weight: 600; margin-top: 4px; }
.loan-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}
.loan-status.pending { background: #fff3e0; color: #e65100; }
.loan-status.approved { background: #e8f5e9; color: var(--development); }
.loan-status.rejected { background: #fce4e4; color: var(--welfare); }
.loan-app-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.btn-approve, .btn-reject {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.15s;
}
.btn-approve:active, .btn-reject:active { transform: scale(0.97); }
.btn-approve { background: #e8f5e9; color: var(--development); }
.btn-reject { background: #fce4e4; color: var(--welfare); }

/* ============ PROFILE CARD ============ */
.profile-card {
    text-align: center;
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.profile-avatar {
    width: 72px; height: 72px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}
.profile-avatar span { font-size: 28px; font-weight: 700; color: var(--white); }
.profile-card h3 { font-size: 18px; color: var(--text); }
.role-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 10px;
    margin: 6px 0;
    text-transform: uppercase;
}
.profile-card small { font-size: 12px; color: var(--text-light); display: block; }

/* ============ MENU LIST ============ */
.menu-list {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.menu-item:last-child { border-bottom: none; }
.menu-item i:first-child { width: 30px; font-size: 18px; color: var(--primary); }
.menu-item span { flex: 1; margin-left: 10px; }
.menu-item i:last-child { color: var(--text-light); font-size: 14px; }

/* ============ MEMBER MODAL ============ */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal-content { background: white; border-radius: var(--radius); max-width: 440px; width: 100%; max-height: 80vh; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; color: var(--primary); }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-light); cursor: pointer; padding: 0 4px; line-height: 1; }
.modal-body { padding: 12px 20px 20px; overflow-y: auto; max-height: calc(80vh - 60px); }
.member-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.member-row:last-child { border-bottom: none; }
.modal-header-row { font-size: 12px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--primary); padding-bottom: 8px; margin-bottom: 4px; }
.member-row .name { color: var(--text); font-weight: 500; }
.member-row .amount { color: var(--primary); font-weight: 700; }
.modal-total { display: flex; justify-content: space-between; padding: 12px 0 0; margin-top: 8px; border-top: 2px solid var(--primary); font-size: 15px; font-weight: 700; color: var(--text); }

/* ============ ANNOUNCEMENTS ============ */
.announcement-card { background: var(--white); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 10px; box-shadow: var(--shadow); border-left: 4px solid var(--gold); }
.announce-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 10px; }
.announce-header strong { font-size: 15px; color: var(--text); }
.announce-date { font-size: 11px; color: var(--text-light); white-space: nowrap; }
.announcement-card p { font-size: 13px; color: var(--text); line-height: 1.6; margin-bottom: 8px; }
.announce-author { font-size: 11px; color: var(--text-light); }
body.dark-mode .announcement-card { background: #1e1e1e; }

/* ============ ATTENDANCE ============ */
.meeting-attend-card { background: var(--white); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.attend-header { display: flex; justify-content: space-between; margin-bottom: 6px; }
.attend-header strong { font-size: 14px; color: var(--text); }
.attend-header span { font-size: 12px; color: var(--text-light); }
.attend-count { font-size: 12px; color: var(--primary); font-weight: 600; }
.attend-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; color: var(--text); cursor: pointer; }
.attend-check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
body.dark-mode .meeting-attend-card { background: #1e1e1e; }
body.dark-mode .attend-check { color: #e0e0e0; }

/* ============ DARK MODE ============ */
body.dark-mode { --bg: #121212; --text: #e0e0e0; --text-light: #9e9e9e; --white: #1e1e1e; --border: #333; --shadow: 0 2px 12px rgba(0,0,0,0.3); --primary-bg: #1a3a2a; --gold-bg: #3a3010; }
body.dark-mode .header { background: linear-gradient(135deg, #0a2a18 0%, #0f5e2e 50%, #0a4a23 100%); }
body.dark-mode .member-card, body.dark-mode .payment-card, body.dark-mode .meeting-card, body.dark-mode .loan-app-card, body.dark-mode .stat-card, body.dark-mode .modal-content { background: #1e1e1e; }
body.dark-mode .inp-grp { background: #2a2a2a; }
body.dark-mode .inp-grp input, body.dark-mode .form-input, body.dark-mode textarea.form-input { background: #2a2a2a; color: #e0e0e0; }
body.dark-mode .contrib-table { background: #1e1e1e; }
body.dark-mode .contrib-table th { background: #2a2a2a; color: #9e9e9e; }
body.dark-mode .contrib-table td { color: #e0e0e0; border-color: #333; }
body.dark-mode .calc-box { background: #2a2a2a; }
body.dark-mode .loan-rules { background: #2a2a2a; }
body.dark-mode .official { color: #e0e0e0; }
body.dark-mode .official small { color: #9e9e9e; }
body.dark-mode .auth-box { background: #1e1e1e; }
body.dark-mode .profile-card { background: #1e1e1e; }
body.dark-mode .menu-item { background: #1e1e1e; color: #e0e0e0; border-color: #333; }
body.dark-mode .menu-item:hover { background: #2a2a2a; }
body.dark-mode .meeting-note { background: #2a2a2a; color: #9e9e9e; }
body.dark-mode .paybill-banner { background: #2a2a2a; }
body.dark-mode .paybill-banner strong { color: #e0e0e0; }
body.dark-mode .payment-info { background: #2a2a2a; }
body.dark-mode .section-header h2 { color: #e0e0e0; }
body.dark-mode .member-avatar { background: #2a2a2a; }
body.dark-mode .member-avatar span { color: #d4a017; }
body.dark-mode .auth-box { background: rgba(30,30,30,0.95); }
body.dark-mode .main-content::before { opacity: 0.1; }
body.dark-mode .tab-nav { background: #1e1e1e; border-top-color: #333; }
body.dark-mode .loan-breakdown { background: #1e1e1e; }
body.dark-mode .lb-bar { background: #333; }
body.dark-mode .paybill-banner { background: linear-gradient(135deg, #3a3010, #4a4018); }
body.dark-mode .paybill-left i, body.dark-mode .paybill-left strong, body.dark-mode .paybill-left small, body.dark-mode .paybill-left span { color: #e0e0e0; }
body.dark-mode .paybill-status { background: #555; }

/* ============ RESPONSIVE ============ */
@media (max-width: 400px) {
    .accounts-grid { gap: 8px; }
    .account-card { padding: 12px; }
    .card-balance { font-size: 17px; }
    .officials-bar { padding: 10px 12px; }
    .official strong { font-size: 12px; }
}
