@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
    /* Clean Minimalist Theme */
    --primary-blue: #3B82F6; /* Soft blue */
    --primary-dark: #2563EB;
    --accent-green: #10B981;
    --bright-orange: #F59E0B;
    
    /* Backgrounds & Surface (Clean White) */
    --bg-body: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-sidebar: #FFFFFF; 
    
    /* Text Colors */
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-sidebar: #475569;
    --text-sidebar-hover: #0F172A;
    
    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Utility */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 600; color: var(--text-main); }

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

/* ---- SIDEBAR (Clean Light) ---- */
.sidebar {
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    width: 260px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 50;
    border-right: 1px solid #E2E8F0;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #F1F5F9;
}
.sidebar-header img { max-height: 35px; }
.sidebar-header .brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-left: 0.75rem;
}

.sidebar-nav { flex: 1; padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; }

.nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    color: var(--text-sidebar); text-decoration: none; font-weight: 500; transition: var(--transition);
}
.nav-link i { font-size: 1.2rem; color: var(--text-muted); }

.nav-link:hover { background-color: #F8FAFC; color: var(--text-sidebar-hover); }
.nav-link.active { background-color: #EFF6FF; color: var(--primary-blue); font-weight: 600; }
.nav-link.active i { color: var(--primary-blue); }

.sidebar-footer { padding: 1.5rem; border-top: 1px solid #F1F5F9; display: flex; align-items: center; gap: 0.75rem; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: #EFF6FF; color: var(--primary-blue); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.9rem; border: 1px solid #BFDBFE; }
.user-info { display: flex; flex-direction: column; }
.user-name { font-weight: 600; color: var(--text-main); font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }
.logout-btn { color: #EF4444; font-size: 0.75rem; text-decoration: none; margin-top: 0.25rem; }
.logout-btn:hover { text-decoration: underline; }

/* ---- MAIN CONTENT ---- */
.main-wrapper { flex: 1; display: flex; flex-direction: column; }
.topbar { background: var(--bg-card); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #E2E8F0; }
.page-title { font-size: 1.25rem; font-weight: 600; color: var(--text-main); }
.dashboard-content { padding: 2rem; display: grid; gap: 1.5rem; grid-template-columns: 1fr; }

/* ---- CARDS ---- */
.card {
    background: var(--bg-card); border-radius: var(--radius-lg); padding: 1.5rem;
    box-shadow: var(--shadow-sm); border: 1px solid #E2E8F0; transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title { font-size: 1.05rem; color: var(--text-main); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.card-title i { color: var(--text-muted); }

/* ---- STATS GRID ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.stat-card {
    background: var(--bg-card); border-radius: var(--radius-lg); padding: 1.5rem;
    border: 1px solid #E2E8F0; display: flex; align-items: center; gap: 1rem;
}
.stat-icon { width: 50px; height: 50px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.stat-blue { background: #EFF6FF; color: #3B82F6; }
.stat-green { background: #ECFDF5; color: #10B981; }
.stat-orange { background: #FEF3C7; color: #F59E0B; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;}

/* ---- PROGRESS BAR ---- */
.progress-wrapper { margin-top: 1rem; }
.progress-container { width: 100%; background-color: #F1F5F9; border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary-blue); width: 0%; border-radius: 99px; transition: width 1.5s ease; }

/* ---- BADGES ---- */
.badges-grid { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.badge-item { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.badge-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: white; }
.badge-gold { background: #FBBF24; color: #78350F; }
.badge-silver { background: #CBD5E1; color: #334155; }
.badge-bronze { background: #FDBA74; color: #7C2D12; }
.badge-name { font-size: 0.8rem; font-weight: 500; color: var(--text-main); }

/* ---- TABLES/LISTS ---- */
table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #F1F5F9; font-size: 0.9rem; }
th { background: transparent; font-weight: 600; color: var(--text-muted); font-size: 0.8rem; border-bottom: 2px solid #E2E8F0; }
.badge-role { padding: 0.2rem 0.6rem; border-radius: 4px; font-size: 0.7rem; font-weight: 600; }
.role-admin { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.role-professor { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.role-aluno { background: #F8FAFC; color: #475569; border: 1px solid #E2E8F0; }
.data-list { list-style: none; }
.data-item { padding: 1rem 0; border-bottom: 1px solid #F1F5F9; display: flex; justify-content: space-between; align-items: center; }

/* ---- BUTTONS ---- */
.btn { padding: 0.5rem 1rem; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 500; font-family: var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.btn-primary { background-color: var(--primary-blue); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); }

/* ---- MOBILE MENU TOGGLE ---- */
.mobile-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: var(--text-main); cursor: pointer; }

/* ---- RESPONSIVE ---- */
@media (min-width: 1024px) {
    .app-container { flex-direction: row; }
    .dashboard-content { grid-template-columns: repeat(2, 1fr); }
    .col-span-2 { grid-column: span 2; }
}
@media (max-width: 1023px) {
    .sidebar { position: fixed; left: -260px; height: 100vh; box-shadow: var(--shadow-lg); border-right: none;}
    .sidebar.open { left: 0; }
    .mobile-toggle { display: block; }
}
