:root {
  /* Colors - Dark Mode Default */
  --bg-body: #09090b;
  --bg-card: #18181b;
  --bg-elevated: #27272a;
  --bg-hover: #3f3f46;
  
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --border-color: #3f3f46;
  --border-focus: #71717a;
  
  /* Accents */
  --accent-primary: #8b5cf6; /* Violet */
  --accent-secondary: #06b6d4; /* Cyan */
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #8B5CF6 100%);
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Layout */
  --header-height: 70px;
  --sidebar-width: 260px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
  --shadow-accent: 0 4px 14px 0 rgba(139, 92, 246, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 var(--spacing-md) 0; color: var(--text-secondary); }

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-primary);
}

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

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: var(--spacing-lg);
  position: fixed;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 100;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--spacing-lg);
  max-width: 100%;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

/* Components */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-lg);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--bg-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 0.95rem;
  gap: var(--spacing-sm);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-secondary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

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

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-xs);
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  background-color: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-link.active {
  border-left: 3px solid var(--accent-primary);
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--spacing-xl);
}

/* Grid & Utilities */
.grid {
  display: grid;
  gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

@media (max-width: 768px) {
  .sidebar { display: none; } /* Simplified for prototype, would be a hamburger menu */
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-primary);
}

.table th, .table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background-color: var(--bg-elevated);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.table tr:hover td {
  background-color: var(--bg-elevated);
}

/* Badges & Status */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success { background-color: rgba(16, 185, 129, 0.2); color: var(--accent-success); }
.badge-warning { background-color: rgba(245, 158, 11, 0.2); color: var(--accent-warning); }
.badge-danger { background-color: rgba(239, 68, 68, 0.2); color: var(--accent-danger); }
.badge-neutral { background-color: var(--bg-elevated); color: var(--text-secondary); }

/* Avatars */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-secondary);
  border: 2px solid var(--bg-card);
}

.avatar-group {
  display: flex;
  margin-left: 10px;
}
.avatar-group .avatar {
  margin-left: -10px;
  border-color: var(--bg-card);
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Stats */
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.progress-bar {
  height: 6px;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--spacing-sm);
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
}

/* Attendance Grid Specifics */
.attendance-grid {
  display: flex;
  gap: var(--spacing-xs);
}

.attendance-pill {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid transparent;
}

.attendance-pill.present { background-color: rgba(16, 185, 129, 0.1); color: var(--accent-success); border-color: rgba(16, 185, 129, 0.2); }
.attendance-pill.absent { background-color: rgba(239, 68, 68, 0.1); color: var(--accent-danger); border-color: rgba(239, 68, 68, 0.2); }
.attendance-pill.late { background-color: rgba(245, 158, 11, 0.1); color: var(--accent-warning); border-color: rgba(245, 158, 11, 0.2); }

.placeholder-icon {
  width: 20px;
  height: 20px;
  background-color: currentColor;
  mask-size: contain;
  mask-position: center;
  mask-repeat: no-repeat;
  display: inline-block;
}

.search-bar {
  max-width: 400px;
  position: relative;
}

.search-input {
  width: 100%;
  padding-left: 40px;
}

/* Utilities */
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.avatar-lg {
  width: 100px;
  height: 100px;
  font-size: 2rem;
}

/* Charts */
.chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    padding-top: 20px;
}
.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}
.chart-bar {
    width: 40px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.3s;
    position: relative;
}
.chart-bar.active {
    background: var(--accent-gradient);
}
.chart-label {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.donut-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(
        var(--accent-success) 0% 75%, 
        var(--accent-warning) 75% 85%, 
        var(--accent-danger) 85% 100%
    );
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.donut-hole {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.legend-dot {
    width: 10px; 
    height: 10px; 
    border-radius: 50%; 
    display: inline-block;
}
.w-full { width: 100%; }
.text-center { text-align: center; }
