:root {
  --accent: #2e4b8b;
  --accent-dark: #1f3864;
  --vju-red: #b8021e;
  --vju-red-dark: #8a0116;
  --vju-green: #1f701f;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e2e6ef;
  --text: #1f2733;
  --muted: #6b7280;
  --radius: 10px;
  --green: #1d9e75; --amber: #ba7517; --red: #d85a30; --blue: #185fa5; --gray: #6b7280;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    linear-gradient(135deg, rgba(138,1,22,0.80) 0%, rgba(94,1,15,0.88) 100%),
    url('/img/vju-cover.png') center center / cover no-repeat;
}
.login-card {
  background: var(--surface); width: 100%; max-width: 400px; padding: 36px 32px 28px;
  border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.28); border: 1px solid var(--border);
}
.login-logo { text-align: center; margin-bottom: 16px; }
.login-logo img { width: 92px; height: 92px; object-fit: contain; }
.login-card h1 { font-size: 21px; margin: 0 0 4px; color: var(--vju-red); text-align: center; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; text-align: center; line-height: 1.45; }
.login-card .btn { background: var(--vju-red); }
.login-card .btn:hover { background: var(--vju-red-dark); }
.login-card input:focus { border-color: var(--vju-red); }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--accent-dark); color: #dfe6f5; padding: 20px 14px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; font-size: 15px; line-height: 1.3; margin-bottom: 24px; padding: 0 6px; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; flex-shrink: 0; }
.brand span { display: block; font-weight: 400; font-size: 12px; color: #9fb3dd; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #cdd8ef; text-decoration: none; font-size: 14px; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.active { background: var(--accent); color: #fff; }
.sidebar .spacer { flex: 1; }
.user-box { border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; font-size: 13px; }
.user-box .name { color: #fff; font-weight: 500; }
.user-box .role { color: #9fb3dd; font-size: 12px; }
.logout { margin-top: 10px; width: 100%; background: transparent; border: 1px solid rgba(255,255,255,.25); color: #dfe6f5; padding: 8px; border-radius: 8px; font-size: 13px; }
.logout:hover { background: rgba(255,255,255,.1); }

.main { padding: 26px 32px; overflow: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 22px; color: var(--accent-dark); }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- Cards / KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.kpi .val { font-size: 26px; font-weight: 700; color: var(--accent-dark); }
.kpi .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 15px; color: var(--accent-dark); }

/* bar list */
.bar-row { display: grid; grid-template-columns: 150px 1fr 42px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bar-track { background: #eef1f7; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; }
.bar-row .n { text-align: right; color: var(--muted); }

/* ---------- Table ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
th { background: #f0f3fa; color: var(--accent-dark); font-weight: 600; font-size: 13px; }
tbody tr:hover { background: #f9fbfe; cursor: pointer; }
tbody tr:last-child td { border-bottom: none; }
.muted { color: var(--muted); }
.right { text-align: right; }

/* ---------- Badge ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.b-de_xuat { background: #eef1f7; color: #4b5563; }
.b-so_tuyen { background: #e6f1fb; color: #185fa5; }
.b-da_duyet { background: #eae6fb; color: #534ab7; }
.b-dang_thuc_hien { background: #fdf0d9; color: #92620d; }
.b-cho_nghiem_thu { background: #fde9e0; color: #b0451f; }
.b-hoan_thanh { background: #e1f5ee; color: #0f6e56; }
.b-tu_choi { background: #fbe1e1; color: #b91c1c; }

/* ---------- Buttons / forms ---------- */
.btn { background: var(--accent); color: #fff; border: none; padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.btn:hover { background: var(--accent-dark); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.ghost { background: #fff; color: var(--accent); border: 1px solid var(--border); }
.btn.ghost:hover { background: #f2f5fb; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.toolbar input, .toolbar select { width: auto; }
.toolbar input[type=search] { min-width: 240px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,30,50,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow: auto; z-index: 50; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; padding: 24px; }
.modal.wide { max-width: 720px; }
.modal h3 { margin: 0 0 4px; color: var(--accent-dark); }
.modal .close { float: right; background: none; border: none; font-size: 20px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.err { color: var(--red); font-size: 13px; margin-bottom: 10px; }

/* detail */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 14px; margin: 14px 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.section-title { font-size: 14px; font-weight: 600; color: var(--accent-dark); margin: 18px 0 8px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--border); position: relative; }
.timeline li:before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1f2733; color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 100; }
.toast.show { opacity: 1; }
.toast.err { background: #b91c1c; }
.empty { text-align: center; color: var(--muted); padding: 40px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .grid-2 { grid-template-columns: 1fr; }
}
