/* ==========================================================================
   LifeOS System Design Foundations & CSS Variables
   ========================================================================== */
:root {
    --bg-primary: #09090b;
    --bg-surface: #18181b;
    --bg-surface-hover: #27272a;
    
    --border-color: #27272a;
    --border-color-focus: #3f3f46;
    
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    
    --accent-color: #3b82f6;
    --accent-color-rgb: 59, 130, 246;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    
    --font-stack: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --header-height: 56px;
    --footer-height: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.5;
    overflow: hidden; /* AppShell manages scrolling context internally */
}

/* ==========================================================================
   AppShell Core Layout Scaffolding Structure
   ========================================================================== */
.lifeos-shell-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Header Context Architecture */
.lifeos-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    min-height: var(--header-height);
    z-index: 50;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    font-size: 1.25rem;
}

.brand-title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-text {
    font-family: monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Main Content Area Sub-scaffold */
.lifeos-main-content {
    flex: 1 1 0%;
 /* FIX: Force container height bounds so scrolling triggers correctly */
    height: calc(100vh - var(--header-height) - var(--footer-height)); 
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling inertia for iOS */
    
    position: relative;
    padding: 16px;
}

@media (min-width: 768px) {
    .lifeos-main-content {
        max-width: 768px;
        margin: 0 auto;
        width: 100%;
        padding: 24px 16px;
    }
}

/* Footer & Bottom Navigation Architecture */
.lifeos-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    height: var(--footer-height);
    min-height: var(--footer-height);
    z-index: 50;
}

.bottom-nav-bar {
    display: flex;
    height: 100%;
    width: 100%;
    align-items: center;
    justify-content: space-around;
}

.nav-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.15s ease, background-color 0.15s ease;
    gap: 2px;
}

.nav-tab-icon {
    font-size: 1.25rem;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-tab-label {
    font-size: 0.687rem;
    font-weight: 500;
}

/* Interactivity States */
.nav-tab-item:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-hover);
}

.nav-tab-item.active {
    color: var(--accent-color);
}

.nav-tab-item.active .nav-tab-icon {
    transform: scale(1.15);
}

/* ==========================================================================
   Generic Components & View Shell Fallbacks
   ========================================================================== */
.view-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: monospace;
}
/* ==========================================================================
   Mobile-First Quick Capture UI Overlay Components
   ========================================================================== */
.mobile-fab-trigger {
    position: fixed;
    bottom: calc(var(--footer-height) + 16px);
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: #fafafa;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.mobile-fab-trigger:active {
    transform: scale(0.9);
}

.capture-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: flex-end; /* Slides open from bottom on mobile layout screens */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.capture-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.capture-overlay-content {
    width: 100%;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.capture-overlay.open .capture-overlay-content {
    transform: translateY(0);
}

