:root {
  --primary: #1a5cff;
  --primary-dark: #1243c7;
  --secondary: #6c757d;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-color: #212529;
  --border-color: #dee2e6;
  --sidebar-bg: #ffffff;
  --sidebar-text: #333;
  --header-height: 60px;
  --sidebar-width: 250px;
  --glass: rgba(255, 255, 255, 0.7);
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  --primary: #3d79ff;
  --primary-dark: #1a5cff;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-color: #f1f5f9;
  --border-color: #334155;
  --sidebar-bg: #1e293b;
  --sidebar-text: #f1f5f9;
  --glass: rgba(30, 41, 59, 0.7);
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition:
    background-color 0.3s,
    color 0.3s;
  min-height: 100vh;
}

/* Glassmorphism */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  border-radius: 12px;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
}

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

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

/* Layout */
.app-container {
    display: flex;
}

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    padding: 20px 0;
    z-index: 900;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    flex: 1;
    padding: 20px;
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s;
    width: calc(100% - var(--sidebar-width));
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 850;
    backdrop-filter: blur(4px);
}

.burger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 15px;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .burger-btn {
        display: block;
    }
    .mobile-overlay.active {
        display: block;
    }
    
    /* Responsive Grids */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
    padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  text-align: center;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
}

.school-logo {
  width: 80px;
  margin-bottom: 20px;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

/* Responsive Tables */
.table-container {
    overflow-x: auto;
    width: 100%;
    margin-top: 15px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

/* Card Adjustments */
@media (max-width: 600px) {
    .glass-card {
        padding: 15px !important;
    }
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.25rem !important; }
}
