:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --dark-bg: #1a1a1a;
    --card-bg: #ffffff;
    --text-color: #333333;
    --sidebar-width: 250px;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    left: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

.sidebar.hidden {
    left: -260px;
}

.sidebar-logo {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo img {
    max-width: 120px;
    height: auto;
    filter: brightness(0) invert(1); /* Makes logo white for dark sidebar */
}

.sidebar h2 {
    font-size: 1rem;
    margin-top: 0.5rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 0.5rem;
}

.sidebar ul li a {
    color: #bdc3c7;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.sidebar ul li a i {
    margin-right: 0.8rem;
}

.sidebar ul li a:hover, .sidebar ul li a.active {
    background-color: var(--secondary-color);
    color: white;
    transform: translateX(5px);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    width: 100%;
}

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

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #eee;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    margin-right: 1.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.sidebar-toggle:hover {
    background: #f8f9fa;
    color: var(--accent-color);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 1000;
}

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

/* Card Styles */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.2rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0,0,0,0.05);
    width: 100%;
    overflow: hidden;
}

.card h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
}

.stat-card .label {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-bottom: 0.3rem;
}

.stat-card .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Dashboard Grid Rows */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.dashboard-row-alt {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1.5px solid #eee;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: border-color 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Login Specific */
.login-logo {
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-logo img {
    max-width: 150px;
    height: auto;
}
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

/* Charts */
.chart-container {
    width: 100%;
    height: 100%;
    min-height: 250px;
    position: relative;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        left: -260px;
    }
    
    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .dashboard-row, .dashboard-row-alt {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .header-meta {
        text-align: left !important;
    }
    .card { padding: 1rem; }
    .btn { width: 100%; margin-bottom: 0.5rem; }
}
