/**
 * App-style page layout (Profile Visitors reference)
 * Uses existing Rishthe color variables only — layout/spacing only
 */

.page-app-layout {
    background: var(--soft-bg);
}

/* Mobile: app top bar replaces logo header when appPageTitle is set */
@media (max-width: 991.98px) {
    body.page-app-layout:not(.page-dashboard):not(.page-notifications) .rishthe-navbar.site-header {
        display: none !important;
    }

    body.page-app-layout:not(.page-dashboard):not(.page-notifications) {
        padding-top: var(--nav-total-height) !important;
    }
}

/* Purple app bar — mobile */
.app-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--nav-total-height);
    padding: var(--nav-offset-top) 0.85rem 0;
    background: var(--gradient-brand);
    box-shadow: 0 2px 8px rgba(91, 31, 150, 0.2);
}

.app-top-bar__menu {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    font-size: 1.15rem;
    flex-shrink: 0;
    cursor: pointer;
}

.app-top-bar__menu:hover,
.app-top-bar__menu:focus {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
    outline: none;
}

.app-top-bar__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-body);
}

/* Content area heading */
.app-layout {
    padding-bottom: calc(var(--bottom-nav-height) + 1rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 992px) {
    .app-layout {
        padding-bottom: 2rem;
    }
}

.app-page-head {
    padding: 1rem 0 0.85rem;
    margin: 0;
}

.app-page-head__title {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.25;
}

.app-page-head__subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.app-feed {
    gap: 0.85rem;
}

.app-feed:not(.profiles-grid) {
    display: flex;
    flex-direction: column;
}

.app-feed--padded {
    padding-bottom: 0.5rem;
}

/* Dashboard in app layout — single column feed */
.page-app-layout .dashboard-layout {
    display: block;
    max-width: 720px;
    margin: 0 auto;
    padding-top: 0.75rem;
}

@media (min-width: 992px) {
    .page-app-layout .dashboard-layout {
        max-width: 1280px;
        padding-top: 0;
    }
}

.page-app-layout .dashboard-page {
    min-height: auto;
}

.page-app-layout .app-mini-stats {
    margin-bottom: 1rem;
}

/* App mini-stats as compact row */
.page-app-layout .app-mini-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.page-app-layout .app-mini-stat {
    text-decoration: none;
    color: inherit;
}
