:root {
    --primary-bg: #f1f5f9;
    --sidebar-bg: #0f172a;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --font-family: 'Inter', 'Roboto', sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-main);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
}

/* Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: white;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    list-style: none;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: #1e293b;
    color: white;
    border-left: 3px solid var(--accent-color);
}

.sidebar-link i, .sidebar-link span.icon {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - 250px);
    overflow-x: hidden;
}

.topbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dashboard-content {
    padding: 2rem;
    overflow-y: auto;
}

/* Grid System */
.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-split-70-30 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Components */
.card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: box-shadow 0.2s;
    height: 100%;
    box-sizing: border-box;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.2;
    color: var(--accent-color);
    margin-right: 1rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: block;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

.modern-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.modern-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
    vertical-align: middle;
}

.modern-table tr:hover td {
    background-color: #f8fafc;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #4f46e5);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: white;
    border: 1px solid #e2e8f0;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

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

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.badge-success { background-color: #dcfce7; color: #166534; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-info { background-color: #e0f2fe; color: #075985; }

/* Login Page Styles */
.login-container {
    display: flex;
    min-height: 100vh;
}

.login-brand {
    flex: 1;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

.login-form-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    background-color: white;
}

.login-form-box {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-block {
    width: 100%;
}

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

.section-header h2, .section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-main);
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Utilities */
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.mr-2 { margin-right: 0.5rem; }

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        overflow: visible;
    }
    .main-content {
        width: 100%;
    }
    .grid-cols-3, .grid-cols-2, .grid-split-70-30 {
        grid-template-columns: 1fr;
    }
    .login-container {
        flex-direction: column;
    }
    .login-brand {
        display: none;
    }
    .login-form-container {
        padding: 2rem;
    }
}

/* Dropdown Menu */
.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; right: 0; background-color: white; min-width: 160px; box-shadow: var(--shadow-md); z-index: 100; border-radius: 0.5rem; border: 1px solid #e2e8f0; }
.dropdown:hover .dropdown-content { display: block; }
.dropdown-item { color: var(--text-main); padding: 10px 16px; text-decoration: none; display: block; font-size: 0.875rem; text-align: left; background: none; border: none; width: 100%; cursor: pointer; }
.dropdown-item:hover { background-color: #f1f5f9; }
.icon-btn { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--text-muted); padding: 0.25rem; border-radius: 50%; }
.icon-btn:hover { color: var(--text-main); background-color: #f1f5f9; }
