/* Thời khóa biểu trang trí: khổ cố định 1600px, thu nhỏ vừa màn hình / trang in.
   Hai mẫu: .poster-gv (giáo viên, tông kem pastel) và .poster-hs (học sinh, trời - cỏ).
   Chỉ dùng hiệu ứng mà html2canvas vẽ lại được (không color-mix, không gradient tròn)
   để ảnh tải về giống hệt trên màn hình. */

:root {
  --navy: #1e2a5c;
  --ink: #2b3452;
  --pink: #e0487a;
  --d2: #ec4f8e; --d3: #f59e0b; --d4: #4cb944; --d5: #3b82f6; --d6: #8b5cf6; --d7: #14b8a6; --d8: #ef4444;
  --p2: #fde8f1; --p3: #fff1d9; --p4: #e7f7e3; --p5: #e3eeff; --p6: #efe9ff; --p7: #dcf6f2; --p8: #fde4e4;
  --script: "Dancing Script", "Segoe Script", cursive;
  --round: "Baloo 2", "Nunito", "Segoe UI", system-ui, sans-serif;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.poster-page {
  background: #e9edf5;
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
}

/* ------------------------------------------------------------ thanh công cụ */
.poster-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 10px 16px; background: #1e3a8a; color: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .25);
}
.poster-bar a, .poster-bar button { font: inherit; font-weight: 700; }
.bar-back { color: #fff; text-decoration: none; opacity: .9; }
.bar-title { flex: 1; min-width: 180px; }
.bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.poster-bar button {
  border: 0; border-radius: 10px; padding: 8px 14px; cursor: pointer;
  background: #facc15; color: #1e293b;
}
.poster-bar button.ghost { background: rgba(255,255,255,.14); color: #fff; }
.poster-bar button:disabled { opacity: .7; cursor: wait; }

.poster-stage { padding: 16px; overflow: hidden; }
.poster {
  position: relative; width: 1600px; margin: 0 auto;
  transform-origin: top left; overflow: hidden;
  border-radius: 28px; box-shadow: 0 18px 50px rgba(30, 42, 92, .18);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.deco, .deco *, .deco-br, .hs-kids, .hs-deco-l, .hs-deco-r, .sun { font-family: var(--emoji); line-height: 1; }
.love { color: var(--pink); }

/* ---------------------------------------------------------- bảng dùng chung */
.pt { width: 100%; border-collapse: separate; border-spacing: 0; font-family: var(--round); table-layout: fixed; }
.pt th, .pt td { text-align: center; vertical-align: middle; }
.dh { color: #fff; font-weight: 800; letter-spacing: .5px; font-size: 27px; padding: 12px 6px 8px; }
.dh-2 { background: var(--d2); } .dh-3 { background: var(--d3); } .dh-4 { background: var(--d4); }
.dh-5 { background: var(--d5); } .dh-6 { background: var(--d6); } .dh-7 { background: var(--d7); }
.dh-8 { background: var(--d8); }

/* bảng màu môn / lớp - cùng thứ tự với style.css để màu quen thuộc */
.subj-0 {--cell:#dbeafe;--accent:#2563eb;--accent-ink:#1e3a8a;--edge:#9db9f6}
.subj-1 {--cell:#dcfce7;--accent:#16a34a;--accent-ink:#14532d;--edge:#94cfaa}
.subj-2 {--cell:#fef3c7;--accent:#d97706;--accent-ink:#92400e;--edge:#eec08e}
.subj-3 {--cell:#fce7f3;--accent:#db2777;--accent-ink:#9d174d;--edge:#ef9fc3}
.subj-4 {--cell:#ede9fe;--accent:#7c3aed;--accent-ink:#5b21b6;--edge:#c1a8f6}
.subj-5 {--cell:#ccfbf1;--accent:#0d9488;--accent-ink:#115e59;--edge:#90cfc9}
.subj-6 {--cell:#fee2e2;--accent:#dc2626;--accent-ink:#991b1b;--edge:#ef9f9f}
.subj-7 {--cell:#cffafe;--accent:#0891b2;--accent-ink:#155e75;--edge:#8fcadd}
.subj-8 {--cell:#ecfccb;--accent:#65a30d;--accent-ink:#3f6212;--edge:#bad38f}
.subj-9 {--cell:#ffedd5;--accent:#ea580c;--accent-ink:#9a3412;--edge:#f4b28e}
.subj-10{--cell:#e2e8f0;--accent:#475569;--accent-ink:#1e293b;--edge:#aab2bd}
.subj-11{--cell:#e0e7ff;--accent:#4f46e5;--accent-ink:#3730a3;--edge:#aeabf2}
.subj-12{--cell:#efe3d5;--accent:#92400e;--accent-ink:#78350f;--edge:#cfad97}
.subj-13{--cell:#fae8ff;--accent:#c026d3;--accent-ink:#86198f;--edge:#e39deb}

/* =================================================== MẪU GIÁO VIÊN (.poster-gv) */
.poster-gv {
  background: linear-gradient(135deg, #fff4f6 0%, #fffaf3 22%, #fffaf3 72%, #eef4ff 100%);
  padding: 34px 44px 26px;
}
.poster-gv .deco { position: absolute; }
.deco-tl { left: 34px; top: 26px; width: 300px; height: 190px; }
.deco-tl .d-plant { position: absolute; left: 0; top: 40px; font-size: 104px; }
.deco-tl .d-books { position: absolute; left: 110px; top: 70px; font-size: 118px; }
.deco-tl .d-pen { position: absolute; left: 204px; top: 18px; font-size: 64px; transform: rotate(18deg); }
.deco-tr { right: 30px; top: 22px; width: 300px; height: 190px; }
.deco-tr .d-clock { position: absolute; left: 40px; top: 30px; font-size: 128px; }
.deco-tr .d-plant2 { position: absolute; right: 0; top: 70px; font-size: 92px; }
.deco-tr .d-star { position: absolute; right: 18px; top: 4px; font-size: 40px; color: #93b4f5; font-family: var(--round); }
.heart { font-family: var(--round) !important; color: #f28aa8; }
.heart.h1 { left: 22px; top: 200px; font-size: 40px; }
.heart.h2 { right: 330px; top: 150px; font-size: 30px; color: #f5a3bb; }

.gv-head { text-align: center; position: relative; }
.gv-title {
  margin: 0; font-family: var(--round); font-weight: 800; font-size: 96px; line-height: 1;
  color: var(--navy); letter-spacing: 2px; position: relative; display: inline-block;
  padding-top: 8px;
}
.ray { position: absolute; top: 34px; width: 46px; height: 46px; }
.ray::before, .ray::after {
  content: ""; position: absolute; height: 7px; border-radius: 4px; background: #fbbf24;
}
.ray::before { width: 40px; top: 0; }
.ray::after { width: 30px; top: 22px; }
.ray-l { left: -74px; } .ray-l::before { transform: rotate(22deg); } .ray-l::after { left: 6px; transform: rotate(-8deg); }
.ray-r { right: -74px; } .ray-r::before { right: 0; transform: rotate(-22deg); } .ray-r::after { right: 6px; transform: rotate(8deg); }

.gv-nameline { display: flex; justify-content: center; align-items: center; gap: 26px; margin-top: 4px; }
.gv-year { font-family: var(--round); font-weight: 800; font-size: 44px; color: var(--navy); }
.gv-ribbon {
  position: relative; font-family: var(--script); font-size: 66px; line-height: 1.15;
  color: #d23a6c; padding: 0 60px 4px;
  background: linear-gradient(180deg, #ffd9e3, #ffc9d7);
  clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%);
  transform: rotate(-1.5deg);
}
.gv-quote { margin: 12px 0 0; font-size: 25px; font-weight: 700; color: #334155; }
.gv-quote .q { color: #f472b6; font-size: 30px; }
.gv-meta { margin: 6px 0 18px; font-size: 19px; font-weight: 700; color: #7c8499; }

.pt-gv {
  border: 2px solid #d6def0; border-radius: 22px; overflow: hidden; background: #fff;
  box-shadow: 0 6px 0 rgba(30, 42, 92, .05);
}
.pt-gv .pt-corner {
  width: 118px; background: var(--navy); color: #fff; font-size: 27px; font-weight: 800;
}
.pt-gv .dh { border-left: 2px solid rgba(255,255,255,.6); }
.pt-gv td, .pt-gv .pt-no { border-top: 2px solid #e4e9f4; }
.pt-gv td { border-left: 2px solid #e4e9f4; padding: 9px 12px; height: 70px; }
.pt-gv .pt-no { background: #eef2fd; color: var(--navy); }
.pt-no b { display: block; font-size: 38px; line-height: 1; }
.pt-no small { display: block; font-size: 14px; font-weight: 600; color: #7c8499; margin-top: 2px; }
.pt-ses td {
  height: auto !important; padding: 4px !important; background: #f6f8ff;
  font-family: var(--round); font-weight: 800; font-size: 19px; letter-spacing: 3px; color: #6b7aa6;
}
.pt-ses-C td { background: #fff6ec; color: #b7791f; }
.pill {
  display: inline-block; min-width: 150px; max-width: 100%; padding: 7px 16px 4px;
  border-radius: 12px; background: var(--cell); color: var(--accent-ink);
  border: 2px solid var(--edge);
  font-weight: 800; font-size: 30px; line-height: 1.05;
  box-shadow: 0 3px 0 rgba(30, 42, 92, .08);
}
.pill small { display: block; font-size: 16px; font-weight: 700; opacity: .85; }
.dash { color: #9aa3b8; font-size: 28px; font-weight: 700; }

.gv-foot { display: grid; grid-template-columns: 250px 1fr 200px; gap: 26px; align-items: center; margin-top: 26px; }
.sticky {
  position: relative; background: linear-gradient(160deg, #fff7c2, #fde68a);
  padding: 34px 18px 26px; text-align: center; transform: rotate(-3deg);
  box-shadow: 6px 8px 0 rgba(146, 108, 20, .12); font-family: var(--round);
  font-size: 30px; font-weight: 700; color: var(--navy); line-height: 1.15;
}
.sticky .pin { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 44px; font-family: var(--emoji); }
.sticky span { display: block; }
.sticky strong { color: #d23a6c; font-size: 72px; line-height: 1; margin-right: 6px; display: inline; }
.sticky strong + span { display: inline; }
.gv-summary {
  position: relative; border: 2px dashed #b7c3e3; border-radius: 22px; background: #f7f9ff;
  padding: 36px 30px 18px;
}
.sum-title {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%);
  background: #2d4bb3; color: #fff; font-family: var(--round); font-weight: 800; font-size: 25px;
  padding: 6px 34px 3px; letter-spacing: 1px; white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, 97% 50%, 100% 100%, 0 100%, 3% 50%);
}
.sum-title span { color: #fcd34d; }
.sum-grid { display: grid; grid-auto-flow: column; grid-template-columns: 1fr 1fr; gap: 6px 40px; }
.sum-day { display: grid; grid-template-columns: 138px 1fr; font-size: 20px; line-height: 1.4; }
.sum-day em { font-style: normal; font-weight: 800; color: #b7791f; }
.sum-day .muted { color: #8a93a8; }
.dt { font-family: var(--round); font-weight: 800; }
.dt-2 { color: var(--d2); } .dt-3 { color: #e08a00; } .dt-4 { color: #3a9d33; }
.dt-5 { color: var(--d5); } .dt-6 { color: var(--d6); } .dt-7 { color: var(--d7); } .dt-8 { color: var(--d8); }
.deco-br { display: flex; flex-direction: column; align-items: center; }
.deco-br span:first-child { font-size: 72px; margin-bottom: -8px; }
.deco-br span:last-child { font-size: 118px; }
.gv-wish {
  text-align: center; margin: 14px 0 0; font-family: var(--script); font-size: 38px; color: var(--navy);
}
.gv-wish span:last-child { font-family: var(--emoji); font-size: 30px; }

/* =================================================== MẪU HỌC SINH (.poster-hs) */
.poster-hs {
  background: linear-gradient(180deg, #bfe5ff 0%, #e6f6ff 26%, #f5fbff 60%, #eaf8df 100%);
  padding: 30px 40px 28px;
}
.sky { position: absolute; inset: 0; pointer-events: none; }
.rainbow { position: absolute; right: 94px; top: -236px; width: 520px; height: 520px; opacity: .5; }
.rainbow i { position: absolute; border-radius: 50%; border: 17px solid; }
.rainbow i:nth-child(1) { inset: 0;    border-color: #f87171; }
.rainbow i:nth-child(2) { inset: 16px; border-color: #fb923c; }
.rainbow i:nth-child(3) { inset: 32px; border-color: #facc15; }
.rainbow i:nth-child(4) { inset: 48px; border-color: #4ade80; }
.rainbow i:nth-child(5) { inset: 64px; border-color: #60a5fa; }
.rainbow i:nth-child(6) { inset: 80px; border-color: #a78bfa; }
.sun { position: absolute; right: 44px; top: 18px; font-size: 96px; }
.cloud { position: absolute; background: #fff; border-radius: 60px; opacity: .9; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud.c1 { left: 560px; top: 30px; width: 170px; height: 50px; }
.cloud.c1::before { width: 80px; height: 80px; left: 26px; top: -40px; }
.cloud.c1::after { width: 60px; height: 60px; left: 88px; top: -26px; }
.cloud.c2 { left: 1180px; top: 190px; width: 120px; height: 38px; opacity: .75; }
.cloud.c2::before { width: 56px; height: 56px; left: 20px; top: -28px; }
.cloud.c2::after { width: 44px; height: 44px; left: 64px; top: -18px; }
.cloud.c3 { left: 60px; top: 230px; width: 110px; height: 34px; opacity: .7; }
.cloud.c3::before { width: 50px; height: 50px; left: 18px; top: -26px; }
.cloud.c3::after { width: 40px; height: 40px; left: 58px; top: -16px; }
.hill { position: absolute; bottom: -120px; border-radius: 50%; }
.hill.hl1 { left: -200px; width: 1200px; height: 330px; background: #bfe59e; }
.hill.hl2 { right: -260px; width: 1300px; height: 300px; background: #a8dc84; }

.hs-sign {
  position: absolute; left: 34px; top: 26px; z-index: 2; display: flex; align-items: center; gap: 12px;
  width: 330px; padding: 12px 18px 12px 12px; border-radius: 14px;
  background: linear-gradient(180deg, #f7dca8, #e9bf7a); border: 4px solid #a8733a;
  border-bottom: 9px solid #8a5a2b; transform: rotate(-4deg);
  font-family: var(--round); font-weight: 800; font-size: 22px; line-height: 1.15; color: #5a3714;
}
.hs-sign img { width: 64px; height: 64px; border-radius: 50%; background: #fff; flex: none; }
.hs-kids { position: absolute; right: 140px; top: 96px; z-index: 2; font-size: 96px; letter-spacing: -14px; }

.hs-head { position: relative; z-index: 1; text-align: center; margin: 0 0 22px 368px; width: 860px; }
.hs-title {
  display: inline-block; margin: 0; padding: 18px 50px 4px; font-family: var(--round); font-weight: 800;
  font-size: 96px; line-height: 1; background: #fff; border-radius: 80px;
  box-shadow: 0 8px 0 rgba(59, 130, 246, .12);
}
.hs-title span {
  display: inline-block;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .12);
}
.hs-title .sp { width: 26px; }
.hs-title .l0 { color: #ec4f8e; transform: rotate(-4deg); }
.hs-title .l1 { color: #f97316; transform: translateY(-4px); }
.hs-title .l2 { color: #eab308; transform: rotate(3deg); }
.hs-title .l3 { color: #22a55a; }
.hs-title .l4 { color: #0ea5e9; transform: translateY(-5px) rotate(-3deg); }
.hs-title .l5 { color: #6366f1; }
.hs-title .l6 { color: #a855f7; transform: rotate(4deg); }
.hs-ribbon {
  display: inline-block; margin-top: -8px; padding: 10px 70px 6px; position: relative;
  background: linear-gradient(180deg, #fde047, #facc15); color: #3b2f0b;
  font-family: var(--round); font-weight: 800; font-size: 30px; letter-spacing: .5px;
  clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%);
  transform: rotate(-1.5deg);
}

.hs-ribbon { line-height: 1.2; }
.hs-year { font-size: 26px; }

.pt-hs { position: relative; z-index: 1; border-spacing: 6px; }
.pt-hs thead th { border-radius: 16px 16px 6px 6px; }
.pt-hs .c-buoi, .pt-hs .c-tiet { background: #2f7de1; color: #fff; font-size: 26px; font-weight: 800; }
.pt-hs .c-buoi { width: 150px; } .pt-hs .c-tiet { width: 130px; background: #3b95ea; }
.pt-hs .buoi { border-radius: 16px; font-size: 32px; font-weight: 800; color: var(--navy); }
.buoi-S { background: #fff4c7; border: 3px solid #f5d77a; }
.buoi-C { background: #dff0ff; border: 3px solid #a9cff5; }
.buoi-icon { display: block; font-size: 64px; font-family: var(--emoji); line-height: 1.1; }
.pt-hs .tiet { background: #e5f1ff; border-radius: 10px; font-size: 32px; font-weight: 800; color: var(--navy); }
.pt-hs td { border-radius: 10px; height: 68px; padding: 6px 8px; }
.dc-2 { background: var(--p2); } .dc-3 { background: var(--p3); } .dc-4 { background: var(--p4); }
.dc-5 { background: var(--p5); } .dc-6 { background: var(--p6); } .dc-7 { background: var(--p7); }
.dc-8 { background: var(--p8); }
.subj { display: block; font-size: 30px; font-weight: 800; line-height: 1.05; }
.pt-hs td small { display: block; font-family: "Nunito", sans-serif; font-size: 15px; font-weight: 700; color: #5b6479; margin-top: 2px; }
.ink-0 { color: #1d4ed8; } .ink-1 { color: #15803d; } .ink-2 { color: #b45309; } .ink-3 { color: #db2777; }
.ink-4 { color: #6d28d9; } .ink-5 { color: #0f766e; } .ink-6 { color: #dc2626; } .ink-7 { color: #0e7490; }
.ink-8 { color: #4d7c0f; } .ink-9 { color: #ea580c; } .ink-10 { color: #1e293b; } .ink-11 { color: #4338ca; }
.ink-12 { color: #92400e; } .ink-13 { color: #a21caf; }

.hs-foot {
  position: relative; z-index: 1; display: grid; grid-template-columns: 150px 1fr 250px 150px;
  gap: 20px; align-items: center; margin-top: 18px;
}
.hs-deco-l { font-size: 82px; display: flex; align-items: flex-end; }
.hs-deco-l span:last-child { font-size: 56px; margin-left: -18px; transform: rotate(-20deg); }
.hs-deco-r { font-size: 118px; text-align: center; }
.hs-note {
  background: rgba(255, 255, 255, .92); border-radius: 22px; border: 3px dashed #f5c26b;
  padding: 16px 26px 12px; font-size: 22px;
}
.note-tag { font-family: var(--round); font-size: 26px; color: var(--navy); margin-bottom: 4px; }
.hs-note ul { margin: 0; padding: 0; list-style: none; font-style: italic; }
.hs-note li { margin: 4px 0; color: #28324d; }
.hs-note li b { font-style: normal; color: var(--navy); }
.hs-note .ic { font-family: var(--emoji); font-style: normal; }
.hs-motto {
  font-family: var(--script); font-size: 52px; line-height: 1; color: var(--navy);
  transform: rotate(-6deg); text-align: center;
}

/* ------------------------------------------------------------------ in A4 */
@media print {
  @page { size: A4 landscape; margin: 6mm; }
  body.poster-page { background: #fff; }
  .no-print { display: none !important; }
  .poster-stage { padding: 0; height: auto !important; display: flex; justify-content: center; }
  .poster { transform: none !important; zoom: var(--print-zoom, .66); box-shadow: none; border-radius: 0; }
}
