/* Winters Family Finance Dashboard - Layout */

/* ============================================
   APP SHELL
   ============================================ */
.app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
}

.app-header {
    position: sticky;
    top: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    padding: var(--space-md);
    padding-top: calc(var(--space-md) + var(--safe-top));
    z-index: 50;
}

.app-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.app-greeting {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.app-date {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.app-main {
    flex: 1;
    padding: var(--space-md);
    padding-bottom: calc(var(--nav-height) + var(--space-md) + var(--safe-bottom));
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border-light);
    padding-bottom: var(--safe-bottom);
    z-index: 100;
}

.bottom-nav-content {
    display: flex;
    justify-content: space-around;
    max-width: 600px;
    margin: 0 auto;
    height: var(--nav-height);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--font-size-xs);
    font-weight: 500;
    transition: color var(--transition-fast);
    padding: var(--space-sm);
    border: none;
    background: none;
    cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
    color: var(--color-primary);
}

.nav-icon {
    font-size: 24px;
}

/* Special "Log" button in center */
.nav-item-log {
    position: relative;
}

.nav-item-log .nav-icon-wrapper {
    background: var(--color-primary);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -16px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast);
}

.nav-item-log:hover .nav-icon-wrapper {
    transform: scale(1.05);
}

.nav-item-log:active .nav-icon-wrapper {
    transform: scale(0.95);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: var(--color-bg);
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--color-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-lg);
}

.login-logo-icon {
    font-size: 40px;
    color: white;
}

.login-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
    text-align: center;
}

.login-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.login-form {
    width: 100%;
    max-width: 320px;
}

.login-error {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
    display: none;
}

.login-error.show {
    display: block;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    margin-bottom: var(--space-lg);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.section-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-action {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

/* ============================================
   VIEW CONTAINERS
   ============================================ */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
    .app-main {
        padding: var(--space-lg);
    }

    .metric-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
