/* GIAO TIẾN PLUS – tông xanh dương & trắng, chữ dễ đọc, nút lớn dễ bấm */
:root {
  --blue: #1d4ed8; --blue-d: #1e3a8a; --blue-l: #dbeafe; --blue-xl: #eff6ff;
  --ink: #0f172a; --ink2: #334155; --muted: #64748b; --line: #e2e8f0; --bg: #f4f7fc; --card: #ffffff;
  --green: #15803d; --green-l: #dcfce7; --red: #b91c1c; --red-l: #fee2e2; --amber: #b45309; --amber-l: #fef3c7;
  --orange: #c2410c; --orange-l: #ffedd5; --violet: #6d28d9; --violet-l: #ede9fe; --gray: #475569; --gray-l: #f1f5f9;
  --r: 14px; --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --side: 264px; --top: 64px; --bottom: 68px;
  font-size: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: "Be Vietnam Pro", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 1.5rem; margin: 0; line-height: 1.25; }
h2 { font-size: 1.15rem; } h3 { font-size: 1.02rem; margin: 0; } h4 { margin: 16px 0 8px; font-size: .95rem; }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-l); }
input.dirty { border-color: var(--amber); background: #fffbeb; }
textarea { resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--blue); }
input[type=range] { width: 100%; accent-color: var(--blue); height: 32px; }
code { background: var(--gray-l); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
code.wrap, .wrap { white-space: pre-wrap; word-break: break-all; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .lg { font-size: 1.15rem; } .nowrap { white-space: nowrap; } .grow { flex: 1; min-width: 0; }
.pre { white-space: pre-wrap; margin: 0 0 8px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.ic { flex: none; }

/* Nút */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; } .btn-primary:hover:not(:disabled) { background: var(--blue-d); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: #fff; border-color: #cbd5e1; color: var(--ink2); } .btn-ghost:hover:not(:disabled) { background: var(--blue-xl); border-color: var(--blue); color: var(--blue); }
.btn-danger-ghost { background: #fff; border-color: #fecaca; color: var(--red); } .btn-danger-ghost:hover { background: var(--red-l); }
.btn.block { width: 100%; } .btn.lg { min-height: 54px; font-size: 1.05rem; margin: 8px 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.link { background: none; border: none; color: var(--blue); cursor: pointer; padding: 4px 0; font-weight: 600; text-align: left; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; border: none; background: transparent; cursor: pointer; color: var(--ink2); position: relative; }
.icon-btn:hover { background: var(--blue-xl); color: var(--blue); }
td .btn { min-height: 38px; padding: 6px 10px; margin: 2px 2px 2px 0; }

/* Khung */
.app { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: linear-gradient(180deg, #1e40af, #1d4ed8 60%, #2563eb); color: #fff; display: flex; flex-direction: column; z-index: 20; }
.side nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px; color: inherit; }
.brand b { display: block; letter-spacing: .5px; } .brand small { display: block; font-size: .68rem; opacity: .85; letter-spacing: .4px; }
.brand img { border-radius: 50%; background: #fff; flex: none; object-fit: contain; }
.side .brand img { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
.nav-i { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: 10px; color: #e0e7ff; font-weight: 500; position: relative; min-height: 44px; }
.nav-i:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav-i.on { background: #fff; color: var(--blue-d); font-weight: 700; }
.nav-i span { flex: 1; }
.ph { font-style: normal; font-size: .66rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: rgba(255, 255, 255, .2); }
.nav-i.on .ph { background: var(--violet-l); color: var(--violet); }
.dotn { width: 9px; height: 9px; border-radius: 50%; background: #f43f5e; display: inline-block; }
.nav-i .dotn { position: absolute; left: 30px; top: 9px; }
.dotn.static { flex: none; }
.side-foot { padding: 10px 16px; font-size: .75rem; opacity: .75; }
.main { margin-left: var(--side); min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 15; height: var(--top); display: flex; align-items: center; gap: 8px; padding: 0 20px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .brand { padding: 0; color: var(--blue-d); }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--muted); }
.search input { border: none !important; background: transparent !important; box-shadow: none !important; min-height: 42px !important; padding: 0 !important; }
.bell { margin-left: auto; }
.bubble { position: absolute; top: 4px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: #e11d48; color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
.me { display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 4px 8px; border-radius: 12px; }
.me:hover { background: var(--blue-xl); }
.me b { display: block; font-size: .9rem; } .me small { display: block; color: var(--muted); font-size: .75rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--blue-l); color: var(--blue-d); font-weight: 700; flex: none; }
.banner { padding: 6px 20px; font-size: .82rem; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.banner.demo { background: var(--amber-l); color: #92400e; }
.banner.off { background: var(--red-l); color: var(--red); }
.content { padding: 20px 24px 40px; max-width: 1400px; margin: 0 auto; }
.bottom, .only-m { display: none; }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-h p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; margin-bottom: 6px; }
h2.sec { margin: 24px 0 12px; }

/* Thẻ, lưới */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px 0; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-b { padding: 14px 16px 16px; }
.card.mine { border-color: #93c5fd; box-shadow: 0 0 0 3px var(--blue-xl), var(--shadow); }
.card.muted-card { background: #fafbff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
.grid2.wide-left { grid-template-columns: 1.6fr 1fr; } .grid2.wide-right { grid-template-columns: 1fr 1.8fr; }
.grid2 > *, .main, .content { min-width: 0; }
.main { overflow-x: clip; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); cursor: pointer; }
.stat:disabled { cursor: default; opacity: 1; }
.stat:hover:not(:disabled) { border-color: currentColor; }
.stat .ic { padding: 9px; width: 42px; height: 42px; border-radius: 12px; }
.stat-v { font-size: 1.6rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.stat-l { font-size: .85rem; color: var(--ink2); } .stat-h { font-size: .75rem; color: var(--muted); }
.stat.tone-blue .ic { background: var(--blue-l); color: var(--blue); } .stat.tone-red .ic { background: var(--red-l); color: var(--red); }
.stat.tone-green .ic { background: var(--green-l); color: var(--green); } .stat.tone-amber .ic { background: var(--amber-l); color: var(--amber); }
.stat.tone-violet .ic { background: var(--violet-l); color: var(--violet); } .stat.tone-gray .ic { background: var(--gray-l); color: var(--gray); }
.stat.tone-red .stat-v { color: var(--red); }

/* Lớp chủ nhiệm */
.class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 8px; }
.class-card { border: 1px solid #bfdbfe; background: var(--blue-xl); border-radius: 12px; padding: 12px 14px; }
.class-name { font-size: 1.6rem; font-weight: 800; color: var(--blue-d); line-height: 1.1; }
.class-meta { font-size: .85rem; color: var(--ink2); margin: 2px 0 6px; }
.class-count { font-size: .9rem; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); background: #fffdf5; }
.quick span { font-size: .8rem; color: var(--muted); align-self: center; margin-right: 2px; }
.quick button { border: 1px solid #fcd34d; background: #fff; border-radius: 99px; padding: 4px 10px; font-size: .8rem; font-weight: 600; cursor: pointer; min-height: 32px; }
.quick button.on { background: var(--amber); border-color: var(--amber); color: #fff; }

.att-row.hs-absent { background: #fff7ed; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 8px; }
.hs-note { margin-top: 6px; min-height: 38px !important; padding: 6px 10px !important; font-size: .88rem; }

/* Danh sách */
.list { display: flex; flex-direction: column; }
.row, .row-link { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); min-height: 56px; }
.row-link { cursor: pointer; background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; }
.row-link:hover { background: var(--blue-xl); }
.list > :last-child { border-bottom: none; }
.list.compact .row { min-height: 44px; padding: 8px 2px; }
.list.cards { gap: 10px; }
.list.cards > .row, .list.cards > .row-link { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.list.cards > .row-link:hover { border-color: #93c5fd; background: #fff; }
.t { font-weight: 600; } .t.unread { font-weight: 800; color: var(--blue-d); }
.meta { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.excerpt { font-size: .88rem; color: var(--ink2); margin-top: 4px; }
.right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.notif.unread { background: #f8fbff !important; border-color: #bfdbfe !important; }
.nicon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.nicon.tone-red { background: var(--red-l); color: var(--red); } .nicon.tone-amber { background: var(--amber-l); color: var(--amber); }
.nicon.tone-green { background: var(--green-l); color: var(--green); } .nicon.tone-blue { background: var(--blue-l); color: var(--blue); }
.mini-counts { flex-direction: row; gap: 2px; font-weight: 700; }

/* Nhãn trạng thái */
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badges.big { margin-bottom: 14px; } .badges.big .badge { font-size: .85rem; padding: 4px 12px; }
.tone-blue.badge { background: var(--blue-l); color: var(--blue-d); } .tone-green.badge { background: var(--green-l); color: var(--green); }
.tone-red.badge { background: var(--red-l); color: var(--red); } .tone-amber.badge { background: var(--amber-l); color: var(--amber); }
.tone-orange.badge { background: var(--orange-l); color: var(--orange); } .tone-violet.badge { background: var(--violet-l); color: var(--violet); }
.tone-gray.badge { background: var(--gray-l); color: var(--gray); }
span.tone-green, td.tone-green { color: var(--green); } span.tone-red, td.tone-red { color: var(--red); font-weight: 700; } span.tone-amber { color: var(--amber); } span.tone-gray { color: var(--muted); }

/* Thanh tiến độ, biểu đồ */
.pbar { height: 8px; background: var(--gray-l); border-radius: 99px; overflow: hidden; margin-top: 6px; min-width: 60px; }
td .pbar { display: inline-block; width: 70px; vertical-align: middle; margin: 0 6px 0 0; }
.pbar-v { height: 100%; background: var(--blue); border-radius: 99px; transition: width .3s; }
.pbar-v.tone-red { background: #ef4444; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: var(--ink2); margin-bottom: 10px; }
.legend.col { flex-direction: column; gap: 4px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.dot.tone-green, .sbar-seg.tone-green { background: #22c55e; } .dot.tone-blue, .sbar-seg.tone-blue { background: #3b82f6; }
.dot.tone-red, .sbar-seg.tone-red { background: #ef4444; } .dot.tone-amber { background: #f59e0b; } .dot.tone-gray { background: #cbd5e1; } .dot.tone-violet { background: #8b5cf6; }
.sbar-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; margin: 8px 0; }
.sbar-l { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar-track { display: flex; height: 24px; background: var(--gray-l); border-radius: 6px; overflow: hidden; }
.sbar-seg { color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; min-width: 18px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-bg { stroke: var(--gray-l); }
.donut-seg.tone-green { stroke: #22c55e; } .donut-seg.tone-blue { stroke: #3b82f6; } .donut-seg.tone-red { stroke: #ef4444; } .donut-seg.tone-amber { stroke: #f59e0b; } .donut-seg.tone-gray { stroke: #cbd5e1; }
.donut-t { font-size: 8px; font-weight: 800; fill: var(--ink); }

/* Tabs, bộ lọc */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: none; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap; min-height: 44px; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.cnt { background: var(--blue-l); color: var(--blue-d); border-radius: 99px; padding: 0 7px; font-size: .75rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid #cbd5e1; background: #fff; border-radius: 99px; padding: 6px 14px; min-height: 38px; cursor: pointer; font-weight: 600; color: var(--ink2); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { max-width: 420px; }
.toolbar.wrap { flex-wrap: wrap; } .toolbar label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.toolbar select { max-width: 280px; }

/* Bảng */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; background: #f8fafc; color: var(--ink2); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.dim td { opacity: .55; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .c { text-align: center; }
.matrix tr.grp td { background: var(--blue-xl); font-weight: 700; color: var(--blue-d); }
.matrix th.c { white-space: normal; min-width: 90px; font-size: .8rem; }

/* Biểu mẫu */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-l { font-weight: 600; font-size: .92rem; } .req { color: var(--red); font-style: normal; margin-left: 3px; }
.field-h { font-size: .8rem; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.picker { border: 1px solid #cbd5e1; border-radius: 10px; overflow: hidden; }
.picker-top { display: flex; gap: 8px; align-items: center; padding: 8px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.picker-list { max-height: 260px; overflow-y: auto; padding: 4px 8px; }
.picker-gh { display: flex; justify-content: space-between; padding: 8px 2px 2px; font-size: .88rem; color: var(--blue-d); }
.picker-i { display: flex; gap: 10px; align-items: center; padding: 6px 2px; min-height: 40px; cursor: pointer; }
.picker-i small { display: block; color: var(--muted); font-size: .78rem; }
.role-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.role-row select { flex: 1; }
.progress-edit { margin: 10px 0; }
.code-in { display: flex; gap: 8px; } .code-in input { font-size: 1.4rem !important; letter-spacing: 6px; text-align: center; max-width: 220px; }
.msg { padding: 10px 14px; border-radius: 10px; margin: 10px 0; font-weight: 500; }
.msg.err { background: var(--red-l); color: var(--red); } .msg.ok { background: var(--green-l); color: var(--green); }
.msg.warn { background: var(--amber-l); color: #92400e; } .msg.info { background: var(--blue-xl); color: var(--blue-d); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 12px 0 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.file { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--blue-l); }
.timeline li { padding: 0 0 12px 14px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.comments { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; margin-bottom: 10px; }
.cmt { display: flex; gap: 10px; } .cmt > div { background: var(--gray-l); padding: 8px 12px; border-radius: 12px; flex: 1; }
.cmt.me > div { background: var(--blue-xl); }
.cmt-in { display: flex; gap: 8px; align-items: flex-end; }
.livecode { text-align: center; } .livecode .code { font-size: 3.6rem; font-weight: 800; letter-spacing: 8px; color: var(--blue-d); font-variant-numeric: tabular-nums; }
.att-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 10px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 8px 10px; min-height: 40px; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: none; }
.seg button.on.tone-green { background: #22c55e; color: #fff; } .seg button.on.tone-amber { background: #f59e0b; color: #fff; }
.seg button.on.tone-blue { background: #3b82f6; color: #fff; } .seg button.on.tone-red { background: #ef4444; color: #fff; }
.seg button.dirty { box-shadow: inset 0 -3px 0 #0f172a; }
.sticky-save { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 8px; align-items: center; justify-content: flex-end; background: #fff; border: 1px solid #93c5fd; border-radius: var(--r); padding: 10px 14px; box-shadow: 0 8px 30px rgba(29, 78, 216, .18); margin-top: 12px; }
.sticky-save span { margin-right: auto; font-weight: 600; }
.tempw { font-size: 1.6rem; font-weight: 800; letter-spacing: 2px; text-align: center; background: var(--blue-xl); padding: 12px; border-radius: 10px; user-select: all; }
details summary { cursor: pointer; color: var(--blue); }

/* Đang làm mới dữ liệu (đã hiện dữ liệu lần trước) */
.refreshing { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; background: linear-gradient(90deg, transparent, var(--blue), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: refresh 1s linear infinite; }
.refreshing span { position: fixed; top: 6px; right: 12px; font-size: .75rem; color: var(--blue); background: #fff; padding: 2px 8px; border-radius: 99px; box-shadow: var(--shadow); }
@keyframes refresh { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* Trạng thái tải / lỗi / trống */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--muted); }
.state p { margin: 0; max-width: 520px; }
.state.err { color: var(--red); } .state.err b { color: var(--ink); }
.spin { width: 30px; height: 30px; border: 3px solid var(--blue-l); border-top-color: var(--blue); border-radius: 50%; animation: sp 0.8s linear infinite; display: inline-block; }
.spin.sm { width: 16px; height: 16px; border-width: 2px; vertical-align: middle; }
.btn-primary .spin, .btn-success .spin, .btn-danger .spin { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Hộp thoại, thông báo nhanh */
.modal-bg, .sheet-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(15, 23, 42, .3); }
.modal.wide { width: min(900px, 100%); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h h2 { margin: 0; }
.modal-b { padding: 16px 18px; overflow-y: auto; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); max-width: 90vw; }
.toast.err { background: var(--red); }

/* Đăng nhập */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; background: radial-gradient(circle at 20% 0%, #bfdbfe, transparent 50%), linear-gradient(160deg, #eff6ff, #ffffff 60%); }
.login-card { width: min(520px, 100%); background: #fff; border-radius: 22px; padding: 28px; box-shadow: 0 20px 60px rgba(29, 78, 216, .15); border: 1px solid #dbeafe; }
.brand.big { padding: 0 0 6px; color: var(--blue-d); } .brand.big b { font-size: 1.5rem; } .brand.big small { font-size: .78rem; color: var(--blue); font-weight: 700; }
.brand.big img { box-shadow: 0 4px 14px rgba(29, 78, 216, .25); }
.brand.big { gap: 14px; }
.or { text-align: center; color: var(--muted); margin: 14px 0; font-size: .85rem; }
.gsi { display: flex; justify-content: center; min-height: 44px; }
.demo-box { margin-top: 18px; padding: 14px; border-radius: 14px; background: var(--amber-l); color: #78350f; font-size: .88rem; }
.demo-acc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 10px 0; }
.demo-acc button { text-align: left; border: 1px solid #fcd34d; background: #fff; border-radius: 10px; padding: 6px 10px; cursor: pointer; min-height: 44px; }
.demo-acc button:hover { border-color: var(--amber); }
.demo-acc b { display: block; font-size: .85rem; color: var(--ink); } .demo-acc small { color: var(--muted); font-size: .75rem; }

/* Bảng chọn phân hệ trên điện thoại */
.sheet-bg { place-items: end stretch; padding: 0; }
.sheet { background: #fff; border-radius: 22px 22px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 85vh; overflow-y: auto; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--blue-xl); color: var(--blue-d); text-align: center; font-size: .82rem; font-weight: 600; position: relative; min-height: 88px; justify-content: center; }
.sheet-grid a.on { background: var(--blue); color: #fff; }
.sheet-grid .ph { position: absolute; top: 6px; right: 6px; background: var(--violet-l); color: var(--violet); }
.sheet-acc { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 14px; margin-top: 10px; border-top: 1px solid var(--line); font-weight: 600; }

/* Máy tính bảng */
@media (max-width: 1100px) {
  :root { --side: 228px; }
  .grid2, .grid2.wide-left, .grid2.wide-right { grid-template-columns: 1fr; }
}
/* Điện thoại: thanh điều hướng dưới, ẩn menu trái */
@media (max-width: 860px) {
  .side { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--bottom) + env(safe-area-inset-bottom)); }
  .top { padding: 0 8px 0 12px; gap: 2px; }
  .top .search, .only-d { display: none; }
  .only-m { display: inline-flex; }
  .top .brand b { font-size: .95rem; }
  .bell { margin-left: auto; }
  .content { padding: 14px 12px 24px; }
  h1 { font-size: 1.3rem; }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--bottom) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 20px rgba(15, 23, 42, .06); }
  .bottom a, .bottom button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .72rem; font-weight: 600; color: var(--muted); background: none; border: none; position: relative; cursor: pointer; }
  .bottom .on { color: var(--blue); }
  .bottom .on .ic { background: var(--blue-l); border-radius: 99px; width: 52px; padding: 2px 0; height: 26px; }
  .bottom .dotn { position: absolute; top: 8px; left: calc(50% + 8px); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; } .stat .ic { display: none; } .stat-v { font-size: 1.4rem; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .sbar-row { grid-template-columns: 100px 1fr; }
  .row-link.task, .list.cards > .row-link { flex-direction: column; align-items: stretch; }
  .row-link.task .right, .list.cards > .row-link .right { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .modal-f { padding-bottom: calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .toolbar { flex-wrap: wrap; } .toolbar input[type=search] { max-width: none; }
  .demo-acc { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 20px; }
  .att-row .seg { width: 100%; } .seg button { flex: 1; padding: 8px 4px; }
  .toasts { bottom: calc(var(--bottom) + 16px); }
  .sticky-save { bottom: calc(var(--bottom) + 10px); flex-wrap: wrap; }
  .livecode .code { font-size: 2.6rem; }
}
@media print {
  .side, .top, .bottom, .banner, .no-print, .page-actions, .tabs, .btn, .toolbar { display: none !important; }
  .main { margin: 0; } .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  body, html { background: #fff; }
}

/* ---- Lịch công tác ---- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wday { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 8px; min-height: 140px; display: flex; flex-direction: column; gap: 6px; }
.wday.today, .mday.today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.wday-h { font-weight: 700; color: var(--ink2); } .wday-h span { color: var(--muted); font-weight: 500; }
.ev { display: block; width: 100%; text-align: left; border: none; border-left: 3px solid currentColor; border-radius: 6px; padding: 5px 7px; cursor: pointer; font-size: .82rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; }
.ev.tone-blue { background: var(--blue-xl); color: var(--blue-d); } .ev.tone-violet { background: var(--violet-l); color: var(--violet); }
.ev.tone-amber { background: var(--amber-l); color: #92400e; } .ev.tone-gray { background: var(--gray-l); color: var(--ink2); }
.ev.cancelled { text-decoration: line-through; opacity: .6; }
.month-h, .month-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month-h div { font-weight: 700; color: var(--muted); font-size: .8rem; text-align: center; padding: 4px 0; }
.mday { background: #fff; border: 1px solid var(--line); border-radius: 8px; min-height: 92px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mday.out { background: var(--gray-l); opacity: .6; } .mday-n { font-weight: 700; font-size: .8rem; color: var(--ink2); }
.mday .ev { font-size: .72rem; padding: 2px 4px; white-space: nowrap; }
@media (max-width: 760px) {
  .week { grid-template-columns: 1fr; } .wday { min-height: 0; }
  .mday { min-height: 64px; } .mday .ev b { display: none; }
}

/* ---- Biểu mẫu / khảo sát ---- */
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto 44px; gap: 8px; align-items: center; margin-bottom: 8px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; }
.field-row .full { grid-column: 1 / -1; }
.q-block { padding: 12px 0; border-bottom: 1px solid var(--line); } .q-block:last-of-type { border-bottom: none; }
.q-block > .t { font-weight: 600; margin-bottom: 6px; }
.texts { margin: 6px 0 0; padding-left: 20px; color: var(--ink2); } .texts li { margin: 3px 0; }
details summary { cursor: pointer; font-weight: 600; margin-top: 12px; }
@media (max-width: 760px) { .field-row { grid-template-columns: minmax(0, 1fr) 44px; } .field-row select, .field-row .check { grid-column: 1 / 2; } }

/* ---- CSVC / TKB / Đoàn – Đội ---- */
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; } .photos img { width: 140px; height: 105px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.tkb th, .tkb td { text-align: center; vertical-align: top; min-width: 110px; } .tkb tbody th { white-space: nowrap; font-size: .85rem; }
.tkb thead th.today { background: var(--blue-xl); color: var(--blue-d); } .tkb tr.sep td, .tkb tr.sep th { border-top: 3px solid var(--line); }
.tkb-c { background: var(--blue-xl); border-radius: 6px; padding: 4px 6px; margin: 2px 0; font-size: .85rem; text-align: left; }
.tkb-c.chg.substitute { background: var(--violet-l); } .tkb-c.chg.cancel { background: var(--gray-l); text-decoration: line-through; }
.tkb-p { display: inline-flex; width: 34px; height: 28px; align-items: center; justify-content: center; border-radius: 6px; background: var(--blue-xl); color: var(--blue-d); font-weight: 700; font-size: .85rem; flex: none; }
.crit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); } .crit-row .full { flex-basis: 100%; }
.stepper { display: inline-flex; align-items: center; border: 1px solid #cbd5e1; border-radius: 10px; overflow: hidden; }
.stepper button { width: 40px; height: 38px; border: none; background: #f8fafc; font-size: 1.2rem; cursor: pointer; } .stepper span { min-width: 34px; text-align: center; font-weight: 700; }
.tone-green:not(.badge):not(.stat):not(.dot) { color: var(--green); } .tone-red:not(.badge):not(.stat):not(.dot):not(.sbar-seg) { color: var(--red); }

/* ---- Trang chủ v1.8 ---- */
.home-h { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; } .home-h > div { flex: 1; min-width: 0; }
.home-h h1 { margin: 0; font-size: 1.35rem; } .home-h p { margin: 2px 0 0; }
.sec-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; } .sec-h h2 { margin: 0; font-size: 1.1rem; }
.icon-btn.flip .ic { transform: scaleX(-1); }
.all-clear { display: flex; align-items: center; gap: 8px; background: var(--green-l); color: var(--green); border-radius: var(--r); padding: 12px 14px; font-weight: 600; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.qtile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); min-height: 64px; }
.qtile:hover { border-color: #93c5fd; }
.qtile-ic { grid-row: 1 / 3; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.qtile-n { font-size: 1.35rem; font-weight: 800; line-height: 1.1; } .qtile-l { font-size: .8rem; color: var(--muted); line-height: 1.2; }
.qtile.tone-red .qtile-ic { background: var(--red-l); color: var(--red); } .qtile.tone-red .qtile-n { color: var(--red); }
.qtile.tone-amber .qtile-ic { background: var(--amber-l); color: #b45309; } .qtile.tone-blue .qtile-ic { background: var(--blue-xl); color: var(--blue); }
.qtile.tone-violet .qtile-ic { background: var(--violet-l); color: var(--violet); }
.week-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.wtile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; box-shadow: var(--shadow); min-height: 108px; font: inherit; color: var(--ink); }
.wtile:hover { border-color: var(--blue); } .wtile.empty { opacity: .65; box-shadow: none; }
.wtile-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--blue-xl); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.wtile-name { font-weight: 700; line-height: 1.25; } .wtile-n { font-size: .82rem; color: var(--muted); }
.wtile:not(.empty) .wtile-n { color: var(--blue-d); font-weight: 600; }
.wtile-mine, .wtile-late { position: absolute; top: 10px; width: 10px; height: 10px; border-radius: 50%; } .wtile-mine { right: 10px; background: var(--blue); } .wtile-late { right: 24px; background: #ef4444; }
.wtile.skel { min-height: 108px; background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9); background-size: 200% 100%; animation: skel 1.2s infinite; cursor: default; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.wday-block { margin-bottom: 12px; } .wday-t { font-weight: 700; color: var(--blue-d); padding: 6px 0; border-bottom: 2px solid var(--blue-xl); margin-bottom: 4px; }
.leader-fold { margin-top: 18px; } .fold-h { display: flex; align-items: center; gap: 10px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; flex-wrap: wrap; }
.fold-h .chev { transition: transform .2s; } .fold-h .chev.up { transform: rotate(180deg); } .leader-fold > .stats, .leader-fold > .grid2 { margin-top: 12px; }
@media (max-width: 760px) { .quick-grid, .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wtile { min-height: 96px; } .home-h h1 { font-size: 1.15rem; } }
.sec-h h2 { white-space: nowrap; } .week-sec .sec-h .muted { white-space: nowrap; }
@media (max-width: 760px) { .week-sec .sec-h { flex-wrap: wrap; } .wtile { min-height: 88px; padding: 10px; } .wtile-ic { width: 34px; height: 34px; } }
.approval-card { border: 2px solid #f59e0b; background: #fffbeb; }

/* ---- Lịch công tác tuần v1.10 ---- */
.wp-banner { display: block; cursor: pointer; background: linear-gradient(135deg, #b91c1c, #dc2626 55%, #ea580c); color: #fff; border-radius: 16px; padding: 14px 16px; margin: 0 0 14px; box-shadow: 0 6px 18px rgba(185, 28, 28, .28); }
.wp-banner:hover, .wp-banner:focus-visible { box-shadow: 0 8px 24px rgba(185, 28, 28, .4); outline: none; }
.wp-banner.empty { background: linear-gradient(135deg, #64748b, #94a3b8); box-shadow: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wp-b-head { display: flex; align-items: center; gap: 12px; } .wp-b-head .ic { flex: none; }
.wp-b-title { font-size: 1.25rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.wp-b-sub { font-size: .9rem; opacity: .95; margin-top: 2px; }
.wp-b-btn { flex: none; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .5); border-radius: 99px; padding: 6px 12px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.wp-draft { font-size: .7rem; background: #fde047; color: #713f12; border-radius: 6px; padding: 2px 6px; vertical-align: middle; }
.wp-b-today { display: flex; gap: 12px; margin-top: 12px; background: rgba(255, 255, 255, .96); color: var(--ink); border-radius: 12px; padding: 10px 12px; }
.wp-b-today.muted-row { display: block; color: var(--muted); font-size: .9rem; }
.wp-b-day { flex: none; width: 70px; text-align: center; color: #b91c1c; font-size: .8rem; border-right: 2px solid #fecaca; padding-right: 10px; } .wp-b-day b { font-size: 1rem; }
.wp-b-cols { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wp-b-lbl { font-size: .72rem; font-weight: 800; color: #b91c1c; text-transform: uppercase; margin-bottom: 2px; }
.wp-line { font-size: .9rem; line-height: 1.35; } .wp-line.hl { color: #dc2626; font-weight: 600; }
.wp-doc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px 20px; font-family: 'Times New Roman', Times, serif; color: #111; margin-bottom: 14px; }
.wp-title { text-align: center; font-size: 1.45rem; font-weight: 700; margin: 0; text-transform: uppercase; }
.wp-duty { text-align: center; font-weight: 700; font-size: 1.15rem; margin-top: 4px; } .wp-range { text-align: center; font-style: italic; margin: 2px 0 12px; }
.wp-table { width: 100%; border-collapse: collapse; font-size: 1.05rem; } .wp-table th, .wp-table td { border: 1px solid #111; padding: 6px 8px; vertical-align: middle; }
.wp-table th { font-weight: 700; text-align: center; } .wp-table td .wp-line { font-size: 1.05rem; }
.wp-table .wp-c-day { width: 64px; text-align: center; } .wp-table tr.today td { background: #fef9c3; }
.wp-notes { margin-top: 12px; font-size: 1.02rem; } .wp-notes .pre { margin-top: 4px; }
.wp-edit-row { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line); } .wp-edit-row .wp-c-day { text-align: center; padding-top: 8px; }
@media (max-width: 760px) {
  .wp-b-cols { grid-template-columns: 1fr; gap: 6px; } .wp-b-title { font-size: 1.05rem; } .wp-b-head { flex-wrap: wrap; }
  .wp-doc { padding: 14px 8px; } .wp-table { font-size: .95rem; } .wp-table td .wp-line { font-size: .95rem; } .wp-table .wp-c-day { width: 48px; }
  .wp-edit-row { grid-template-columns: 1fr 1fr; } .wp-edit-row .wp-c-day { grid-column: 1 / -1; text-align: left; padding-top: 0; }
}
@media print {
  .side, .top, .bottom, .banner, .no-print, .toasts, .sheet-bg { display: none !important; }
  .main, .content, .app { margin: 0 !important; padding: 0 !important; display: block !important; }
  body { background: #fff !important; } .wp-doc { border: none; padding: 0; } .wp-table tr.today td { background: none; }
}

/* ---- Lịch công tác tuần v1.11: băng thu gọn / trải cả tuần ---- */
.wp-banner { cursor: default; padding: 0; overflow: hidden; }
.wp-banner.empty { display: block; }
.wp-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; color: #fff; flex-wrap: wrap; }
.wp-bar:focus-visible { outline: 3px solid #fde047; outline-offset: -3px; }
.wp-bar-title { font-size: 1.2rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: #fff; }
.wp-bar-title small { font-weight: 600; text-transform: none; opacity: .9; font-size: .85rem; }
.wp-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .55); border-radius: 99px; padding: 6px 12px; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.wp-btn:hover { background: rgba(255, 255, 255, .28); } .wp-btn.solid { background: #fff; color: #b91c1c; border-color: #fff; }
.wp-expand { padding: 0 14px 14px; }
.wp-duty2 { color: #fff; font-size: .95rem; line-height: 1.5; margin: 0 2px 10px; } .wp-duty2 b { font-weight: 800; }
.wp-duty2.dark { color: #111; text-align: center; font-size: 1.1rem; margin: 6px 0 0; } .wp-duty2.dark b { font-weight: 700; }
.wp-sheet { background: #fff; color: #111; border-radius: 12px; padding: 8px; margin-bottom: 10px; font-family: 'Times New Roman', Times, serif; overflow-x: auto; }
.wp-sheet .wp-table { font-size: 1rem; } .wp-sheet .wp-table td .wp-line { font-size: 1rem; }
.wp-sheet.wp-notes { padding: 10px 12px; margin-top: 0; }
.wp-foot { display: flex; align-items: center; gap: 8px; }
.wp-added { font-family: system-ui, sans-serif; font-size: .68rem; font-weight: 700; color: #7c2d12; background: #fed7aa; border-radius: 6px; padding: 1px 5px; vertical-align: middle; white-space: nowrap; }
.wp-edit-head { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.wp-duty-pick { margin-top: 6px; width: 100%; font-size: .9em; color: var(--primary, #1d4ed8); background-color: #f5f8ff; border-style: dashed; cursor: pointer; }
@media (max-width: 760px) {
  .wp-bar { padding: 12px; gap: 8px; } .wp-bar-title { font-size: 1.02rem; flex: 1 1 100%; }
  .wp-bar .grow { display: none; } .wp-btn { padding: 6px 10px; font-size: .8rem; }
  .wp-expand { padding: 0 8px 10px; } .wp-sheet { padding: 4px; } .wp-sheet .wp-table, .wp-sheet .wp-table td .wp-line { font-size: .92rem; }
  .wp-edit-head { grid-template-columns: 1fr; }
}
@media print { .wp-banner { display: none !important; } }
@media (max-width: 760px) { .wp-bar-title { flex: 1 1 calc(100% - 40px); } }
.wk-nav { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; margin-left: auto; }
.wp-weeknav { display: inline-flex; align-items: center; gap: 6px; } .wp-arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.16); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; } .wp-arrow:hover { background: rgba(255,255,255,.3); }

/* ===== Thời khóa biểu – dạng bản in của trường ===== */
.tkb-head { text-align: center; margin: 4px 0 10px; }
.tkb-h1 { font-weight: 800; font-size: 1.25rem; letter-spacing: .5px; color: var(--blue-d); }
.tkb-h2 { font-weight: 700; } .tkb-h3 { font-style: italic; color: var(--muted); font-size: .9rem; }
.tkb-wrap { max-height: 75vh; overflow: auto; }
.tkb-t { border-collapse: collapse; font-size: .82rem; background: var(--card, #fff); }
.tkb-t th, .tkb-t td { border: 1px solid var(--line); padding: 3px 5px; text-align: center; vertical-align: middle; white-space: nowrap; }
.tkb-t thead th { position: sticky; top: 0; z-index: 2; background: var(--blue-xl); color: var(--blue-d); }
.tkb-t tr.tkb-first td { border-top: 2px solid var(--blue-d); }
.tkb-day { font-weight: 700; background: var(--bg, #f6f8fb); min-width: 64px; }
.tkb-pn { font-weight: 700; width: 34px; }
.tkb-free { white-space: normal !important; min-width: 160px; max-width: 260px; font-size: .78rem; color: var(--muted); text-align: left !important; }
.tkb-gv td { min-width: 70px; }
.tkb-gv .stk, .tkb-gv .stk2 { position: sticky; z-index: 1; background: var(--bg, #f6f8fb); }
.tkb-gv .stk { left: 0; } .tkb-gv .stk2 { left: 64px; }
.tkb-gv thead .stk, .tkb-gv thead .stk2 { z-index: 3; background: var(--blue-xl); }
.tkb-me { background: #fff7d6; font-weight: 600; }
.tkb-one td { min-width: 110px; height: 34px; font-weight: 600; }
.tkb-chg.substitute { color: var(--violet, #6d28d9); } .tkb-chg.cancel { text-decoration: line-through; color: var(--muted); }
.tkb-chg small { display: block; font-weight: 400; }
@media print {
  .tkb-wrap { max-height: none; overflow: visible; }
  .tkb-t { font-size: 9pt; } .tkb-t thead th { position: static; }
  .tkb-gv .stk, .tkb-gv .stk2 { position: static; }
  .tkb-page .chips { display: none !important; }
}
/* ---- v1.14 Trang chủ: Cần làm ngay + Bảng tin ---- */
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 8px; }
.now-card { padding: 12px 16px; margin-bottom: 16px; }
.now-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.now-h b { display: inline-flex; align-items: center; gap: 6px; font-size: 1.05rem; }
.now-row { padding: 10px 0; border-top: 1px solid var(--line, #e5e7eb); }
.now-top { display: flex; align-items: center; gap: 10px; }
.now-row:nth-child(2) { border-top: 0; }
.now-row .t { font-weight: 600; } .now-row .meta { font-size: .85rem; color: var(--ink3, #64748b); }
.now-row.done .t { color: var(--ink3, #64748b); }
.now-body { margin-top: 6px; background: var(--gray-l); border-radius: 8px; padding: 8px 10px; font-size: .92rem; }
.ndot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ndot.red { background: #ef4444; } .ndot.amber { background: #d97706; } .ndot.yellow { background: #f59e0b; } .ndot.green { background: #16a34a; }
.feed { margin-bottom: 18px; }
.feed-h { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.feed-h b { display: inline-flex; align-items: center; gap: 6px; font-size: 1.05rem; }
.fitem { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-start; }
.fbub { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line, #e5e7eb); border-radius: 14px; padding: 10px 12px; }
.fitem.todo .fbub { border-color: #fcd34d; }
.fbub .meta { font-size: .82rem; color: var(--ink3, #64748b); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.ftext { line-height: 1.55; } .ftext .pre { margin-top: 2px; }
.fact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.fprog { display: inline-flex; align-items: center; gap: 8px; } .fprog .pbar { width: 110px; margin-top: 0; }
.zalo-box { white-space: pre-wrap; background: var(--gray-l); border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: .92rem; }
.center { text-align: center; }

/* v1.14.1 khung đọc: kéo đến cuối mới tính Đã đọc; Thu gọn */
.reader { margin-top: 8px; background: #f8fafc; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 10px 12px; line-height: 1.6; }
.now-row .reader { margin-left: 20px; }
.reader b { display: block; margin-bottom: 4px; }
.reader-end { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line, #e5e7eb); }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* ---------- v1.15 Tán gẫu ---------- */
.chip .cdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-left: 6px; vertical-align: middle; }
.linkbtn { border: none; background: none; padding: 0; color: var(--blue); font: inherit; cursor: pointer; text-decoration: underline; }
.chat { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.chat-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.chat-box { height: 62vh; min-height: 320px; overflow-y: auto; padding: 10px 10px 6px; background: #eef2f7; overscroll-behavior: contain; }
.chat.full .chat-box { height: calc(100dvh - var(--top) - var(--bottom) - 150px); }
@media (min-width: 900px) { .chat.full .chat-box { height: calc(100dvh - var(--top) - 170px); } }
.chat-page .page-h { align-items: center; justify-content: flex-start; margin-bottom: 10px; }
.chat-page .page-h h2 { margin: 0; }
.chat-empty { padding: 40px 0; }
.chat-day { text-align: center; margin: 10px 0; }
.chat-day span { background: rgba(15, 23, 42, .12); color: var(--ink2); font-size: 12px; padding: 3px 10px; border-radius: 99px; }
.cmsg { display: flex; gap: 6px; align-items: flex-end; margin-top: 2px; }
.cmsg.first { margin-top: 10px; }
.cmsg.me { justify-content: flex-end; }
.cav { width: 30px; flex: none; }
.cbody { max-width: 78%; display: flex; flex-direction: column; align-items: flex-start; }
.cmsg.me .cbody { align-items: flex-end; }
.cname { font-size: 12px; color: var(--muted); margin: 0 0 2px 4px; }
.cbub { background: #fff; border-radius: 14px; padding: 7px 11px; box-shadow: 0 1px 1px rgba(0,0,0,.06); cursor: pointer; word-break: break-word; }
.cmsg.me .cbub { background: #dbeafe; }
.cbub.sel { outline: 2px solid var(--blue); }
.cbub.gone { background: transparent; border: 1px dashed #cbd5e1; color: var(--muted); box-shadow: none; cursor: default; }
.cbub.pic, .cmsg.me .cbub.pic { padding: 0; background: transparent; box-shadow: none; }
.ctext { white-space: pre-wrap; line-height: 1.4; }
.ctext a { color: var(--blue); }
.ctime { font-size: 11px; color: var(--muted); margin-top: 2px; text-align: right; }
.cbub.pic .ctime { padding: 0 6px; }
.cquote { border-left: 3px solid var(--blue); padding: 2px 8px; margin-bottom: 4px; font-size: 13px; color: var(--ink2); background: rgba(37, 99, 235, .06); border-radius: 4px; }
.cimg { display: block; border: none; padding: 0; border-radius: 12px; overflow: hidden; background: #cbd5e1; cursor: zoom-in; max-width: 100%; }
.cimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cimg .spin { margin: auto; }
.cfile { display: flex; align-items: center; gap: 8px; border: none; background: rgba(255,255,255,.6); border-radius: 10px; padding: 6px 8px; cursor: pointer; text-align: left; color: var(--ink); max-width: 260px; }
.cfile span { display: flex; flex-direction: column; min-width: 0; }
.cfile b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfile small { color: var(--muted); }
.cacts { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.cacts button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.cfail { margin-top: 2px; }
.chat-new { position: absolute; right: 14px; bottom: 74px; border: none; background: var(--blue); color: #fff; border-radius: 99px; padding: 6px 12px; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
.chat-reply { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 13px; background: var(--blue-xl); }
.chat-reply .icon-btn { width: 32px; height: 32px; }
.chat-in { display: flex; align-items: flex-end; gap: 2px; padding: 6px; border-top: 1px solid var(--line); background: #fff; }
.chat-in textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 20px; padding: 10px 14px; font: inherit; font-size: 16px; line-height: 1.35; max-height: 120px; min-height: 44px; }
.chat-in label.icon-btn { cursor: pointer; }
.chat-in .send { color: var(--blue); }
.chat-in .send:disabled { color: #cbd5e1; cursor: default; }
.chat-viewer { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.chat-viewer img { max-width: 100%; max-height: calc(100% - 64px); object-fit: contain; }
.cv-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 10px; color: #fff; background: rgba(0,0,0,.5); }
.cv-bar .btn { color: #fff; }

/* ---------- v1.15.2 Ai đã đọc ---------- */
.readers { margin-top: 8px; padding: 10px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--line); }
.readers .chips { align-items: center; margin-bottom: 8px; }
.rnames { display: flex; flex-wrap: wrap; gap: 6px; max-height: 260px; overflow-y: auto; }
.rname { background: var(--amber-l); color: var(--ink); border-radius: 99px; padding: 4px 10px; font-size: 13px; }
.rname.ok { background: var(--green-l); }
.rname small { color: var(--muted); }
/* v1.15.3: số đã đọc + nút xem tên gộp thành 1 nút (vừa 1 hàng trên điện thoại); vòng nhỏ thể hiện tỉ lệ */
.whobtn { gap: 6px; }
.whobtn.on { background: var(--blue-xl); }
.wring { width: 16px; height: 16px; border-radius: 50%; flex: none; background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--gray-l) 0); }
/* v1.15.4: tin trên Bảng tin gọn 2 dòng */
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ftext.clamp2 b { font-weight: 700; }

/* ---------- v1.16 Ảnh / PDF đính kèm ---------- */
.att { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.att-grid { display: grid; gap: 4px; max-width: 360px; }
.att-grid.n1 { grid-template-columns: 1fr; }
.att-grid.n2, .att-grid.n4 { grid-template-columns: 1fr 1fr; }
.att-grid.n3 { grid-template-columns: 1fr 1fr 1fr; }
.att-img { position: relative; border: none; padding: 0; border-radius: 10px; overflow: hidden; background: #e2e8f0; aspect-ratio: 4 / 3; cursor: zoom-in; display: grid; place-items: center; }
.att-grid.n1 .att-img { aspect-ratio: auto; max-height: 240px; }
.att-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-grid.n1 .att-img img { object-fit: contain; max-height: 240px; background: #f1f5f9; }
.att-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 23, 42, .55); color: #fff; font-size: 22px; font-weight: 700; }
.att-docs { display: flex; flex-direction: column; gap: 4px; }
.att-doc { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 10px; cursor: pointer; text-align: left; color: var(--ink); font: inherit; max-width: 360px; }
.att-doc small { color: var(--muted); white-space: nowrap; }
.att-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.att-ic { flex: none; font-size: 10px; font-weight: 800; color: #fff; background: var(--gray); border-radius: 6px; padding: 4px 5px; letter-spacing: .3px; }
.att-ic.pdf { background: #dc2626; } .att-ic.doc { background: #2563eb; } .att-ic.xls { background: #16a34a; } .att-ic.ppt { background: #ea580c; }
.qp-files { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.qp-files label.btn { cursor: pointer; }
.qp-list { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.qp-file { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 4px 4px 6px; background: #fff; }
.qp-file img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.qp-file .icon-btn { width: 32px; height: 32px; }