/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Enterprise Color Palette (Inspired by WD-ERP) */
    --primary: #1A365D;
    --primary-dark: #112a4a;
    --primary-light: #2a4c7e;
    --secondary: #2D3748;
    --accent: #D97706;
    
    /* Sidebar (Dark Theme) */
    --side-bg: #1A202C; /* Deep Dark Gray/Blue */
    --side-bg-hover: #2D3748;
    --side-active: #2C5282;
    --side-text: #E2E8F0;
    --side-text-muted: #A0AEC0;
    
    /* Main Content */
    --bg-main: #F7FAFC;
    --surface: #FFFFFF;
    --border: #E2E8F0;
    
    /* Text */
    --text-primary: #1A202C;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    
    /* Status */
    --success: #38A169;
    --danger: #E53E3E;
    --warning: #DD6B20;
    --info: #3182CE;
    
    /* Shadows & Radius */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout Wrapper */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- ADVANCED SIDEBAR (DARK) --- */
.sidebar {
    width: 280px;
    background-color: var(--side-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar.minimized {
    width: 85px;
}

/* Brand Header */
.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.sidebar-brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.logo-container {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    flex-shrink: 0;
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-text {
    font-weight: 800;
    font-size: 1.1rem;
    white-space: nowrap;
    letter-spacing: -0.5px;
    transition: opacity 0.3s;
}

.sidebar.minimized .brand-text {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Nav Menu */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 12px;
}

.nav-section-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--side-text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    margin: 20px 12px 10px;
    transition: opacity 0.3s;
}

.sidebar.minimized .nav-section-label {
    opacity: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--side-text);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.nav-link:hover {
    background-color: var(--side-bg-hover);
    color: white;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

.nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-link-text {
    white-space: nowrap;
    transition: opacity 0.3s;
}

.sidebar.minimized .nav-link-text {
    opacity: 0;
}

/* Sidebar Footer (Profile) */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    overflow: hidden;
}

.user-profile-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: var(--side-text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.sidebar.minimized .user-info-sidebar {
    display: none;
}

/* --- MAIN CONTENT AREA --- */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px;
    transition: var(--transition);
    max-width: calc(100% - 280px);
}

.sidebar.minimized ~ .main-content {
    margin-left: 85px;
    max-width: calc(100% - 85px);
}

/* Header & Typography */
.page-header {
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(44, 82, 130, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(44, 82, 130, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(44, 82, 130, 0.05);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background: #F8FAFC;
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    vertical-align: middle;
}

td {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    background: white;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #F1F5F9;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
}

.badge-success { background: #DCFCE7; color: #15803D; }
.badge-danger { background: #FEE2E2; color: #B91C1C; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-info { background: #DBEAFE; color: #1D4ED8; }

/* Dashboard Specific Extras */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-icon-bg {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.05;
    transform: rotate(-15deg);
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-up {
    animation: fadeInUp 0.5s ease forwards;
}

/* Login Overrides */
.app-container.login-page {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1A365D 0%, #1A202C 100%);
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 48px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Mobile Adjustments */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        max-width: 100% !important;
        padding: 20px;
    }
}
