/*
  Style của APP Tạo Giáo Án.

  Dịch từ inline style của bản thiết kế `App Tạo Giáo Án.dc.html`. Mọi màu, bán
  kính, khoảng cách và cỡ chữ dưới đây lấy đúng giá trị trong file thiết kế —
  phần biến ở :root chỉ đặt tên cho những giá trị được dùng lại nhiều lần.
*/

:root {
  /* Nền và viền */
  --bg: #F5FBFA;
  --surface: #fff;
  --surface-soft: #F7FCFB;
  --line: #DCEDE9;

  /* Chữ */
  --ink: #0F3B3A;
  --ink-2: #37605D;
  --ink-3: #0F3B3A;
  --muted: #5E7C7A;
  --muted-2: #7A9694;
  --disabled: #9DB5B2;

  /* Xanh ngọc — màu chính */
  --pink: #18BFA7;
  --pink-strong: #087F8C;
  --pink-deep: #087F8C;
  --pink-tint: #E8F8F5;
  --pink-tint-2: #F1FAF8;
  --pink-line: #B9DED6;
  --pink-line-2: #C9E6E0;

  /* Xanh dương — cột hoạt động của trẻ */
  --blue: #2F6FA8;
  --blue-tint: #EAF4FF;
  --blue-ink: #2F6FA8;

  /* Xanh ngọc đậm — trạng thái tích cực */
  --green: #18BFA7;
  --green-strong: #0FA9A0;
  --green-tint: #E8F8F5;
  --green-tint-2: #DCF3EF;
  --green-line: #B9DED6;
  --green-ink: #087F8C;
  --green-ink-2: #087F8C;

  /* Vàng cam — cảnh báo */
  --yellow: #FFB84D;
  --yellow-tint: #FFF9EF;
  --yellow-line: #FFE3B8;
  --yellow-ink: #7A5417;
  --yellow-ink-2: #A55516;
  --amber-ink: #A55516;

  /* Đỏ cảnh báo — dùng chung màu cam đậm của bản thiết kế mới */
  --red-ink: #A55516;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

* { box-sizing: border-box; }

a { color: var(--pink-strong); text-decoration: none; }
a:hover { color: var(--pink); text-decoration: underline; }

[contenteditable]:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--yellow); }

@keyframes wz-spin { to { transform: rotate(360deg); } }
@keyframes wz-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Bản thiết kế bỏ outline mặc định của trình duyệt bằng cách không khai báo gì.
   Ở đây giữ lại focus ring cho bàn phím — thiết kế không cấm, và không có nó
   thì không dùng được app bằng Tab. */
:is(button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ─────────────────────────── Nguyên tố dùng chung ─────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
}

.card--tight { border-radius: 16px; padding: 18px; }

.rule { height: 1px; background: var(--line); margin: 26px 0; }
.rule--sm { margin: 24px 0; }

.h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 4px;
}

.h1--dash {
  font-size: 30px;
  margin: 4px 0 24px;
}

.h2 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.h3 { font-size: 16px; font-weight: 700; }

.lede { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.field-label { font-size: 13px; font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); }
.mono { font-family: var(--mono); }

/* Ô nhập */
.input, .textarea {
  font-family: inherit;
  font-size: 14.5px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  width: 100%;
}

.textarea {
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.55;
}

.input::placeholder, .textarea::placeholder { color: var(--muted-2); }

.label { display: grid; gap: 6px; }

/* Chip — hàm CHIP() trong bản thiết kế */
.chip {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s var(--ease);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
}

.chip.is-on {
  border-color: var(--pink);
  background: var(--pink-tint);
  color: var(--pink-deep);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }

/* Nút */
.btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all .25s var(--ease);
}

.btn:hover { border-color: var(--blue); }

.btn--pink {
  border: none;
  background: var(--pink);
  color: #fff;
}
.btn--pink:hover { background: var(--pink-strong); }

.btn--green {
  border: none;
  background: var(--green);
  color: #fff;
}
.btn--green:hover { background: var(--green-strong); }

.btn--link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--pink-strong);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}

