:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --danger: #ef4444;
    --success: #22c55e;
}

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

body {
    background-color: #f1f5f9;
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
}

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

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

.page.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: fixed;
    height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--secondary);
    font-weight: 500;
}

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

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    max-width: calc(100vw - 260px);
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.date-badge {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* Tables */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

/* Actions */
.btn-action {
    padding: 0.4rem 0.8rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

.btn-edit {
    background: #e0f2fe;
    color: #0369a1;
}

.btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-edit:hover {
    background: #bae6fd;
}

.btn-delete:hover {
    background: #fecaca;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
}

input,
select {
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Layout variations */
.layout-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Hidden by default */
.page {
    display: none;
}

.page.active {
    display: block;
}