:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --secondary: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --bg-main: #F3F4F6;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border: #E5E7EB;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* Soft gradient background */
    background: linear-gradient(135deg, #f3f4f6 0%, #e0e7ff 100%);
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }

/* Utilities */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: #2b5aab;
    border-right: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header i {
    font-size: 28px;
    color: var(--primary);
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.sidebar-menu {
    padding: 20px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item:hover, .menu-item.active {
    background: #fbdc38;
    color: #1e293b;
    font-weight: 600;
}

.menu-item i {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.menu-item:hover i, .menu-item.active i {
    color: #1e293b;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

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

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    font-size: 24px;
    color: var(--text-main);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

.user-info h4 { font-size: 0.9rem; color: var(--text-main); }
.user-info p { font-size: 0.75rem; color: var(--text-muted); }

.content-area {
    padding: 24px;
    flex: 1;
}

/* Dashboard Cards */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--text-main); }
.page-header p { color: var(--text-muted); margin-top: 4px;}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.blue { background: #DBEAFE; color: #2563EB; }
.stat-icon.green { background: #D1FAE5; color: #059669; }
.stat-icon.yellow { background: #FEF3C7; color: #D97706; }
.stat-icon.red { background: #FEE2E2; color: #DC2626; }

.stat-info h3 { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.stat-info p { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }

/* Dashboard Sections */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* List Items */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #F9FAFB;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.task-item.done { border-left-color: var(--secondary); opacity: 0.7; }
.task-item.warning { border-left-color: var(--warning); }

.task-desc h4 { font-size: 0.95rem; font-weight: 600; }
.task-desc p { font-size: 0.8rem; color: var(--text-muted); }

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.login-logo {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 10px;
}

.role-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}
.role-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: #E5E7EB;
    color: var(--text-muted);
    cursor: pointer;
}
.role-badge:hover {
    background: var(--primary-light);
    color: white;
}

/* Print Styles */
@media print {
    body { background: white; }
    .sidebar, .topbar, .no-print { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    .content-area { padding: 0; }
    .card { box-shadow: none; border: 1px solid #000; }
}

/* Responsive */
@media (max-width: 992px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 100;
    }
    .sidebar.active {
        transform: translateX(260px);
    }
    .menu-toggle { display: block; }
}