.status-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #F2F5F7;
  color: var(--muted);
}
.status-chip--ok { background: var(--green-tint-2); color: var(--green-ink-2); }
.status-chip--soon { background: var(--yellow-tint); color: var(--yellow-ink-2); }
.status-chip--bad { background: var(--pink-tint); color: var(--red-ink); }
.status-chip--admin { background: var(--blue-tint); color: var(--blue-ink); }

.note-yellow {
  background: var(--yellow-tint);
  border: 1px solid var(--yellow-line);
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 13.5px;
  color: var(--yellow-ink);
  line-height: 1.55;
}

.note-green {
  background: var(--green-tint);
  border: 1px solid var(--green-line);
  border-radius: 14px;
  padding: 18px 20px;
}

.note-red {
  background: var(--pink-tint);
  border: 1px solid var(--pink-line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--red-ink);
  line-height: 1.5;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ─────────────────────────────── Đăng nhập ──────────────────────────────── */

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.login__left {
  padding: 72px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand__mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--pink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(24, 191, 167, .32);
  flex: none;
}

.brand__name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.brand__sub { font-size: 13px; color: var(--muted); }

.login__title {
  font-size: 44px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.03em;
  margin: 0 0 16px;
  text-wrap: balance;
}

.login__body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: 46ch;
  text-wrap: pretty;
}

.login__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 320px;
}

.login__error {
  font-size: 13px;
  color: var(--red-ink);
  margin-top: -4px;
}

.login__fine {
  font-size: 13px;
  color: var(--muted);
  max-width: 44ch;
  line-height: 1.5;
}

.login__right {
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 72px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--muted);
}

.feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.feature__n {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--pink-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pink-strong);
  font-weight: 700;
  font-size: 13px;
}

.feature__title { font-weight: 600; font-size: 15px; }
.feature__body { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 3px; }

/* ───────────────────────────── Khung ứng dụng ───────────────────────────── */

.shell { display: flex; min-height: 100vh; align-items: stretch; }

.sidebar {
  /* 276px chứ không phải 252px: cần thêm chỗ cho nhãn phiên bản nằm cùng dòng
     với tên app mà không cắt cụt tên. */
  width: 276px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }

.sidebar__mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--pink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* 13px chứ không phải 14px: nhường chỗ cho nhãn phiên bản bên cạnh. */
.sidebar__name { font-size: 13px; font-weight: 700; line-height: 1.2; }

/* Tên app và nhãn phiên bản trên cùng một dòng. Thanh bên hẹp nên tên được
   phép co lại và cắt bớt, còn nhãn giữ nguyên — nhãn mà xuống dòng thì trông
   như một mục riêng chứ không còn là nhãn của tên nữa. */
.sidebar__nameline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sidebar__nameline .sidebar__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Nhãn phiên bản cạnh tên app — để đối chiếu localhost với production. */
.vtag {
  flex: none;
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--green-tint-2);
  color: var(--green-ink-2);
  border: 1px solid var(--green-line);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.5;
  white-space: nowrap;
  cursor: default;
}
.sidebar__sub { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.3; }

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background .2s;
  background: transparent;
  color: var(--ink-2);
}

.nav__item svg { flex: none; }

.nav__item:hover { background: var(--pink-tint-2); }

.nav__item.is-on {
  font-weight: 600;
  background: var(--pink-tint);
  color: var(--pink-deep);
}

.who {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.who__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}

.who__name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.who__role { font-size: 12px; color: var(--muted); }

.logout {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  padding: 0 6px;
  cursor: pointer;
}
.logout:hover { color: var(--pink-strong); }

.main { flex: 1; min-width: 0; padding: 28px 36px 64px; }

/* Trang chủ và thư viện dùng hết bề ngang màn hình. Các màn nhiều chữ vẫn giữ
   bề ngang hẹp bên dưới — dòng chữ dài quá 100 ký tự là mắt khó dò về đầu dòng
   tiếp theo. Hai biến thể này đặt SAU .wrap nên vẫn thắng. */
.wrap { max-width: none; }
.wrap--narrow { max-width: 940px; }
.wrap--word { max-width: 1120px; }

/* ─────────────────────────────── Trang chủ ──────────────────────────────── */

