/* ==========================================================================
   SAGES KILEPAL - PREMIUM CORE STYLES
   ========================================================================== */

:root {
  --primary: #2563eb;
  --secondary: #475569;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --success: #10b981;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); 
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  margin: 0; 
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg); 
  color: var(--text);
}

/* --- BASE LAYOUT --- */
.dashboard { 
  display: flex; 
  min-height: 100vh; 
  position: relative; 
}

.sidebar { 
  width: 250px; 
  background: var(--surface); 
  border-right: 1px solid var(--border); 
  padding: 20px; 
  transition: transform 0.3s ease;
  z-index: 100;
}

.sidebar h2 { margin-top: 0; color: var(--primary); }
.sidebar nav a { 
  display: block; padding: 10px; color: var(--text); 
  text-decoration: none; border-radius: 6px; margin-bottom: 5px;
  transition: background-color 0.2s, color 0.2s;
}
.sidebar nav a:hover, .sidebar nav a.active { 
  background: #eff6ff; color: var(--primary); font-weight: bold; 
}

.content { 
  flex: 1; padding: 30px; width: 100%; box-sizing: border-box; 
}

header { 
  display: flex; justify-content: space-between; align-items: center; 
  margin-bottom: 24px; flex-wrap: wrap; gap: 15px; 
}

header h1 { margin: 0; font-size: 1.8rem; color: var(--text); }

/* --- SAGES KILEPAL LOGO --- */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-image-container {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 2px solid #fbbf24; /* adds a nice gold ring around it */
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}

/* --- BEAUTIFUL CARDS --- */
.card, .form-card {
  background: var(--surface); padding: 24px;
  border-radius: 12px; box-shadow: var(--shadow);
  margin-bottom: 24px; border: 1px solid var(--border);
}

/* --- BUTTONS --- */
.btn-primary, .btn-secondary { 
  padding: 12px 24px; border: none; border-radius: 8px; cursor: pointer; 
  font-weight: 600; font-size: 15px; transition: all 0.2s; display: inline-block;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1d4ed8; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; transform: translateY(-2px); }

/* --- INPUTS & FORMS --- */
.input-lg, select, .select-lg { 
  width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 8px; 
  font-size: 16px; margin-bottom: 15px; box-sizing: border-box;
  background: #fcfcfc; transition: border-color 0.2s, box-shadow 0.2s;
}
.input-lg:focus, select:focus, .select-lg:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: var(--surface);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.save-status { font-weight: bold; font-size: 14px; color: var(--secondary); transition: color 0.3s; }

/* --- STUDENT DASHBOARD: ASSESSMENT GRIDS --- */
.grid { 
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  gap: 24px; margin-top: 20px; 
}
.assessment-card { 
  background: var(--surface); padding: 24px; border-radius: 12px; 
  box-shadow: var(--shadow); border: 1px solid var(--border); 
  transition: all 0.3s ease; display: flex; flex-direction: column; justify-content: space-between;
}
.assessment-card:hover { 
  transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary); 
}
.badge { 
  background: #eff6ff; color: #1d4ed8; padding: 6px 12px; 
  border-radius: 20px; font-size: 13px; font-weight: 700; display: inline-block; 
}
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 15px; }
.card-title { margin: 0; font-size: 1.25rem; color: var(--text); font-weight: 700; line-height: 1.3; }
.card-meta { color: var(--secondary); font-size: 14px; margin-bottom: 24px; font-weight: 500; }

/* --- TEACHER DASHBOARD: RESULTS & TABLES --- */
.controls { display: flex; gap: 15px; margin-bottom: 24px; align-items: center; flex-wrap: wrap; }
.controls label { font-weight: 600; color: var(--text); white-space: nowrap; }

.table-wrapper { 
  width: 100%; overflow-x: auto; border-radius: 8px; 
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); 
}
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--border); font-size: 15px; }
th { 
  background-color: #f8fafc; font-weight: 600; color: var(--secondary); 
  text-transform: uppercase; font-size: 13px; letter-spacing: 0.05em; 
}
tbody tr { transition: background-color 0.15s ease; }
tbody tr:hover { background-color: #f1f5f9; }
tbody tr:last-child td { border-bottom: none; }

.score-high { color: var(--success); font-weight: 700; background: #ecfdf5; padding: 6px 10px; border-radius: 6px; display: inline-block; }
.score-low { color: #ef4444; font-weight: 700; background: #fef2f2; padding: 6px 10px; border-radius: 6px; display: inline-block; }

/* --- HAMBURGER MENU & MOBILE OVERRIDES --- */
.hamburger {
  display: none; background: var(--surface); border: 1px solid var(--border); 
  font-size: 20px; cursor: pointer; border-radius: 6px;
  padding: 8px 12px; color: var(--text); z-index: 101;
}

@media (max-width: 768px) {
  .hamburger { display: block; }
  
  .sidebar {
    position: fixed; height: 100vh; left: 0; top: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
  }
  .sidebar.active { transform: translateX(0); }
  
  .content { padding: 20px 15px; } 
  .grid-2 { grid-template-columns: 1fr; }
  
  header { flex-direction: column; align-items: flex-start; }
  .header-top { display: flex; justify-content: space-between; width: 100%; align-items: center; }
  
  /* Table & Controls mobile adjustments */
  .controls { flex-direction: column; align-items: stretch; gap: 10px; }
  .select-lg { max-width: 100%; }
  .table-wrapper { border-radius: 6px; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}