/* 
 * CSS Biến (Design System)
 * Định nghĩa màu sắc (Light mode), typography, bóng đổ.
 */
:root {
    /* Colors - Light Theme */
    --primary-color: #0F52BA;
    /* Petrol Blue */
    --primary-hover: #0D459D;
    --accent-color: #FF6B35;
    /* Fuel Orange */
    --accent-hover: #E55C2A;

    /* Backgrounds */
    --bg-body: #F4F7FE;
    --bg-panel: #FFFFFF;
    --bg-sidebar: #FFFFFF;
    /* Sidebar sáng */
    --bg-hover: #F0F4F8;

    /* Text */
    --text-main: #2B3674;
    --text-secondary: #A3AED0;
    --text-sidebar: #2B3674;
    --text-sidebar-muted: #A3AED0;

    /* Borders & Shadows */
    --border-color: #E2E8F0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.05);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Layout Core */
#app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: var(--transition-normal);
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    overflow: hidden;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 4px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar-muted);
    text-decoration: none;
    transition: var(--transition-fast);
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
    background-color: var(--bg-hover);
}

.nav-item .icon {
    margin-right: 12px;
    font-size: 1.3rem;
    transition: var(--transition-fast);
}

/* Collapsed Sidebar */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    display: none;
}

.sidebar.collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
}

.sidebar.collapsed .nav-item .icon {
    margin-right: 0;
    font-size: 1.5rem;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Cho phép scroll bên trong view */
}

/* Header */
.app-header {
    height: 70px;
    background-color: var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

#toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

#page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-role {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* View Container */
.view-container {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.view {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide number input arrows */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield;
}
.nav-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 20px 0 5px 20px;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}