.dash-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.dash-top__sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.dash-top__right { display: flex; align-items: center; gap: 10px; flex: none; }

.config-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.config-pill__dot { width: 7px; height: 7px; border-radius: 999px; background: var(--pink); display: inline-block; flex: none; }

.btn-cta-sm {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  background: var(--pink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 5px 14px rgba(24, 191, 167, .26);
  transition: all .25s var(--ease);
}
.btn-cta-sm:hover { background: var(--green-strong); transform: translateY(-1px); }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 38px 42px;
  margin-bottom: 22px;
  color: #fff;
  background: linear-gradient(115deg, #18BFA7 0%, #12B0AE 45%, #087F8C 100%);
}

.hero__blob { position: absolute; border-radius: 999px; background: rgba(255, 255, 255, .10); }
.hero__blob--1 { right: -60px; top: -70px; width: 300px; height: 300px; }
.hero__blob--2 { right: 90px; bottom: -110px; width: 220px; height: 220px; background: rgba(255, 255, 255, .08); }

.hero__content { position: relative; max-width: 640px; }
.hero__kicker { font-size: 12px; font-weight: 600; letter-spacing: .12em; opacity: .85; }
.hero__title {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.hero__actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }

.hero__btn {
  font-family: inherit;
  height: 46px;
  padding: 0 22px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s var(--ease);
}
.hero__btn--solid { border: 0; background: #fff; color: var(--pink-strong); }
.hero__btn--solid:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0, 0, 0, .14); }
.hero__btn--ghost { border: 1px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .12); color: #fff; font-weight: 500; }
.hero__btn--ghost:hover { background: rgba(255, 255, 255, .22); }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }

.quick-card {
  text-align: left;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  cursor: pointer;
  transition: all .3s var(--ease);
}
.quick-card:hover { border-color: var(--pink); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(8, 127, 140, .10); }

.quick-card__icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.quick-card__icon--teal { background: var(--pink-tint); color: var(--pink-strong); }
.quick-card__icon--blue { background: var(--blue-tint); color: var(--blue-ink); }
.quick-card__icon--amber { background: var(--yellow-tint); color: var(--amber-ink); }

.quick-card__title { margin-top: 16px; font-size: 15.5px; font-weight: 600; }
.quick-card__body { margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.55; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }

/* PHẢI đặt sau .stats: cùng độ ưu tiên (một class), nên luật đứng sau mới
   thắng. Trước đây khối này nằm trên .stats nên bị đè hoàn toàn — 4 ô thống kê
   dàn thành một hàng thay vì lưới 2x2.
   align-content: start giữ ô cao đúng nội dung; nếu không, lưới bị kéo giãn
   cho bằng chiều cao cột "Giáo án gần đây" bên cạnh. */
.stats--2x2 {
  grid-template-columns: repeat(2, 1fr);
  align-content: start;
  margin-bottom: 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
}

.stat__value {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.stat__value--sm { font-size: 28px; letter-spacing: 0; }
.stat__label { font-size: 13px; color: var(--muted); margin-top: 2px; }

.dash-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head .h2, .list-title { font-size: 18px; font-weight: 700; margin: 0; }
.list-title { margin-bottom: 12px; }

.stack-10 { display: grid; gap: 10px; }
.stack-12 { display: grid; gap: 12px; }
.stack-16 { display: grid; gap: 16px; }

.recent {
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: all .25s var(--ease);
}
.recent:hover { border-color: var(--pink); }
.recent__title { font-weight: 600; font-size: 15px; }
.recent__meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.recent__date { font-size: 12px; color: var(--muted); white-space: nowrap; }


/* ──────────────────────────── Wizard 5 bước ───────────────────────────── */

.wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.wizard-head .h1 { font-size: 26px; margin: 0; }
.wizard-head__count { font-size: 13.5px; color: var(--muted); }

.steps { display: flex; gap: 8px; margin-bottom: 28px; }

.step {
  flex: 1;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  transition: all .2s var(--ease);
}

.step.is-on { border-color: var(--pink); background: var(--pink-tint); color: var(--pink-deep); }
.step__n { font-size: 11px; font-weight: 600; letter-spacing: .07em; opacity: .75; }
.step__label { font-size: 13.5px; font-weight: 600; margin-top: 2px; }

.duration-hint {
  font-size: 13px;
  color: var(--muted);
  background: var(--yellow-tint);
  border: 1px solid var(--yellow-line);
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.45;
}

.mixed-box__title { font-weight: 600; font-size: 14.5px; }
.mixed-box__body {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 5px 0 12px;
}

.two-col-26 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 26px; }

