/* ERP Design System & Dynamic Themes */
:root {
    --primary-rgb: 26, 115, 232;
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    
    /* Light Theme Tokens */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --sidebar-bg: #1e293b;
    --sidebar-text: #f8fafc;
    --sidebar-hover: #334155;
    --sidebar-active: #0284c7;
    --border-color: #dee2e6;
    --header-bg: #ffffff;
}

[data-theme="dark"] {
    /* Dark Theme Tokens */
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar-bg: #0f172a;
    --sidebar-text: #f8fafc;
    --sidebar-hover: #1e293b;
    --sidebar-active: #38bdf8;
    --border-color: #334155;
    --header-bg: #1e293b;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Sidebar Styling */
.sidebar {
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: all 0.3s;
    border-right: 1px solid var(--border-color);
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    opacity: 0.85;
    padding: 0.8rem 1.2rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    border-radius: 6px;
    margin: 2px 10px;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-hover);
    opacity: 1;
}

.sidebar .nav-link.active {
    background-color: var(--sidebar-active);
    color: #fff;
    opacity: 1;
}

.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 1.5rem 1.2rem 0.5rem 1.2rem;
}

/* Top Header */
.top-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    position: fixed;
    top: 0;
    right: 0;
    left: 260px;
    z-index: 99;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

/* Main Content Area */
.main-wrapper {
    margin-left: 260px;
    padding-top: 90px;
    padding-right: 1.5rem;
    padding-left: 1.5rem;
    padding-bottom: 2rem;
    transition: all 0.3s;
}

/* Cards & Containers */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.card-title {
    color: var(--text-color);
}

.table {
    color: var(--text-color);
}

.table th {
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--text-color);
    border-bottom-color: var(--border-color);
}

.table td {
    border-bottom-color: var(--border-color);
    vertical-align: middle;
}

.stat-card {
    border-left: 4px solid var(--primary-color);
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,0.08) !important;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.3;
}

/* Theme Dropdown items */
.theme-item.active {
    background-color: var(--primary-color);
    color: white;
}

/* Auth Page layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .sidebar {
        margin-left: -260px;
    }
    .sidebar.show {
        margin-left: 0;
    }
    .top-header {
        left: 0;
    }
    .main-wrapper {
        margin-left: 0;
    }
}
