:root {
    --primary: #0F172A;          /* Deep slate blue */
    --primary-hover: #1E293B;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text-main: #0F172A;        /* Very dark blue text for crisp contrast */
    --text-muted: #64748B;
    --border: #E2E8F0;
    --danger: #E11D48;           /* Professional crisp red */
    --success: #059669;          /* Professional crisp green */
    --radius: 8px;               /* Slightly sharper edges look more professional than 12px */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    margin: 0;
    font-family: 'Rubik', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Layout */
.sidebar {
    width: 260px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 32px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand i {
    font-size: 1.5rem;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    transition: var(--transition);
    gap: 12px;
}

.nav-item i {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
}

.nav-item:hover, .nav-item.active {
    background-color: var(--primary);
    color: white;
}

.nav-item:hover i, .nav-item.active i {
    color: white;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Topbar */
.topbar {
    height: 70px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Content Container */
.container {
    padding: 32px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography & Utilities */
h1 { margin: 0 0 24px 0; font-size: 2rem; font-weight: 700; }
h2 { margin: 0 0 16px 0; font-size: 1.5rem; font-weight: 600; }
a { color: var(--primary); text-decoration: none; }

/* Cards & Forms */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    box-sizing: border-box;
    transition: var(--transition);
    background-color: #FAFAFA;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
    background-color: var(--surface);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.2);
}

.btn-danger { background-color: var(--danger); color: white; }
.btn-success { background-color: var(--success); color: white; }
.btn-outline { background-color: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background-color: var(--background); }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background-color: #F8FAFC;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

tr:last-child td { border-bottom: none; }

tr:hover td {
    background-color: #F8FAFC;
}

/* Flash Messages */
.flash-messages { margin-bottom: 24px; }
.flash {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.3s;
}
.flash.success { background-color: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.flash.error { background-color: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.flash.info { background-color: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
}
.badge-success { background: #ECFDF5; color: #059669; }
.badge-danger { background: #FEF2F2; color: #DC2626; }
.badge-warning { background: #FFFBEB; color: #D97706; }

/* Print Styles */
@media print {
    body { background: white; margin: 0; padding: 0; min-height: auto; display: block; }
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content, .container { padding: 0; margin: 0; box-shadow: none; max-width: 100%; border: none; }
    .card { border: none; box-shadow: none; padding: 0; }
    /* Reset animations */
    * { animation: none !important; transition: none !important; }
}

/* Dashboard Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    gap: 20px;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(15, 23, 42, 0.05);
    color: var(--primary);
}
.stat-details h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}
.stat-details p {
    margin: 4px 0 0 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}