.guarantee {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
  font-size: 13.5px;
  color: var(--yellow-ink);
  line-height: 1.5;
}

.detail-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.detail-card {
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  padding: 14px 15px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  transition: all .2s var(--ease);
}
.detail-card.is-on { border-color: var(--pink); background: var(--pink-tint); }
.detail-card__label { font-weight: 600; font-size: 14px; }
.detail-card__hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  background: var(--surface-soft);
}

.summary__row { display: flex; gap: 12px; font-size: 14px; line-height: 1.5; }
.summary__k { width: 150px; flex: none; color: var(--muted); }
.summary__v { font-weight: 500; }

.generate-row { margin-top: 24px; display: flex; align-items: center; gap: 18px; }

.btn-generate {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 17px 30px;
  border-radius: 14px;
  border: none;
  background: var(--pink);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(24, 191, 167, .3);
  flex: none;
}
.btn-generate:disabled { background: var(--pink-line); cursor: default; }

.generate-note { font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 42ch; }

/* Thanh chờ AI. Tiến độ là ước lượng theo thời gian, không phải tiến độ thật —
   xem generate() trong js/app.js. */
.genbar { margin-top: 20px; }

.genbar__track {
  height: 8px;
  border-radius: 999px;
  background: var(--green-tint-2);
  overflow: hidden;
}

.genbar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--green-strong));
  /* Khớp với nhịp cập nhật 500ms của genTick() để thanh trôi đều, không giật. */
  transition: width .5s linear;
}

.genbar__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 10px;
  font-size: 13px;
}

.genbar__stage { color: var(--ink-2); font-weight: 500; }
.genbar__time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.genbar__hint { margin-top: 6px; font-size: 12.5px; color: var(--muted-2); line-height: 1.5; }

.wizard-foot { display: flex; justify-content: space-between; margin-top: 22px; }

.btn-step {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.btn-step:disabled { color: var(--disabled); cursor: default; }

.btn-step--next {
  padding: 12px 22px;
  border: none;
  background: var(--pink);
  color: #fff;
}

/* ───────────────────────────── Trình soạn thảo ──────────────────────────── */

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }

.editor__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.editor__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--pink-strong);
}

.editor__title {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 5px 0 0;
}

.editor__meta { font-size: 13.5px; color: var(--muted); margin-top: 5px; }
.editor__buttons { display: flex; gap: 9px; flex: none; }

.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; }

.doc__info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.doc__info-row { font-size: 13.5px; display: flex; gap: 8px; }
.doc__info-k { color: var(--muted); }
.doc__info-v { font-weight: 500; }

.doc__h2 { font-size: 16px; font-weight: 700; margin: 22px 0 12px; }
.doc__h2--iii { margin: 28px 0 12px; }
.doc__h2--ii { margin: 26px 0 12px; }

.block { margin-bottom: 14px; }
.block__label { font-size: 13.5px; font-weight: 600; color: var(--pink-strong); margin-bottom: 5px; }
.block__lines { font-size: 14.5px; line-height: 1.62; padding: 4px 6px; margin: -4px -6px; }

.diff { margin-top: 16px; }
.diff__title { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.diff__group { font-size: 13px; font-weight: 600; color: var(--green-ink); margin-bottom: 5px; }
.diff__lines { font-size: 14px; line-height: 1.6; color: var(--ink); }

.prep { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }

.acts { width: 100%; border-collapse: collapse; table-layout: fixed; }

.acts th {
  text-align: left;
  font-size: 13.5px;
  padding: 11px 14px;
  border: 1px solid var(--line);
}
.acts th.col-teacher { width: 46%; background: var(--pink-tint); }
.acts th.col-child { width: 46%; background: var(--blue-tint); }
.acts th.col-tools { width: 8%; background: var(--surface-soft); }

.acts__head-cell {
  border: 1px solid var(--line);
  border-bottom: none;
  padding: 10px 14px;
  background: var(--surface-soft);
}

.acts__head-inner { display: flex; align-items: center; gap: 10px; }
.acts__name { font-size: 14px; font-weight: 700; }

.acts__time {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--yellow-tint);
  border: 1px solid var(--yellow-line);
  border-radius: 999px;
  padding: 2px 9px;
}

