/* ==========================================================================
   Payslip Hub App Shell Layout & Navigation
   ========================================================================== */

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
}

/* App Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-icon svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover, .btn-icon:active {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

.user-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 2px solid var(--primary);
    cursor: pointer;
}

.user-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Views Container */
.views-container {
    flex: 1;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
}

.view-section {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    color: var(--text-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px 0;
}

.nav-tab svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    transition: transform 0.2s ease, stroke 0.2s ease;
}

.nav-tab span {
    font-size: 0.72rem;
    font-weight: 500;
}

.nav-tab.active {
    color: var(--primary-light);
}

.nav-tab.active svg {
    transform: translateY(-2px);
    stroke: var(--primary-light);
}
/* Sticky Employer Context Bar */
.company-strip {
    position: sticky;
    top: var(--header-height);
    z-index: 35;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-subtle);
    padding: 6px 16px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.company-strip-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.company-strip-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.company-strip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    flex-shrink: 0;
}

.company-strip-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    flex-shrink: 0;
}

.company-select-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 320px;
    min-width: 0;
}

.company-strip-select {
    width: 100%;
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.company-strip-select:hover, .company-strip-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.company-strip-right {
    flex-shrink: 0;
}

.company-strip-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

@media (max-width: 480px) {
    .company-strip {
        padding: 5px 12px;
    }
    .company-strip-label {
        display: none;
    }
    .company-strip-select {
        font-size: 0.78rem;
        padding: 4px 8px;
    }
    .company-strip-badge {
        font-size: 0.68rem;
        padding: 2px 6px;
    }
}

@media (max-width: 380px) {
    .nav-tab {
        padding: 2px 0;
    }
    .nav-tab svg {
        width: 20px;
        height: 20px;
    }
    .nav-tab span {
        font-size: 0.65rem;
        letter-spacing: -0.02em;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    right: 16px;
    left: 16px;
    max-width: 420px;
    margin: 0 auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideDown 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(12px);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.danger { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--info); }

@keyframes toastSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
