/*
Theme Name: NTN Exam Portal
Theme URI: https://github.com/
Author: Nguyen Thanh Nhan
Description: Cổng luyện tập online — học sinh (mã lớp/mã đề + mã HS) và giáo viên (tài khoản WordPress). Cần plugin NTN Luyện tập.
Version: 1.3.0
Text Domain: ntn-exam
*/

:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --ok: #059669;
  --sidebar: #0b1220;
  --sidebar-2: #111827;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: none !important;
}
body,
body.ntn-portal,
body.ntn-gv {
  font-family: "Segoe UI", "Be Vietnam Pro", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  width: 100% !important;
  max-width: none !important;
}
body.ntn-portal .wp-site-blocks,
body.ntn-portal .is-layout-constrained,
body.ntn-portal .is-layout-flow,
body.ntn-portal .entry-content {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.ntn-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 55%, #db2777 100%);
}
.ntn-login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}
.ntn-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.ntn-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.ntn-login-card h1 { margin: 0 0 6px; font-size: 1.45rem; }
.ntn-login-card p.lead { color: var(--muted); margin: 0 0 22px; }
.ntn-field { margin-bottom: 14px; }
.ntn-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.ntn-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}
.ntn-field input:focus { outline: 2px solid #c7d2fe; border-color: var(--accent); }
.ntn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  width: 100%;
}
.ntn-btn:hover { filter: brightness(1.05); }
.ntn-error, .ntn-alert {
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.ntn-ok {
  background: #ecfdf5;
  color: #047857;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.ntn-teacher-link {
  text-align: center;
  margin: 16px 0 0;
  font-size: .9rem;
}
.ntn-teacher-link a { color: var(--muted); }
.ntn-card-pad { padding: 18px; }
.ntn-inline-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.ntn-del { color: #b91c1c; }

.ntn-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}
.ntn-side {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #e5e7eb;
  padding: 28px 20px;
  min-height: 100vh;
}
.ntn-side h2 { margin: 0 0 4px; font-size: 1.15rem; color: #fff; }
.ntn-side .meta { color: #94a3b8; font-size: .9rem; margin-bottom: 28px; }
.ntn-side a {
  display: block;
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.ntn-side a:hover, .ntn-side a.active { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.ntn-main {
  padding: 36px 44px 48px;
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
}
.ntn-hero {
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  border: 1px solid #e0e7ff;
  border-radius: 18px;
  padding: 24px 28px;
  margin-bottom: 22px;
  width: 100%;
}
.ntn-hero h1 { margin: 0 0 8px; font-size: 1.7rem; }
.ntn-hero p { margin: 0; color: var(--muted); line-height: 1.55; }
.ntn-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
  width: 100%;
}
.ntn-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.ntn-stat b { display: block; font-size: 1.6rem; }
.ntn-stat span { color: var(--muted); font-size: .9rem; }
.ntn-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.ntn-card h3 { margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.ntn-exam {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.ntn-exam:last-child { border-bottom: 0; }
.ntn-exam .title { font-weight: 700; }
.ntn-exam .sub { color: var(--muted); font-size: .9rem; }
.ntn-btn.small { width: auto; padding: 8px 14px; font-size: .92rem; }
.ntn-btn.ghost { background: #eef2ff; color: var(--accent); }
table.ntn-table { width: 100%; border-collapse: collapse; }
table.ntn-table th, table.ntn-table td { text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--line); }
table.ntn-table th { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.best { color: var(--ok); font-weight: 800; }

.ntn-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ntn-muted { color: var(--muted); }
.ntn-help { color: var(--muted); font-size: .88rem; margin: 0 0 12px; }
.ntn-section-title { margin: 8px 0 12px; font-size: 1.05rem; }
.ntn-side-label {
  color: #64748b;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 10px;
}
.ntn-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 9px;
  margin-left: 8px;
  vertical-align: middle;
}
.ntn-badge.open { background: #d1fae5; color: #047857; }
.ntn-badge.scheduled { background: #fef3c7; color: #b45309; }
.ntn-badge.closed { background: #e2e8f0; color: #475569; }
.ntn-chip {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .8rem;
  font-weight: 600;
  margin: 0 4px 4px 0;
}
.ntn-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.ntn-class-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  color: inherit;
  text-decoration: none;
}
.ntn-class-card:hover { border-color: #c7d2fe; box-shadow: 0 8px 24px rgba(79,70,229,.08); text-decoration: none; }
.ntn-class-card strong { font-size: 1.15rem; }
.ntn-class-card span { color: var(--muted); font-size: .9rem; }
.ntn-code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 800;
  letter-spacing: .06em;
  color: #3730a3;
  background: #eef2ff;
  border-radius: 8px;
  padding: 1px 7px;
}
.ntn-copy {
  display: inline-flex;
  align-items: center;
  border: 0;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 8px;
  padding: 3px 8px;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
}
.ntn-copy:hover { background: #c7d2fe; }
.ntn-filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.ntn-filter-bar label { font-weight: 600; }
.ntn-filter-bar select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
}
.ntn-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px 12px;
  margin: 8px 0 10px;
}
.ntn-check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-bottom: 6px; }
.ntn-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ntn-field input[type=datetime-local],
.ntn-field input[type=number],
.ntn-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}
@media (max-width: 860px) {
  .ntn-shell { grid-template-columns: 1fr; }
  .ntn-side { min-height: 0; }
  .ntn-main { padding: 20px 16px 32px; }
  .ntn-grid, .ntn-grid-4 { grid-template-columns: 1fr; }
  .ntn-exam { flex-direction: column; align-items: flex-start; }
  .ntn-field-row { grid-template-columns: 1fr; }
}