.acts__cell { border: 1px solid var(--line); padding: 12px 14px; vertical-align: top; }
.acts__lines { font-size: 14.5px; line-height: 1.62; }

.acts__tools-cell {
  border: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
  text-align: center;
}

.acts__tools { display: flex; flex-direction: column; gap: 4px; align-items: center; }

.icon-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  color: var(--muted);
  padding: 0;
}
.icon-btn:hover { border-color: var(--blue); }
.icon-btn--danger { color: var(--pink-strong); }
.icon-btn--danger:hover { border-color: var(--pink); }

.acts__meta-cell {
  border: 1px solid var(--line);
  border-top: none;
  padding: 10px 14px;
  background: var(--surface-soft);
}

.acts__meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 22px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}

.acts__meta b { font-weight: 600; }
.acts__meta .k-blue { color: var(--blue-ink); }
.acts__meta .k-amber { color: var(--amber-ink); }
.acts__meta .k-green { color: var(--green-ink); }
.acts__meta .k-red { color: var(--red-ink); }

.add-row {
  margin-top: 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pink-strong);
  background: var(--surface);
  border: 1px dashed var(--pink-line);
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  width: 100%;
}
.add-row:hover { background: var(--pink-tint-2); }

.doc__foot {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.rail { display: grid; gap: 16px; position: sticky; top: 28px; }

.rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rail__title { font-size: 14.5px; font-weight: 700; }

.rail__count {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--amber-ink);
  background: var(--yellow-tint);
  border-radius: 999px;
  padding: 2px 9px;
}

.check { display: flex; gap: 9px; font-size: 13px; line-height: 1.5; }
.check__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  margin-top: 6px;
  background: var(--yellow);
}
.check__dot.is-ok { background: var(--green); }
.check__text { color: var(--ink-3); }

.rail__sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }

.ai-action {
  text-align: left;
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.ai-action:hover { border-color: var(--pink); background: var(--pink-tint-2); }

.version { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.version__label { color: var(--ink-3); }
.version__time { font-family: var(--mono); color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Hộp xem trước thay đổi của AI */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(38, 50, 56, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 60;
}

.modal__box {
  background: var(--surface);
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  padding: 26px 28px;
  box-shadow: 0 24px 60px rgba(38, 50, 56, .28);
  animation: wz-fade .28s var(--ease);
}

.modal__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--pink-strong);
}

.modal__title { font-size: 20px; font-weight: 700; margin: 6px 0 14px; }

.modal__body {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  font-size: 14.5px;
  line-height: 1.62;
  max-height: 46vh;
  overflow: auto;
  white-space: pre-wrap;
}

.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.btn-modal {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
}
.btn-modal--accept { border: none; background: var(--green); color: #fff; }

/* ─────────────────────────── Giáo án của tôi ───────────────────────────── */

.lib-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.lib-search {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  min-width: 280px;
  color: var(--ink);
}

.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.lib-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all .3s var(--ease);
}

.lib-card:hover {
  border-color: var(--pink);
  box-shadow: 0 10px 26px rgba(38, 50, 56, .08);
  transform: translateY(-1px);
}

.lib-card__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.lib-card__age { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; color: var(--pink-strong); }

.pin {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 0;
  color: var(--yellow);
  line-height: 1;
}

.lib-card__title { font-size: 16px; font-weight: 700; line-height: 1.35; }
.lib-card__domain { font-size: 13px; color: var(--muted); line-height: 1.5; }
.lib-card__date { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }

.lib-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}

.btn-mini {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  cursor: pointer;
  color: var(--ink);
  transition: all .2s var(--ease);
}
.btn-mini:hover { border-color: var(--blue); }
.btn-mini--green:hover { border-color: var(--green); }
.btn-mini--danger { color: var(--red-ink); }
.btn-mini--danger:hover { border-color: var(--pink); }

