/* MinuteMinds — giao diện trang nộp bài & quản lý */
:root {
  --paper: #FFF7EA; --paper-dot: #EBDCC3; --ink: #261F3F; --ink-soft: #564E73; --muted: #8A82A3; --line: #E6D8BF;
  --tomato: #FF5B4A; --tomato-soft: #FFDCD6; --sun: #FFC93C; --sun-soft: #FFF0C4;
  --mint: #2EC68A; --mint-soft: #CFF4E3; --sky: #4C9DFF; --sky-soft: #D8E9FF;
  --lilac: #9B7BFF; --lilac-soft: #E8DFFF; --pink: #FF77B0; --pink-soft: #FFDDEB; --peach: #FFA36B; --peach-soft: #FFE4D2;
  --c: var(--lilac); --cs: var(--lilac-soft);
  --f-display: "Baloo 2", "Be Vietnam Pro", system-ui, sans-serif;
  --f-body: "Be Vietnam Pro", system-ui, sans-serif;
  --f-hand: "Shantell Sans", "Be Vietnam Pro", cursive;
  --pop: cubic-bezier(.2, 1.55, .45, 1);
}
body.s1 { --c: #FFC93C; --cs: var(--sun-soft); }
body.s2 { --c: #FFA36B; --cs: var(--peach-soft); }
body.s3 { --c: #FF7A6B; --cs: var(--tomato-soft); }
body.s4 { --c: #6FB0FF; --cs: var(--sky-soft); }
body.s5 { --c: #4FD39C; --cs: var(--mint-soft); }
body.s6 { --c: #FF8DBE; --cs: var(--pink-soft); }
body.s7 { --c: #B39BFF; --cs: var(--lilac-soft); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--f-body); font-size: 17px; line-height: 1.5;
  background-color: var(--paper);
  background-image: radial-gradient(var(--paper-dot) 1.4px, transparent 1.7px); background-size: 26px 26px;
  overflow-x: hidden;
}
a { color: inherit; }
img.emo { width: 1.3em; height: 1.3em; vertical-align: -0.3em; object-fit: contain; }
.page { max-width: 1240px; margin: 0 auto; padding: 20px 28px 48px; }
.page.narrow { max-width: 760px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 26px/1 var(--f-display); text-decoration: none; }
.brand .dot { width: 15px; height: 15px; border-radius: 50%; background: var(--tomato); border: 3px solid var(--ink); }
.top .link { font-weight: 700; font-size: 15px; text-decoration: none; border: 2.5px solid var(--ink); border-radius: 99px; padding: 6px 14px 7px; background: #fff; }
h1 { font: 800 clamp(30px, 5vw, 46px)/1.05 var(--f-display); margin: 0 0 10px; letter-spacing: -0.01em; }
h2 { font: 800 26px/1.1 var(--f-display); margin: 0 0 12px; }
.muted { color: var(--ink-soft); }
.small { font-size: 15px; }

/* Thẻ */
.box { background: #fff; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); padding: 22px; }
.box + .box { margin-top: 22px; }
.box.head-card { padding: 0; overflow: hidden; }
.head-card .band { background: var(--c); border-bottom: 3px solid var(--ink); padding: 18px 22px 16px; position: relative; min-height: 96px; }
.head-card .band img { position: absolute; right: 16px; bottom: -26px; width: 86px; height: 86px; filter: drop-shadow(0 8px 8px rgba(38,31,63,.18)); }
.badge { display: inline-flex; align-items: center; gap: 6px; font: 800 14px/1 var(--f-body); padding: 6px 11px 7px; border: 2.5px solid var(--ink); border-radius: 99px; background: #fff; white-space: nowrap; }
.badge.ink { background: var(--ink); color: var(--paper); }
.badge.ok { background: var(--mint-soft); }
.badge.warn { background: var(--sun-soft); }
.badge.bad { background: var(--tomato-soft); }
.badge.off { background: #ECE8F3; color: var(--ink-soft); }
.head-card .body { padding: 26px 22px 22px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 6px 0 12px; }
.note { font-size: 15px; color: var(--ink-soft); background: var(--paper); border: 2px dashed var(--muted); border-radius: 14px; padding: 10px 14px; margin-top: 14px; }

/* Biểu mẫu */
.field { margin: 0 0 22px; }
.field > label, .field > .lbl { display: block; font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.field .req { color: var(--tomato); margin-left: 3px; }
.field .hint { display: block; font-size: 14.5px; color: var(--ink-soft); margin: -2px 0 8px; }
input[type=text], input[type=url], input[type=password], input[type=datetime-local], textarea, select {
  width: 100%; font: 500 16px/1.4 var(--f-body); color: var(--ink); background: #fff;
  border: 2.5px solid var(--ink); border-radius: 14px; padding: 11px 13px;
}
textarea { resize: vertical; min-height: 92px; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--c); outline-offset: 2px; }
.field.invalid input, .field.invalid textarea, .field.invalid select, .field.invalid .likert, .field.invalid .drop, .field.invalid .checks { border-color: var(--tomato); box-shadow: 0 0 0 3px var(--tomato-soft); }
.field .err { display: none; color: #C2281A; font-size: 14.5px; font-weight: 700; margin-top: 6px; }
.field.invalid .err { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Thang 1–5 */
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; border: 2.5px solid transparent; border-radius: 16px; padding: 2px; }
.likert label { position: relative; display: grid; place-items: center; height: 48px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; font: 800 19px/1 var(--f-display); cursor: pointer; transition: transform .15s, background .15s; }
.likert input { position: absolute; opacity: 0; pointer-events: none; }
.likert label:hover { transform: translateY(-2px); }
.likert input:checked + span { color: var(--ink); }
.likert label:has(input:checked) { background: var(--c); box-shadow: 3px 3px 0 var(--ink); }
.likert label:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.likert-ends { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-soft); margin-top: 5px; font-weight: 600; }
.scale-item { padding: 14px 0 16px; border-top: 2px dashed var(--line); }
.scale-item:first-of-type { border-top: 0; padding-top: 4px; }
.scale-item .q { font-weight: 700; font-size: 16.5px; margin-bottom: 8px; }
.scale-item.invalid .likert { border-color: var(--tomato); }

/* Chọn nhiều */
.checks { display: flex; flex-wrap: wrap; gap: 8px; border: 2.5px solid transparent; border-radius: 16px; padding: 2px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; border: 2.5px solid var(--ink); border-radius: 99px; padding: 8px 14px 9px; background: #fff; font-weight: 600; font-size: 15.5px; cursor: pointer; }
.checks input { width: 18px; height: 18px; accent-color: var(--ink); }
.checks label:has(input:checked) { background: var(--cs); }

/* File */
.drop { border: 2.5px dashed var(--ink-soft); border-radius: 16px; padding: 16px; background: rgba(255,255,255,.7); text-align: center; }
.drop.over { background: var(--cs); }
.drop input { display: none; }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.file-list li { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 10px; font-size: 15px; }
.file-list li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-list li .sz { color: var(--ink-soft); font-size: 13.5px; white-space: nowrap; }
.file-list li button { border: 0; background: var(--tomato-soft); border-radius: 8px; width: 30px; height: 30px; font-weight: 800; cursor: pointer; color: var(--ink); }

/* Nút */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 800 17px/1 var(--f-body); color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 13px 22px 14px; box-shadow: 4px 4px 0 var(--ink); cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn.primary { background: var(--c); }
.btn.dark { background: var(--ink); color: var(--paper); }
.btn.small { font-size: 14.5px; padding: 8px 14px 9px; box-shadow: 3px 3px 0 var(--ink); }
.btn.danger { background: var(--tomato-soft); }
.btn[disabled] { opacity: .55; cursor: wait; transform: none; }
.btn.block { width: 100%; }
.progress { height: 14px; border: 2.5px solid var(--ink); border-radius: 99px; overflow: hidden; background: #fff; margin-top: 14px; display: none; }
.progress i { display: block; height: 100%; width: 0; background: var(--c); transition: width .2s; }
.status { margin-top: 12px; font-weight: 700; }
.status.bad { color: #C2281A; }

/* Kết quả nộp */
.done { text-align: center; }
.done .big { font: 800 34px/1.1 var(--f-display); margin: 8px 0; }
.copy-row { display: flex; gap: 8px; margin: 14px 0 6px; }
.copy-row input { flex: 1; min-width: 0; font-size: 14px; }

/* Danh sách bài nộp (trang /nop/) */
.forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.f-card { position: relative; display: flex; flex-direction: column; gap: 6px; text-decoration: none; background: #fff; border: 3px solid var(--ink); border-radius: 20px; box-shadow: 5px 5px 0 var(--ink); padding: 16px 16px 14px; transition: transform .3s var(--pop); }
.f-card:hover { transform: translateY(-4px) rotate(-.6deg); }
.f-card .row1 { display: flex; align-items: center; gap: 8px; }
.f-card img { width: 44px; height: 44px; margin-left: auto; }
.f-card b { font: 800 21px/1.15 var(--f-display); }
.f-card .due { font-size: 14px; color: var(--ink-soft); }
.f-card .chip-band { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--fc); flex: none; }
.sec-h { font: 800 22px/1.1 var(--f-display); margin: 30px 0 14px; }

/* Bảng chung (trang quản lý) */
table.t { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; font-size: 15px; }
table.t th { background: var(--ink); color: var(--paper); text-align: left; font-weight: 800; padding: 10px 12px; white-space: nowrap; }
table.t td { padding: 9px 12px; border-top: 2px solid var(--line); vertical-align: top; }
table.t tr:hover td { background: #FFFBF3; }
.tbl-wrap { overflow-x: auto; border-radius: 16px; }

@media (max-width: 560px) {
  .page { padding: 14px 16px 36px; }
  .box { padding: 18px 16px; }
  .head-card .body { padding: 24px 16px 18px; }
  .likert label { height: 44px; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Trang quản lý ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; align-items: center; }
.tabs button { font: 800 15.5px/1 var(--f-body); color: var(--ink); background: #fff; border: 2.5px solid var(--ink); border-radius: 99px; padding: 10px 16px 11px; cursor: pointer; }
.tabs button.on { background: var(--ink); color: var(--paper); }
.tabs .spacer { flex: 1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font: 800 34px/1 var(--f-display); }
.kpi span { font-weight: 700; }
.kpi small { color: var(--ink-soft); font-size: 13.5px; line-height: 1.35; }
.kpi.good { background: var(--mint-soft); }
.kpi.bad { background: var(--sun-soft); }
.big-n { font: 800 30px/1 var(--f-display); margin-top: 4px; }
.big-n small { font: 600 14px/1 var(--f-body); color: var(--ink-soft); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.toolbar select, .toolbar input { width: auto; flex: 1 1 200px; padding: 9px 12px; font-size: 15px; }
.toolbar .btn { flex: none; }
tr.clickable { cursor: pointer; }
.matrix-t td.cell { text-align: center; padding: 6px; }
.matrix-t td.cell button { width: 36px; height: 32px; border: 2px solid var(--ink); border-radius: 10px; font-weight: 800; cursor: pointer; background: #ECE8F3; }
.matrix-t td.cell.warn button { background: var(--sun-soft); }
.matrix-t td.cell.bad button { background: var(--tomato-soft); }
.matrix-t td.cell.ok button { background: var(--mint); }
.matrix-t td.cell.none { color: var(--muted); }
.matrix-t th { font-size: 13.5px; }
.bars-h { display: flex; flex-direction: column; gap: 8px; }
.bh { display: grid; grid-template-columns: minmax(140px, 260px) 1fr 40px; gap: 10px; align-items: center; font-size: 15px; font-weight: 600; }
.bh i { height: 18px; border: 2px solid var(--ink); border-radius: 99px; background: linear-gradient(90deg, var(--c) var(--w), #fff 0); }
.quotes p { margin: 0 0 10px; padding-bottom: 10px; border-bottom: 2px dashed var(--line); }
.quotes p:last-child { margin: 0; padding: 0; border: 0; }
.linkish { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; color: var(--ink); }

.drawer { position: fixed; inset: 0; z-index: 50; background: rgba(38, 31, 63, .45); display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer-panel { position: relative; width: min(720px, 100%); height: 100%; background: var(--paper); border-left: 3px solid var(--ink); display: flex; flex-direction: column; }
.drawer-panel header { display: flex; justify-content: flex-end; padding: 12px 14px 0; }
#drawer-body { overflow-y: auto; padding: 4px 24px 30px; }
.ans { background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 12px 14px; margin: 0 0 12px; }
.ans p { margin: 6px 0 0; white-space: pre-wrap; }
.ans ul { margin: 8px 0 0; padding-left: 20px; font-size: 15px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 8px; }
.th { display: flex; flex-direction: column; gap: 6px; border: 2px solid var(--line); border-radius: 12px; padding: 8px; background: var(--paper); }
.th img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); cursor: zoom-in; background: #fff; }
.th .ph { height: 150px; display: grid; place-items: center; border-radius: 8px; background: #fff; border: 2px dashed var(--muted); font-size: 26px; color: var(--ink-soft); text-align: center; }
.th small { font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.review { background: var(--cs); border: 2.5px solid var(--ink); border-radius: 16px; padding: 14px; margin: 4px 0 14px; }
.seg-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.seg-btns label { cursor: pointer; }
.seg-btns input { position: absolute; opacity: 0; pointer-events: none; }
.seg-btns .badge { font-size: 14.5px; padding: 8px 12px 9px; opacity: .55; }
.seg-btns input:checked + .badge { opacity: 1; box-shadow: 3px 3px 0 var(--ink); }
.seg-btns input:focus-visible + .badge { outline: 3px solid var(--ink); outline-offset: 2px; }

/* In mã QR */
#print-area[hidden] { display: none; }
#print-area { position: fixed; inset: 0; z-index: 80; background: #fff; display: grid; place-items: center; }
.pq { text-align: center; width: 150mm; }
.pq h1 { font-size: 30pt; margin: 6mm 0; }
.pq svg { width: 110mm; height: 110mm; }
.pq-badge { display: inline-block; font: 800 16pt/1 var(--f-body); border: 2pt solid #261F3F; border-radius: 99px; padding: 3mm 6mm; }
.pq-url { font: 800 20pt/1.2 var(--f-body); margin: 6mm 0 2mm; }
.pq-due { font-size: 14pt; color: #564E73; margin: 0; }
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; inset: 0; }
  @page { size: A4; margin: 15mm; }
}
