:root {
  /* Colors */
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --secondary: #0EA5E9;
  --accent: #F43F5E;
  --success: #10B981;
  --warning: #F59E0B;
  --text-main: #1F2937;
  --text-muted: #6B7280;
  --bg-body: #F3F4F6;
  --bg-card: #FFFFFF;
  --border-light: #E5E7EB;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 10px 40px -10px rgba(0,0,0,0.08);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

/* Reset & Base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: --bg-body;
  background: #F3F4F6; /* Fallback */
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
  color: var(--text-muted);
}

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

/* Sidebar */
.sidebar {
  width: 280px;
  background: #FFFFFF;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

.sidebar-header {
  padding: var(--space-lg) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.nav-links {
  padding: 0 var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item:hover {
  background: #F3F4F6;
  color: var(--primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(14, 165, 233, 0.1) 100%);
  color: var(--primary);
  font-weight: 600;
}

.nav-icon {
  width: 20px;
  height: 20px;
  background-color: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  /* Placeholder for actual icons using CSS mask if needed, or just blocks */
  opacity: 0.8;
}

/* Main Content */
.main-content {
  margin-left: 280px;
  flex: 1;
  padding: var(--space-lg);
  width: calc(100% - 280px);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.page-title h1 {
  font-size: 1.875rem;
  margin-bottom: 0.25rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.5rem;
  background: white;
  border-radius: 2rem;
  padding-right: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.avatar {
  width: 40px;
  height: 40px;
  background-color: var(--border-light);
  border-radius: 50%;
  background-image: linear-gradient(to bottom right, #C4B5FD, #818CF8);
}

/* Grid & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
  border: 1px solid rgba(255,255,255,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(0,0,0,0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Stats Card */
.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-xs);
}

.stat-trend {
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--accent); }

/* Table */
.table-container {
  overflow-x: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  text-align: left;
  padding: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
}

td {
  padding: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FFE4E6; color: #9F1239; }
.badge-neutral { background: #F3F4F6; color: #374151; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

.btn-outline {
  background: white;
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Utilities */
.text-right { text-align: right; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }

/* Schedule Component */
.schedule-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
}

.schedule-item:last-child {
  border-bottom: none;
}

.time-slot {
  width: 80px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
}

.time-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.class-details {
  flex: 1;
}

.class-name {
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.class-room {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Placeholders */
.placeholder-icon {
  width: 24px;
  height: 24px;
  background: #E5E7EB;
  border-radius: 4px;
  display: inline-block;
}

.placeholder-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #E5E7EB;
  display: inline-block;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #E5E7EB;
  border-radius: 5px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: var(--space-md);
  }
  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
}