.empty {
  text-align: center;
  padding: 70px 20px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 18px;
}
.empty__title { font-size: 17px; font-weight: 700; }
.empty__body { font-size: 14px; color: var(--muted); margin-top: 6px; }

.btn-use {
  flex: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  cursor: pointer;
  color: var(--ink);
  transition: all .2s var(--ease);
}
.btn-use:hover { border-color: var(--pink); background: var(--pink-tint-2); }

/* ───────────────────────────── Tải Word lên ────────────────────────────── */

.up-steps { display: flex; gap: 8px; margin-bottom: 22px; }

.up-step {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted-2);
}

.up-step.is-on {
  border-color: var(--green-line);
  background: var(--green-tint);
  color: var(--green-ink-2);
}

.dropzone {
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: 20px;
  padding: 60px 30px;
  text-align: center;
  color: var(--ink);
  transition: all .25s var(--ease);
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--blue); background: #FBFDFF; }
.dropzone__title { font-size: 18px; font-weight: 700; }
.dropzone__body { font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

.up-working { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px; }

.up-working__row { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--pink-line-2);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: wz-spin .8s linear infinite;
  flex: none;
}

.bar {
  height: 8px;
  background: var(--pink-tint);
  border-radius: 999px;
  margin-top: 18px;
  overflow: hidden;
}

.bar__fill {
  height: 100%;
  background: var(--pink);
  border-radius: 999px;
  transition: width .4s var(--ease);
}

.up-working__file { font-size: 13px; color: var(--muted); margin-top: 10px; }

.map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.map-head__title { font-size: 17px; font-weight: 700; }
.map-head__body { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); }

.table th {
  text-align: left;
  font-size: 12.5px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.5;
}

.table--map { margin-top: 18px; }
.table--map td.target { font-weight: 600; }

.btn-cta {
  margin-top: 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 12px;
  border: none;
  background: var(--pink);
  color: #fff;
  cursor: pointer;
}
.btn-cta:hover { background: var(--pink-strong); }
.btn-cta:disabled { background: var(--pink-line); cursor: default; }

/* ─────────────────────────── Xem trước file Word ───────────────────────── */

.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.preview-head__file { font-size: 14px; color: var(--muted); margin: 0; font-family: var(--mono); }
.preview-head__buttons { display: flex; gap: 9px; flex: none; }

.word-cols { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }

.paper-wrap {
  background: #E4EFEC;
  border-radius: 16px;
  padding: 28px;
  display: flex;
  justify-content: center;
}

.paper {
  width: 794px;
  max-width: 100%;
  background: #fff;
  box-shadow: 0 10px 30px rgba(38, 50, 56, .14);
  padding: 76px 68px;
  font-family: 'Times New Roman', Times, serif;
  color: #000;
  font-size: 15.5px;
  line-height: 1.5;
}

.paper__school { text-align: center; font-weight: bold; text-transform: uppercase; }
.paper__title {
  text-align: center;
  font-weight: bold;
  font-size: 19px;
  margin: 14px 0 4px;
  text-transform: uppercase;
}
.paper__topic { text-align: center; font-style: italic; margin-bottom: 20px; }

