/* ============= APP CONTAINER ============= */
.app-container { display: none; flex-direction: column; min-height: 100vh; padding-bottom: var(--nav-height); }
.app-container.active { display: flex; }
/* ============= TOP BAR ============= */
.top-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    width: 100%;
}
.app-logo {
    font-size: 18px; font-weight: 800; color: var(--primary);
    display: flex; align-items: center; gap: 8px; letter-spacing: -0.3px;
}
.logo-svg {
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: 7px;
}
.top-bar-right { display: flex; gap: 8px; }
.top-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: transparent; color: var(--text-secondary); font-size: 16px; cursor: pointer;
}
.top-btn:hover { background: var(--primary-light); color: var(--primary); }

/* ============= MAIN CONTENT & SCREENS ============= */
.main-content { flex: 1; padding: 16px; overflow-y: auto; padding-bottom: 100px; }
.screen { display: none; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }

/* ============= BOTTOM NAVIGATION ============= */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--nav-height); background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-around; align-items: center;
    padding: 0 8px; padding-bottom: env(safe-area-inset-bottom); z-index: 200;
}
.nav-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: none; border: none; color: var(--text-muted);
    font-size: 10px; cursor: pointer; padding: 8px 4px;
}
.nav-btn i { font-size: 18px; }
.nav-btn.active { color: var(--primary); }
.nav-btn.active i { transform: scale(1.1); }

/* ============= FAB ============= */
.fab {
    position: fixed; bottom: calc(var(--nav-height) + 16px); right: 16px;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary); color: white; border: none;
    font-size: 24px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    z-index: 150; display: flex; align-items: center; justify-content: center;
}
.fab:active { transform: scale(0.9); }

/* ============= HOME SCREEN CARDS ============= */
.greeting-card {
    display: flex; align-items: center; gap: 16px; padding: 20px;
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 16px;
}
.greeting-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary-light); display: flex; align-items: center; justify-content: center;
}
.greeting-icon i { font-size: 20px; color: var(--primary); }
.greeting-text h2 { font-size: 20px; font-weight: 700; }
.greeting-text p { color: var(--text-secondary); font-size: 14px; }

.time-left-card { padding: 20px; background: var(--primary-light); border-radius: var(--radius); margin-bottom: 16px; }
.time-header { display: flex; align-items: center; gap: 8px; color: var(--primary-dark); font-weight: 600; margin-bottom: 16px; }
.time-display { display: flex; justify-content: space-around; margin-bottom: 12px; }
.time-unit { text-align: center; }
.time-value { display: block; font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; }
.time-label { font-size: 12px; color: var(--text-secondary); }
.time-total { text-align: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.time-quote { font-size: 13px; color: var(--text-secondary); line-height: 1.6; border-top: 1px solid rgba(37, 99, 235, 0.2); padding-top: 16px; }
.time-quote em { color: var(--primary); font-weight: 600; }

.finance-card {
    padding: 20px; background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 16px; cursor: pointer;
}
.finance-card:active { transform: scale(0.98); }
.finance-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.finance-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--primary-light); display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.finance-header span { font-size: 18px; font-weight: 700; flex: 1; }
.finance-eye { color: var(--text-muted); cursor: pointer; padding: 4px; }
.balance-eye-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.balance-eye-btn:hover { color: var(--primary); background: var(--primary-light); }
.balance-eye-btn:active { transform: scale(0.9); }
.finance-header .fa-chevron-right { color: var(--text-muted); font-size: 12px; }
.finance-subtitle { color: var(--text-secondary); font-size: 13px; margin-bottom: 16px; }
.finance-balance { display: flex; gap: 12px; }
.balance-item { flex: 1; padding: 12px; border-radius: var(--radius-sm); background: var(--bg); }
.balance-label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.balance-value { font-size: 16px; font-weight: 700; color: var(--text); }

.user-info-card {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: var(--card-bg); border-radius: var(--radius-sm);
    box-shadow: var(--shadow); margin-bottom: 16px;
}
.user-avatar i { font-size: 36px; color: var(--primary); }
.user-details { flex: 1; }
.user-name { display: block; font-size: 14px; font-weight: 600; }
.user-email { font-size: 11px; color: var(--text-muted); }
.sign-out-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; border-radius: 50%; }
.sign-out-btn:hover { background: var(--red-light); color: var(--red); }

.productivity-pillars { margin-bottom: 16px; }
.productivity-pillars h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.pillars-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pillar-card { padding: 16px; background: var(--card-bg); border-radius: var(--radius-sm); box-shadow: var(--shadow); text-align: center; }
.pillar-icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 16px;
}
.pillar-icon.time { background: var(--blue-light); color: var(--blue); }
.pillar-icon.focus { background: var(--purple-light); color: var(--purple); }
.pillar-icon.energy { background: var(--orange-light); color: var(--orange); }
.pillar-icon.barakah { background: var(--green-light); color: var(--green); }
.pillar-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.pillar-card p { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
.pillar-card.stat-card .stat-value { font-size: 24px; font-weight: 800; color: var(--text); }

.grow-card { padding: 20px; background: linear-gradient(135deg, var(--blue-light), var(--purple-light)); border-radius: var(--radius); margin-bottom: 16px; }
.grow-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.grow-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.grow-link { color: var(--primary); font-size: 13px; font-weight: 600; text-decoration: none; }

/* ============= SHARED FORM STYLES ============= */
.screen-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.back-btn {
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: var(--card-bg); color: var(--text); font-size: 16px; cursor: pointer; box-shadow: var(--shadow);
}
.screen-header h2 { font-size: 20px; font-weight: 700; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-row { display: flex; gap: 12px; }
.form-row .half { flex: 1; }
input, select, textarea {
    width: 100%; padding: 12px 16px;
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    background: var(--card-bg); color: var(--text); font-size: 14px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.amount-input-group { display: flex; gap: 12px; margin-bottom: 20px; }
.amount-input-group input { flex: 2; }
.amount-input-group select { flex: 1; }
.activate-btn, .add-expense-btn, .save-btn {
    width: 100%; padding: 14px; background: var(--primary); color: white;
    border: none; border-radius: var(--radius-xs);
    font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 8px;
}
.sign-out-settings-btn {
    width: 100%; padding: 14px; background: var(--red-light); color: var(--red);
    border: none; border-radius: var(--radius-xs);
    font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 16px;
}
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-header h3 { font-size: 15px; font-weight: 700; }
.see-all { color: var(--primary); font-size: 13px; text-decoration: none; }

/* PWA install button in top bar */
#pwa-topbar-install-btn {
    color: var(--primary) !important;
    background: var(--primary-light) !important;
    position: relative;
}
#pwa-topbar-install-btn::after {
    content: '';
    position: absolute;
    top: 4px; right: 4px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid var(--card-bg);
}
