/* ============================================================
   css/teacher.css — Trang giáo viên (bảng số liệu + hướng dẫn)
   ============================================================ */

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

:root {
  --blue: #4f83ff;
  --blue-dark: #3356c8;
  --ink: #1b2340;
  --muted: #64748b;
  --good: #10b981;
  --danger: #ef4444;
  --warn: #f59e0b;
  --card: #ffffff;
  --shadow: 0 4px 20px rgba(20, 40, 90, 0.08);
  --radius: 16px;
}

body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
  min-height: 100vh;
  line-height: 1.6;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 24px 18px 60px; }

header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
header .logo { font-size: 42px; }
header h1 { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 28px; color: var(--blue-dark); }
header .sub { color: var(--muted); font-size: 14px; }

.topnav { margin: 12px 0 20px; }
.topnav a {
  display: inline-block;
  text-decoration: none;
  color: var(--blue-dark);
  font-weight: 700;
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 14px;
}

h2 { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 22px; color: var(--blue-dark); margin: 28px 0 12px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

/* Hướng dẫn tiết học */
.plan { display: flex; flex-wrap: wrap; gap: 12px; }
.plan__step {
  flex: 1 1 180px;
  background: #f1f6ff;
  border-radius: 12px;
  padding: 14px;
}
.plan__step b { display: block; font-family: 'Baloo 2', sans-serif; color: var(--blue-dark); font-size: 16px; }
.plan__step span { font-size: 14px; color: #334155; }
.methods { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.method {
  border-left: 4px solid var(--good);
  background: #f0fdf6;
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
  font-size: 15px;
}
.method code { background: #e2e8f0; padding: 1px 7px; border-radius: 6px; font-size: 13px; color: #0f172a; }

/* Form nhập PIN */
.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { flex: 1 1 160px; }
.field label { display: block; font-weight: 700; font-size: 13px; color: #334155; margin-bottom: 4px; }
.field input {
  width: 100%;
  min-height: 46px;
  border: 2px solid #dbe4f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 15px;
  font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--blue); }
.btn {
  border: none;
  background: var(--blue);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn--good { background: var(--good); }
#msg { margin-top: 10px; font-size: 14px; min-height: 20px; }
#msg.err { color: var(--danger); }

/* Dashboard */
#dashboard.hidden, .hidden { display: none !important; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}
.stat b { display: block; font-family: 'Baloo 2', sans-serif; font-size: 30px; color: var(--blue-dark); }
.stat span { font-size: 13px; color: var(--muted); }

.chart-box { position: relative; height: 280px; margin-top: 8px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #eef2f7; }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; }
td b { color: var(--blue-dark); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.pill--good { background: #d1fae5; color: #047857; }
.pill--warn { background: #fef3c7; color: #b45309; }

.principle-bar { margin: 8px 0; }
.principle-bar__label { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.principle-bar__track { height: 14px; background: #eef2f7; border-radius: 7px; overflow: hidden; }
.principle-bar__fill { height: 100%; background: linear-gradient(180deg, #60a5fa, #3b82f6); border-radius: 7px; transition: width 0.6s ease; }

.best-list { display: flex; flex-direction: column; gap: 10px; }
.best-item {
  background: #f8fafc;
  border-left: 4px solid var(--good);
  padding: 12px 14px;
  border-radius: 0 10px 10px 0;
  font-size: 14px;
}
.best-item .score { font-weight: 800; color: var(--good); }

footer { margin-top: 30px; text-align: center; color: var(--muted); font-size: 13px; }
footer a { color: var(--blue-dark); }

@media (max-width: 520px) {
  header h1 { font-size: 22px; }
  .btn { width: 100%; }
}
