:root {
    --app-bg: #f4f6f9;
    --app-surface: #ffffff;
    --app-soft: #f8fafc;
    --app-text: #111827;
    --app-muted: #6b7280;
    --app-line: #e5e7eb;
    --app-primary: #0f172a;
    --app-success-bg: #dcfce7;
    --app-warning-bg: #ffedd5;
    --app-danger-bg: #fee2e2;
    --app-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    --app-radius: 1.25rem;
    --app-radius-lg: 1.5rem;
    --header-stack-height: 98px;
    --bottom-nav-height: 88px;
}

html,
body {
    height: 100%;
    min-height: 100%;
    background: linear-gradient(180deg, #eef2f7 0%, #f8fafc 100%);
    color: var(--app-text);
}

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-body {
    height: 100%;
    overflow: hidden;
}

.app-frame {
    width: 100%;
    max-width: 460px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--app-soft);
    box-shadow: var(--app-shadow);
    position: relative;
    overflow: hidden;
}

.app-shell {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
}

@media (min-width: 576px) {
    .app-frame {
        min-height: calc(100dvh - 2rem);
        margin: 1rem auto;
        border: 1px solid rgba(15, 23, 42, 0.08);
        border-radius: 2rem;
    }

    .app-shell {
        height: calc(100dvh - 2rem);
        min-height: calc(100dvh - 2rem);
        max-height: calc(100dvh - 2rem);
    }
}

.fixed-app-header {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 30;
    padding-top: env(safe-area-inset-top);
    background: var(--app-surface);
}

@media (min-width: 576px) {
    .fixed-app-header {
        border-top-left-radius: 2rem;
        border-top-right-radius: 2rem;
        overflow: hidden;
    }
}

.status-bar {
    min-height: 28px;
    font-size: 0.75rem;
    color: var(--app-muted);
    background: var(--app-surface);
}

.topbar {
    min-height: 70px;
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-line);
}

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    font-weight: 700;
    color: var(--app-primary);
    flex-shrink: 0;
}

.app-content {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: calc(var(--header-stack-height) + env(safe-area-inset-top) + 1rem) 1rem calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 1rem);
}

.app-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.hero-card,
.action-tile,
.member-card,
.photo-card,
.camera-shell,
.surface-card {
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius-lg);
    background: var(--app-surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.eyebrow {
    font-size: 0.75rem;
    color: var(--app-muted);
    margin-bottom: 0.25rem;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.hero-meta,
.small-muted {
    color: var(--app-muted);
    font-size: 0.9rem;
}

.action-tile {
    width: 100%;
    text-align: start;
    padding: 1rem;
    transition: transform 0.15s ease;
}

.action-tile:active {
    transform: scale(0.99);
}

.action-tile.primary {
    background: var(--app-primary);
    color: #fff;
    border-color: transparent;
}

.action-tile.primary .small-muted {
    color: rgba(255, 255, 255, 0.8);
}

.action-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: rgba(15, 23, 42, 0.06);
    flex-shrink: 0;
}

.action-tile.primary .action-icon {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.stat-card {
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    padding: 1rem;
    height: 100%;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--app-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.camera-shell {
    padding: 0.875rem;
}

.camera-view {
    aspect-ratio: 3 / 4;
    border-radius: 1.5rem;
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    color: #fff;
}

.scan-frame {
    position: absolute;
    inset: 16% 10%;
    border: 3px solid #4ade80;
    border-radius: 1.5rem;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.08);
}

.result-success {
    background: var(--app-success-bg);
    border: 1px solid #bbf7d0;
    border-radius: 1rem;
    color: #166534;
}

.member-card,
.photo-card {
    padding: 1rem;
}

.search-shell {
    border: 1px solid var(--app-line);
    border-radius: 1rem;
    background: var(--app-surface);
    padding: 0.75rem 0.9rem;
}

.search-shell .form-control {
    border: 0;
    box-shadow: none;
    padding: 0;
    min-height: 1.5rem;
    font-size: 0.95rem;
}

.mini-card {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 1rem;
    padding: 0.85rem;
    height: 100%;
}

.mini-card strong {
    display: block;
    font-size: 1.35rem;
    line-height: 1.1;
    margin-bottom: 0.2rem;
}

.chart-bars {
    height: 180px;
}

.chart-col {
    flex: 1;
    min-width: 0;
}

.chart-bar {
    width: 100%;
    border-radius: 1rem 1rem 0.5rem 0.5rem;
    background: linear-gradient(180deg, #cbd5e1 0%, #0f172a 100%);
    min-height: 12px;
}

.photo-preview {
    aspect-ratio: 1 / 1;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #0f172a;
}

.bottom-nav {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--app-line);
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom));
}

@media (min-width: 576px) {
    .bottom-nav {
        border-bottom-left-radius: 2rem;
        border-bottom-right-radius: 2rem;
    }
}

.nav-btn {
    border: 0;
    background: transparent;
    border-radius: 1rem;
    min-height: 64px;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
}

.nav-btn.active {
    background: var(--app-primary);
    color: #fff;
}

.nav-btn i {
    font-size: 1.15rem;
    line-height: 1;
}

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.login-card {
    width: 100%;
    border: 1px solid var(--app-line);
    border-radius: 1.75rem;
    background: var(--app-surface);
    box-shadow: var(--app-shadow);
}

.brand-mark {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.5rem;
    background: var(--app-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.badge-warning-soft {
    background: var(--app-warning-bg);
    color: #9a3412;
}

.badge-neutral-soft {
    background: #eef2f7;
    color: #475569;
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 1rem;
    background: #fff;
    text-align: center;
    color: var(--app-muted);
}

.quick-list li + li {
    border-top: 1px solid #eef2f7;
}

.status-pill {
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.bg-approved {
    background: #dcfce7;
    color: #166534;
}

.bg-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.bg-pending {
    background: #ffedd5;
    color: #9a3412;
}