.paper__info { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.paper__info td { padding: 2px 0; }
.paper__info td:first-child { width: 46%; }

.paper__h { font-weight: bold; margin: 16px 0 8px; }
.paper__block { margin-bottom: 8px; }
.paper__block--tight { margin-bottom: 6px; }
.paper__block-label { font-weight: bold; font-style: italic; }
.paper__line { margin-left: 18px; }
.paper__line--deep { margin-left: 16px; }
.paper__group { font-style: italic; }

.paper__table { width: 100%; border-collapse: collapse; }
.paper__table th {
  border: 1px solid #000;
  padding: 6px 8px;
  text-align: center;
}
.paper__table th:first-child { width: 50%; }
.paper__table td { border: 1px solid #000; padding: 7px 9px; vertical-align: top; }
.paper__act-name { font-weight: bold; }
.paper__expect { font-style: italic; }

.paper__sign {
  display: flex;
  justify-content: space-between;
  margin-top: 34px;
  font-style: italic;
}
.paper__sign-col { text-align: center; }
.paper__sign-gap { height: 56px; }
.paper__sign-name { font-style: normal; font-weight: bold; }

.paper__pageno {
  text-align: center;
  font-size: 13px;
  color: #444;
  margin-top: 26px;
  border-top: 1px solid #ccc;
  padding-top: 8px;
}

.word-rail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 28px;
}

.word-rail__row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.word-rail__k { color: var(--muted); }
.word-rail__v { font-weight: 600; text-align: right; }

.word-rail__foot {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ────────────────────────── Xem trước PowerPoint ───────────────────────── */

.slide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.slide {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(38, 50, 56, .07);
  overflow: hidden;
}

.slide--cover {
  background: linear-gradient(135deg, #18BFA7 0%, #087F8C 100%);
  color: #fff;
}

.slide__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slide__kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--blue);
}
.slide--cover .slide__kicker { color: rgba(255, 255, 255, .9); }

.slide__n { font-family: var(--mono); font-size: 12px; color: var(--muted-2); }
.slide--cover .slide__n { color: rgba(255, 255, 255, .8); }

.slide__title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  text-wrap: balance;
}
.slide--cover .slide__title { font-size: 30px; }

.slide__bullets { display: grid; gap: 7px; margin-top: 4px; }
.slide__bullet { display: flex; gap: 9px; font-size: 15px; line-height: 1.45; }
.slide__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  margin-top: 7px;
  flex: none;
}

.slide__image {
  margin-top: auto;
  border: 1px dashed #C9D6DD;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted-2);
  background: #F7FAFC;
}

.slide__notes {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
  padding-left: 2px;
}
.slide__notes b { font-weight: 600; }

/* ────────────────────────── Cấu hình chương trình ──────────────────────── */

.table--refs th { padding: 12px 14px; }
.table--refs td { padding: 12px 14px; }
.table--refs .code { font-family: var(--mono); }
.table--refs .issuer { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.table--refs .checked { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
}
.panel--sm { padding: 20px; }
.panel__title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.panel__title--sm { font-size: 15px; margin-bottom: 10px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-row__label { font-size: 13.5px; }

.switch {
  width: 44px;
  height: 25px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 3px;
  display: flex;
  justify-content: flex-start;
  background: #DFE6EA;
  transition: background .2s;
  flex: none;
}
.switch.is-on { justify-content: flex-end; background: var(--green); }
.switch__knob {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

/* ──────────────────────────────── Toast ────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 13px 22px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(38, 50, 56, .3);
  z-index: 80;
  animation: wz-fade .25s var(--ease);
  max-width: min(90vw, 640px);
  text-align: center;
}

/* ───────────────────────────── Màn hình hẹp ────────────────────────────── */

@media (max-width: 1180px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .word-cols { grid-template-columns: minmax(0, 1fr); }
  .word-rail { position: static; }
  .detail-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1000px) {
  .login { grid-template-columns: 1fr; }
  .login__left { padding: 48px 28px; }
  .login__right { padding: 40px 28px; border-left: none; border-top: 1px solid var(--line); }
  .login__title { font-size: 34px; }
  .shell { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .who { margin-top: 0; }
  .main { padding: 22px 20px 56px; }
  .stats, .grid-3, .lib-grid, .quick-grid { grid-template-columns: 1fr; }
  .dash-cols, .grid-2, .two-col-26, .prep, .summary, .slide-grid,
  .guarantee, .acts__meta { grid-template-columns: 1fr; }
  .dash-top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hero { padding: 28px 24px; }
  .hero__title { font-size: 22px; }
  .steps, .up-steps { flex-wrap: wrap; }
  .step, .up-step { flex: 1 1 140px; }
  .paper { padding: 40px 28px; }
}

/* Bảng hoạt động trong trình soạn thảo không thu nhỏ được — cho cuộn ngang
   riêng trong khung của nó thay vì để cả trang cuộn. */
.acts-scroll { overflow-x: auto; }
.acts { min-width: 620px; }
