/* Eduvia — Light Theme */
:root {
  --bg: #FEF9F0;
  --surface: #FFFFFF;
  --surface2: #FFFBF5;
  --border: #EDE0CD;
  --border2: #F0D9B5;
  --text: #3D3929;
  --text2: #5C4B2F;
  --text3: #8B7355;
  --muted: #B8A88A;
  --primary: #5C4B2F;
  --primary-light: #7A6548;
  --accent: #2D6A4F;
  --accent-bg: #D8F3DC;
  --danger: #C62828;
  --danger-bg: #F8D7DA;
  --success: #1B5E20;
  --success-bg: #E8F5E9;
  --warning: #8B6914;
  --warning-bg: #FFFBE6;
  --highlight: #F5ECD7;
  --radius: 10px;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Login ────────────── */
.login-page { display:flex; align-items:center; justify-content:center; min-height:100vh; background:linear-gradient(135deg,#FFF8EC 0%,#FFECD2 100%); }
.login-container { width:100%; max-width:420px; padding:20px; }
.login-card { background:var(--surface); border-radius:16px; padding:40px; border:1px solid var(--border2); box-shadow:0 4px 24px rgba(0,0,0,0.06); }
.login-header { text-align:center; margin-bottom:28px; }
.login-logo { width:64px; margin-bottom:12px; }
.login-header h1 { color:var(--text2); font-size:24px; }
.login-header p { color:var(--text3); font-size:14px; }

/* ─── Navigation ───────── */
.topnav {
  display:flex; align-items:center; gap:16px;
  background:var(--surface); border-bottom:1px solid var(--border);
  padding:10px 24px; position:sticky; top:0; z-index:100;
}
.nav-brand { font-weight:700; color:var(--text2); font-size:16px; }
.nav-links { display:flex; gap:8px; flex:1; flex-wrap:wrap; }
.nav-links a { color:var(--text3); text-decoration:none; font-size:13px; padding:6px 10px; border-radius:6px; }
.nav-links a:hover { background:var(--highlight); color:var(--text2); }
.nav-user { color:var(--muted); font-size:12px; }

/* ─── Container ────────── */
.container { max-width:1100px; margin:0 auto; padding:24px 20px; }
h1 { color:var(--text2); font-size:22px; margin-bottom:12px; }
h2 { color:var(--text2); font-size:17px; margin:20px 0 10px; }
h3 { color:var(--text2); font-size:14px; margin-bottom:6px; }

/* ─── Stats Grid ───────── */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; margin-bottom:24px; }
.stat-card { background:var(--surface); border-radius:var(--radius); padding:16px 20px; border:1px solid var(--border); text-align:center; }
.stat-card.highlight { border-color:#D8F3DC; background:linear-gradient(135deg,#f0fff4,#fff); }
.stat-card.accent { border-color:var(--border2); background:var(--surface2); }
.stat-num { font-size:28px; font-weight:700; color:var(--text2); }
.stat-label { font-size:11px; color:var(--text3); margin-top:2px; }

/* ─── Tables ───────────── */
table { width:100%; border-collapse:collapse; font-size:13px; }
thead th { background:var(--primary); color:#fff; padding:8px 10px; font-weight:600; font-size:11px; text-align:left; }
td { padding:7px 10px; border-bottom:1px solid var(--border); }
tr:nth-child(even) td { background:var(--surface2); }
.info-table td:first-child { font-weight:600; color:var(--text3); min-width:120px; }
.info-table td { padding:5px 10px; border:none; }

/* ─── Buttons ──────────── */
.btn { display:inline-block; padding:8px 16px; border-radius:6px; font-size:13px; font-weight:600;
  cursor:pointer; border:none; text-decoration:none; color:#fff; background:var(--primary); }
.btn:hover { background:var(--primary-light); }
.btn-sm { padding:5px 10px; font-size:12px; }
.btn-lg { padding:12px 24px; font-size:15px; }
.btn-primary { background:var(--accent); }
.btn-primary:hover { background:#256B4A; }
.btn-danger { background:var(--danger); }
.btn-full { width:100%; }

/* ─── Forms ────────────── */
.form-group { margin-bottom:12px; display:flex; flex-direction:column; }
.form-group label { font-size:12px; font-weight:600; color:var(--text3); margin-bottom:4px; }
.form-group input, .form-group select, .form-group textarea {
  padding:8px 12px; border:1px solid var(--border); border-radius:6px;
  font-size:14px; font-family:inherit; background:var(--surface);
}
.form-group input:focus, .form-group select:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 2px rgba(92,75,47,0.1); }
.form-row { display:flex; gap:12px; margin-bottom:8px; }
.form-row .form-group { flex:1; }
.form-row-5 .form-group { max-width:120px; }
.form-panel { max-width:800px; }
fieldset { border:1px solid var(--border); border-radius:var(--radius); padding:16px 20px; margin-bottom:16px; }
legend { font-weight:700; color:var(--text2); font-size:13px; padding:0 8px; }
.inline-form { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.inline-form input { padding:6px 10px; border:1px solid var(--border); border-radius:6px; font-size:13px; }

/* ─── Cards & Grids ────── */
.student-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; }
.student-card-link { text-decoration:none; color:inherit; }
.student-card-mini { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; display:flex; flex-direction:column; gap:2px; }
.student-card-mini:hover { border-color:var(--primary-light); }
.quiz-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:10px; }
.quiz-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; }
.quiz-card h3 { margin-bottom:4px; }
.note-card { background:var(--warning-bg); border-left:3px solid var(--warning); padding:12px 16px; margin-bottom:8px; border-radius:0 var(--radius) var(--radius) 0; }
.note-card small { color:var(--muted); }

/* ─── Detail ───────────── */
.detail-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:16px; margin-bottom:24px; }
.detail-section { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px 20px; }
.page-header { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.page-header h1 { margin:0; flex:1; }
.actions { display:flex; gap:8px; }
.payment-row { display:flex; gap:16px; padding:8px 12px; background:var(--surface); border-bottom:1px solid var(--border); font-size:13px; align-items:center; }
.payment-row .amount { font-weight:700; color:var(--accent); }
.exam-row { display:flex; gap:16px; padding:8px 12px; background:var(--surface); border-bottom:1px solid var(--border); font-size:13px; align-items:center; }

/* ─── Quiz taking ──────── */
.question-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px 20px; margin-bottom:12px; }
.q-header { font-weight:700; color:var(--text2); margin-bottom:6px; }
.q-topic { font-weight:400; color:var(--text3); font-size:11px; }
.q-text { margin-bottom:10px; font-size:14px; }
.q-options { display:flex; flex-direction:column; gap:4px; }
.q-opt { display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:6px; cursor:pointer; font-size:13px; }
.q-opt:hover { background:var(--highlight); }
.q-opt input[type="radio"] { margin:0; }

/* ─── Result ───────────── */
.result-hero { text-align:center; padding:40px 20px; background:var(--surface); border-radius:var(--radius); border:1px solid var(--border2); margin-bottom:20px; }
.score-circle { width:160px; height:160px; border-radius:50%; background:conic-gradient(var(--accent) var(--pct),#eee var(--pct)); margin:16px auto; display:flex; flex-direction:column; align-items:center; justify-content:center; position:relative; }
.score-circle::after { content:''; width:120px; height:120px; border-radius:50%; background:#fff; position:absolute; }
.score-num { font-size:36px; font-weight:800; color:var(--accent); z-index:1; }
.score-detail { font-size:12px; color:var(--text3); z-index:1; }

/* ─── Alerts ───────────── */
.alert { padding:10px 16px; border-radius:var(--radius); font-size:13px; margin-bottom:12px; }
.alert-error { background:var(--danger-bg); color:var(--danger); }
.alert-success { background:var(--success-bg); color:var(--success); }

/* ─── Utilities ────────── */
.muted { color:var(--muted); }
.empty { color:var(--muted); font-style:italic; padding:20px 0; }
.badge { padding:2px 8px; border-radius:12px; font-size:10px; font-weight:600; }
.badge-active { background:var(--success-bg); color:var(--success); }

/* ─── Print ────────────── */
@media print {
  .topnav { display:none; }
  body { background:#fff; }
}

@media (max-width:600px) {
  .form-row { flex-direction:column; }
  .stats-grid { grid-template-columns:1fr 1fr; }
  .detail-grid { grid-template-columns:1fr; }
  .topnav { flex-direction:column; align-items:flex-start; }
}
