/* ============================================
   Nush.ai HR — App Shell Layout
   ============================================ */

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-primary);
}

/* ---- App Shell ---- */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* ---- Header ---- */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
    gap: var(--space-md);
}

.header__left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    white-space: nowrap;
}

.header__logo-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    color: #fff;
}

.header__logo-divider {
    color: var(--text-tertiary);
    font-weight: var(--font-weight-normal);
    margin: 0 var(--space-xs);
}

.header__logo-app {
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

.header__center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 480px;
}

.header__right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.header__action {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.header__action:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header__action .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--brand-magenta);
    border: 2px solid var(--bg-secondary);
}

.header__user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.header__user:hover {
    background: var(--bg-tertiary);
}

.header__user-name {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.header__user-role {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* ---- App Body ---- */

.app-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    margin-top: var(--header-height);
    overflow: hidden;
    height: calc(100vh - var(--header-height));
}

/* ---- Sidebar ---- */

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition-base);
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar__section {
    padding: var(--space-sm) var(--space-sm);
}

.sidebar__section-title {
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: var(--space-sm) var(--space-sm);
    margin-bottom: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar__section-title {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
}

.sidebar__nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-sm);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.sidebar__nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar__nav-item.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--brand-purple);
}

.sidebar__nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 2px 2px 0;
    background: var(--brand-purple);
}

.sidebar__nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar__nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar.collapsed .sidebar__nav-label {
    opacity: 0;
    width: 0;
}

.sidebar__nav-badge {
    font-size: var(--text-xs);
    background: var(--brand-purple);
    color: #fff;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar__nav-badge {
    display: none;
}

.sidebar__divider {
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-sm) var(--space-md);
}

.sidebar__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color var(--transition-fast);
    margin-top: auto;
}

.sidebar__toggle:hover {
    color: var(--text-primary);
}

/* ---- Main Content ---- */

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    background: var(--bg-primary);
}

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

.page-header__title {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.page-header__subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ---- Responsive ---- */

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        bottom: 0;
        z-index: 90;
        transform: translateX(0);
        transition: transform var(--transition-base);
    }

    .sidebar.mobile-hidden {
        transform: translateX(-100%);
    }

    .main-content {
        padding: var(--space-lg);
    }
}

@media (max-width: 640px) {
    .header {
        padding: 0 var(--space-md);
    }

    .header__center {
        display: none;
    }

    .main-content {
        padding: var(--space-md);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
