:root {
    --primary: #1a73e8;
    --primary-light: #e8f0fe;
    --primary-dark: #1558d6;
    --secondary: #188038;
    --accent: #f29900;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text-main: #202124;
    --text-muted: #5f6368;
    --border: #dadce0;
    --radius: 8px;
    --shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-lg: 0 4px 6px -1px rgba(60,64,67,0.1), 0 2px 4px -1px rgba(60,64,67,0.06);
}

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

body {
    background-color: var(--background);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--surface);
    padding: 2rem 1.5rem;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: width 0.3s ease, padding 0.3s ease;
    overflow-x: hidden;
}

.sidebar.collapsed {
    width: 80px;
    padding: 2rem 0.5rem;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    padding: 0 0.5rem;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

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

.sidebar.collapsed .logo h2 {
    display: none;
}

.sidebar.collapsed .toggle-btn {
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo h2 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    padding: 0.8rem 1.2rem;
    border-radius: 0 24px 24px 0;
    margin-left: -1.5rem;
    padding-left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sidebar.collapsed .nav-links a {
    border-radius: 12px;
    margin-left: 0;
    padding: 0.8rem;
    justify-content: center;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.nav-icon {
    font-size: 1.2rem;
}

.nav-links a:hover {
    background: #f1f3f4;
    transform: translateX(4px);
}

.nav-links a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

header {
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
}

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

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
}

.stat-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.1), 0 6px 6px rgba(0,0,0,0.05);
    transform: translateY(-5px);
}

.stat-card.primary-gradient {
    background: var(--primary);
    color: white;
}

.stat-card.primary-gradient .stat-info h3,
.stat-card.primary-gradient .stat-number {
    color: white;
}

.stat-icon {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card:not(.primary-gradient) .stat-icon {
    background: var(--primary-light);
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-main);
}

/* Modern Forms (Google Material Style) */
.form-container {
    max-width: 900px;
}

.page-title {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 500;
}

.form-section {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.form-section-header span {
    font-size: 1.5rem;
}

.form-section h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Material Inputs */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.form-group {
    position: relative;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    background: #f1f3f4;
    border: 1px solid transparent;
    border-bottom: 2px solid var(--text-muted);
    border-radius: 4px 4px 0 0;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    background: #e8f0fe;
    border-bottom-color: var(--primary);
}

/* Drag and Drop Upload Area */
.upload-area {
    position: relative;
    border: 2px dashed #b5c2d3;
    border-radius: 12px;
    padding: 3rem 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    background: transparent;
    cursor: pointer;
}

.upload-area:hover {
    background: #f8fafc;
    border-color: var(--primary);
}

.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    pointer-events: none;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #0f172a;
}

.upload-btn-fake {
    background: white;
    padding: 0.8rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    font-weight: 500;
    color: #0f172a;
    border: 1px solid #f1f5f9;
}

.upload-desc {
    color: #64748b;
    font-size: 0.9rem;
}

/* Class Grid specific */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.class-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem;
}

.class-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
    font-weight: 500;
    font-size: 1rem;
}

.input-row {
    display: flex;
    gap: 1rem;
}

.input-col {
    flex: 1;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.25px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
}

.form-actions {
    margin-top: 1.5rem;
    text-align: right;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
}

.alert.success {
    background: #e6f4ea;
    color: #137333;
}

/* Data Table Section */
.table-container {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-top: 1rem;
}

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

.table-header h3 {
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 500;
}

.btn-success {
    background: var(--secondary);
    color: white;
    text-decoration: none;
}

.btn-success:hover {
    background: #146c2e;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    table-layout: fixed;
}

.data-table th, .data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

/* Proportional Columns */
.data-table th:nth-child(1) { width: 5%; }
.data-table th:nth-child(2) { width: 30%; }
.data-table th:nth-child(3) { width: 15%; }
.data-table th:nth-child(4) { width: 15%; }
.data-table th:nth-child(5) { width: 15%; }
.data-table th:nth-child(6) { width: 20%; }

.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    border-bottom: 2px solid var(--border);
}

.data-table tbody tr:hover {
    background: var(--background);
}

.font-bold {
    font-weight: 500;
    color: var(--text-main);
}

.text-center {
    text-align: center;
}

/* Badges */
.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
}

.badge-sd { background: #fce8e6; color: #c5221f; }
.badge-smp { background: #e8f0fe; color: #1967d2; }
.badge-sma { background: #fef7e0; color: #ea8600; }
