/* ============================================
   Layout: Sidebar + Header + Content
   Industrial/Engineering Aesthetic
   ============================================ */

/* Auth Layout (centered card) */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    background-image:
        radial-gradient(circle at 1px 1px, rgba(0,0,0,0.05) 1px, transparent 0);
    background-size: 24px 24px;
    padding: 1rem;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.75rem;
    letter-spacing: -0.01em;
}

.auth-card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-align: center;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    background-image: linear-gradient(180deg, #0c1222 0%, #0a0f1c 100%);
    color: var(--text-inverse);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 1.25rem;
    right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, var(--primary) 0%, transparent 100%);
    opacity: 0.4;
}

.sidebar-header svg {
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-inverse);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.sidebar-brand:hover {
    text-decoration: none;
    color: var(--text-inverse);
}

.sidebar-company {
    font-size: 0.6875rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-section {
    padding: 0 0.75rem;
    margin-bottom: 0.25rem;
}

.sidebar-section-title {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    padding: 0.75rem 0.75rem 0.375rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    color: var(--gray-400);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 2px solid transparent;
    margin-left: 0;
    position: relative;
}

.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--gray-200);
    text-decoration: none;
    border-left-color: var(--gray-500);
}

.sidebar-link.active {
    background: var(--bg-sidebar-active);
    color: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.5;
}

.sidebar-link.active svg,
.sidebar-link:hover svg {
    opacity: 0.9;
}

.sidebar-link.active svg {
    color: var(--primary-light);
}

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.header-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.header-breadcrumb a:hover {
    color: var(--primary);
    text-decoration: none;
}

.header-breadcrumb .separator {
    color: var(--gray-300);
    font-size: 0.75rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* User avatar circle */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.375rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition);
}

.hamburger:hover {
    background: var(--gray-50);
}

.hamburger svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1600px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* Notification bell styles (moved from inline) */
.header-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    border: 1px solid transparent;
}

.header-icon-btn:hover {
    background: var(--gray-100);
    color: var(--text-primary);
    border-color: var(--border-color);
    text-decoration: none;
}

.notification-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--danger);
    color: white;
    font-size: 0.5625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .page-content {
        padding: 1rem;
    }

    .form-row {
        flex-direction: column;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .header-breadcrumb {
        display: none;
    }
}

@media (max-width: 480px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
