/* CKFF Team Hub — giao diện tối giản theo trang Free Fire VN:
   thanh trên đen, dải tiêu đề tím đậm, nền sáng, một màu nhấn vàng #FFBA00, phẳng, không đổ màu (gradient), không chữ nghiêng.
   Chữ: GFF (Garena). Bản Medium và Thin không có đủ tiếng Việt nên không dùng. */
@font-face { font-family: "GFF"; font-weight: 300; font-style: normal; font-display: swap; src: url("/fonts/GFF-Light.ttf") format("truetype"); }
@font-face { font-family: "GFF"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/GFF-Regular.ttf") format("truetype"); }
@font-face { font-family: "GFF"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/GFF-Bold.ttf") format("truetype"); }
@font-face { font-family: "GFF"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/GFF-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "GFF"; font-weight: 900; font-style: normal; font-display: swap; src: url("/fonts/GFF-Black.ttf") format("truetype"); }

:root {
  --yellow: #FFBA00; --yellow-hover: #FFC933; --black: #000; --hero: #1F1343; --bar: #3D3D3E;
  --bg: #F5F5F7; --surface: #FFFFFF; --soft: #EDEDF1;
  --line: #E0E0E6; --line-2: #C9C9D1;
  --ink: #111113; --ink-2: #3C3C42; --muted: #6B6B75;
  --red: #C62828; --font: "GFF", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.55 var(--font); color: var(--ink); background: var(--bg); }
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: #1B4FA8; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.topnav :focus-visible, .hero :focus-visible, .tfilter :focus-visible, .auth-hero :focus-visible { outline-color: var(--yellow); }
::selection { background: var(--yellow); color: var(--black); }
.icon { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1280px, calc(100% - 64px)); margin: 0 auto; }

/* ---------- Thanh trên ---------- */
.topnav { background: var(--black); position: sticky; top: 0; z-index: 20; }
.topnav-in { display: flex; align-items: center; gap: 36px; height: 72px; width: min(1280px, calc(100% - 64px)); margin: 0 auto; }
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo img { display: block; height: 34px; width: auto; }
.nav { display: flex; gap: 6px; flex: 1; min-width: 0; }
.nav a { position: relative; display: flex; align-items: center; gap: 8px; height: 72px; padding: 0 16px; color: #C3C3CC; text-decoration: none; font-weight: 700; font-size: 14.5px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 4px; background: var(--yellow); }
.nav .count { min-width: 20px; padding: 0 6px; text-align: center; border-radius: 2px; background: var(--yellow); color: var(--black); font-size: 12px; font-weight: 800; line-height: 20px; }
.tools { display: flex; align-items: center; gap: 12px; }
.iconbtn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #1C1C1F; display: inline-grid; place-items: center; cursor: pointer; color: #fff; }
.iconbtn:hover { background: #2C2C30; }
.iconbtn.plain { border-radius: 4px; background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.iconbtn.plain:hover { background: var(--soft); }
.iconbtn .dot { position: absolute; top: -5px; right: -5px; min-width: 20px; padding: 0 5px; border-radius: 2px; background: var(--yellow); color: var(--black); font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.userbtn { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 5px; border-radius: 20px; border: 0; background: #1C1C1F; cursor: pointer; font-weight: 700; color: #fff; }
.userbtn:hover { background: #2C2C30; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: var(--black); display: inline-grid; place-items: center; font-weight: 900; font-size: 13px; flex: none; }
.pop { position: absolute; z-index: 30; right: 0; top: 50px; min-width: 250px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 4px; box-shadow: 0 12px 32px rgba(0,0,0,.2); padding: 6px; }
.pop button.item, .pop a.item { display: flex; width: 100%; gap: 10px; align-items: center; background: none; border: 0; text-align: left; padding: 9px 10px; border-radius: 3px; cursor: pointer; color: inherit; text-decoration: none; font: inherit; box-sizing: border-box; }
.pop button.item:hover, .pop a.item:hover { background: var(--soft); }
.pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop .who small { color: var(--muted); display: block; }
.anchor { position: relative; }
.bell-list { width: min(390px, 92vw); max-height: 470px; overflow: auto; padding: 0; right: 0; }
.bell-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 800; }
.nitem { display: block; width: 100%; background: none; border: 0; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.nitem:hover { background: var(--soft); }
.nitem.unread { background: #FFF6D6; box-shadow: inset 4px 0 0 var(--yellow); }
.nitem small { color: var(--muted); display: block; margin-top: 2px; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }

/* ---------- Dải tiêu đề ---------- */
.hero { background: var(--hero); color: #fff; padding: 30px 0 36px; }
.edge { position: relative; height: 4px; background: var(--yellow); }
.edge::before { content: ""; position: absolute; left: 0; top: -4px; width: min(420px, 40%); height: 8px; background: var(--yellow); }
.page-h { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-title { margin-right: auto; min-width: 0; }
.page-title h1 { font: 900 32px/1.2 var(--font); text-transform: uppercase; letter-spacing: .01em; }
.page-title .bar { display: block; width: 190px; height: 6px; margin-top: 12px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='190' height='6'%3E%3Crect width='130' height='6' fill='%23FFBA00'/%3E%3Cpath d='M140 6L147 0H151L144 6ZM154 6L161 0H165L158 6ZM168 6L175 0H179L172 6Z' fill='%23FFBA00'/%3E%3C/svg%3E") no-repeat; }
.page-h .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: #C9C3E6; text-decoration: none; font-weight: 700; margin-bottom: 12px; }
.back:hover { color: var(--yellow); }
.content { padding-top: 28px; padding-bottom: 64px; }

/* ---------- Nút & ô nhập ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 2px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; cursor: pointer; white-space: nowrap; color: var(--ink); }
.btn:hover { background: var(--soft); border-color: #A5A5B0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--black); text-transform: uppercase; letter-spacing: .03em; font-weight: 800; }
.btn.primary:hover { background: var(--yellow-hover); border-color: var(--yellow-hover); }
.btn.danger { background: var(--surface); border-color: #E0A7A3; color: var(--red); }
.btn.danger:hover { background: #FDECEA; }
.btn.solid-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.solid-danger:hover { background: #A71E1E; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--soft); }
.hero .btn:not(.primary) { background: transparent; border-color: #6D5FA3; color: #fff; }
.hero .btn:not(.primary):hover { background: rgba(255,255,255,.1); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .lbl { font-weight: 700; font-size: 14px; color: var(--ink-2); }
.hint { font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--surface); color: var(--ink); }
.input::placeholder { color: #9A9AA5; }
.input:focus { border-color: var(--ink); }
textarea.input { height: auto; min-height: 84px; padding: 9px 12px; resize: vertical; }
.input:disabled { background: var(--soft); color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { color: var(--red); font-weight: 700; padding: 0 22px; min-height: 0; }
.form-error:not(:empty) { padding-bottom: 10px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 2px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge.st-pending { background: #FFF1CF; color: #7A4B00; }
.badge.st-in_progress { background: #E3EEFF; color: #1B4FA8; }
.badge.st-done { background: #DDF5E7; color: #17673A; }
.badge.st-rejected { background: #FFE3E1; color: #9A1C14; }
.badge.st-cancelled { background: #E8E8EE; color: #4B4B55; }
.badge.late { background: var(--red); color: #fff; }
.badge.ok { background: #DDF5E7; color: #17673A; }
.badge.ty-Banner { background: #E4EEFF; color: #1B4FA8; }
.badge.ty-Key-Visual { background: #FFE9CC; color: #8A4300; }
.badge.ty-Video { background: #EDE6FF; color: #5130B0; }
.badge.ty-Overlay { background: #D9F4F1; color: #0B6B63; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13.5px; }
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill.free { color: #1F7A46; } .pill.busy { color: #A55F00; } .pill.leave { color: #5E5E6A; }

/* ---------- Thẻ & lưới ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; }
.pad { padding: 18px 20px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters .input { width: auto; min-width: 150px; }
.filters .check { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--ink-2); }
.filters .lbl { color: var(--muted); }
.filters input[type=date] { min-width: 140px; }

/* Thanh chọn chế độ giải, giống thanh tab của trang Free Fire */
.tfilter { display: flex; align-items: stretch; flex-wrap: wrap; margin-bottom: 26px; background: var(--bar); padding: 0 24px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%); }
.mode-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mode-tab { position: relative; height: 62px; padding: 0 22px; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  font: 700 17px/1 var(--font); text-transform: uppercase; letter-spacing: .04em; color: #B7B7BE; }
.mode-tab:hover { color: #fff; }
.mode-tab[aria-pressed="true"] { color: var(--yellow); }
.mode-tab[aria-pressed="true"]::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 4px; background: var(--yellow); }
.mode-tab .n { min-width: 24px; height: 24px; padding: 0 7px; display: inline-grid; place-items: center; font: 700 13px/1 var(--font); background: rgba(255,255,255,.14); color: #fff; border-radius: 2px; }
.mode-tab[aria-pressed="true"] .n { background: var(--yellow); color: var(--black); }
.tfilter .stage-select { margin-left: auto; display: flex; align-items: center; gap: 10px; color: #B7B7BE; font-weight: 700; white-space: nowrap; padding-bottom: 6px; }
.tfilter .stage-select select { min-width: 190px; height: 38px; background: #2B2B2C; border: 1px solid #5A5A5E; color: #fff; }

.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.t-card { display: block; color: inherit; text-decoration: none; background: var(--surface); overflow: hidden; position: relative; border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.t-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.kv { aspect-ratio: 16 / 9; background: var(--soft); position: relative; overflow: hidden; }
.kv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kv.none { display: grid; place-items: center; color: #8A8A96; font-weight: 700; }
.detail .kv { border: 1px solid var(--line); }
.tag-stage, .tag-mode { display: inline-block; padding: 6px 14px; font: 800 14px/1.1 var(--font); text-transform: uppercase; letter-spacing: .04em; }
.tag-stage { background: var(--black); color: var(--yellow); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%); padding-right: 18px; }
.tag-stage small { font: 700 12px/1 var(--font); color: #fff; opacity: .8; margin-left: 8px; }
.tag-stage.s-ended { background: #8A8A94; color: #fff; }
.tag-mode { border: 1.5px solid var(--ink); color: var(--ink); padding: 4.5px 12px; }
.t-body { padding: 16px 18px 20px; }
.t-body h3 { font: 900 19px/1.3 var(--font); text-transform: uppercase; margin: 12px 0 10px; }
.pics { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 14px; }
.pics dt { color: var(--muted); } .pics dd { margin: 0; font-weight: 700; }
.mini-counts { display: flex; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.mini-counts b { color: var(--ink); }
.tag-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 14px; }

/* Thanh giai đoạn: phẳng, vàng ở chặng hiện tại */
.track { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.track i { height: 9px; background: #D8D8DF; display: block; }
.track i.done { background: #2A2A2E; }
.track i.now { background: var(--yellow); }
.track.ended i { background: #A0A0AA; }
.stage-line { margin-top: 8px; font-size: 13px; color: var(--muted); font-weight: 700; }
.track-lg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.track-lg > div > i { height: 14px; background: #D8D8DF; display: block; }
.track-lg > div.done > i { background: #2A2A2E; }
.track-lg > div.now > i { background: var(--yellow); }
.track-lg.ended > div > i { background: #A0A0AA; }
.track-lg small { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.track-lg > div.now small { color: var(--ink); font-weight: 800; }
.track-lg > div.done small { color: var(--ink-2); }

.detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.hero-tags { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.hero-tags .tag-stage, .hero-tags .tag-mode { font-size: 15px; }
.hero-tags .tag-mode { padding: 6.5px 14px; }
.kv-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 4px; }
.tile { border: 1px solid var(--line); background: var(--bg); padding: 10px 12px; }
.tile b { display: block; font: 900 24px/1.1 var(--font); }
.tile span { font-size: 13px; color: var(--muted); }
.h2 { font: 800 17px/1.3 var(--font); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 12px; }
.rows { display: flex; flex-direction: column; }
.trow { display: flex; gap: 12px; align-items: center; padding: 11px 6px; border: 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; cursor: pointer; background: none; width: 100%; text-align: left; }
.trow:hover { background: var(--bg); }
.trow .grow { flex: 1; min-width: 0; }
.trow .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { font-size: 13.5px; color: var(--muted); }
details.history summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
details.history ol { list-style: none; padding: 0; margin: 10px 0 0; }
details.history li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }

/* ---------- Bảng task ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--soft); padding: 10px; min-width: 250px; }
.col-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font: 800 14.5px/1.2 var(--font); text-transform: uppercase; letter-spacing: .03em; }
.col-h .n { background: var(--surface); border: 1px solid var(--line); min-width: 26px; text-align: center; font: 700 13px/22px var(--font); }
.cards { display: flex; flex-direction: column; gap: 10px; }
.tcard { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-2); padding: 11px 12px; cursor: pointer; }
.tcard:hover { border-color: var(--ink); border-left-width: 4px; }
.tcard.st-pending { border-left-color: #E3A100; } .tcard.st-in_progress { border-left-color: #2563EB; }
.tcard.st-done { border-left-color: #2E9B5E; } .tcard.st-rejected { border-left-color: #D4443A; } .tcard.st-cancelled { border-left-color: #9A9AA5; }
.tcard .top { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 7px; }
.tcard h4 { font-size: 15px; font-weight: 700; line-height: 1.35; margin-bottom: 4px; }
.tcard .meta { font-size: 13.5px; color: var(--muted); }
.tcard .due { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.tcard .due.late { color: var(--red); } .tcard .due.soon { color: #8A5300; }
.more { width: 100%; margin-top: 10px; }

/* ---------- Ngăn chi tiết task ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
.drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(580px, 100%); background: var(--surface); box-shadow: -14px 0 40px rgba(0,0,0,.3); display: flex; flex-direction: column; animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(28px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-h { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); border-top: 5px solid var(--yellow); }
.drawer-h h2 { font: 900 20px/1.3 var(--font); text-transform: uppercase; flex: 1; }
.drawer-scroll { flex: 1; overflow: auto; padding: 16px 20px; }
.kvlist { display: grid; grid-template-columns: 128px 1fr; gap: 9px 14px; margin: 0 0 14px; font-size: 14.5px; }
.kvlist dt { color: var(--muted); } .kvlist dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 8px 12px; border-radius: 2px 12px 12px 12px; background: var(--soft); overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: #FFF1C2; border-radius: 12px 2px 12px 12px; }
.msg .who { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-bottom: 1px; }
.msg .body { white-space: pre-wrap; }
.ev { align-self: center; text-align: center; font-size: 13px; color: var(--muted); max-width: 92%; }
.composer { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 10px; align-items: flex-end; background: var(--bg); }
.composer textarea { min-height: 44px; max-height: 140px; height: 44px; }

/* ---------- Hộp thoại ---------- */
dialog.modal { border: 0; border-top: 5px solid var(--yellow); padding: 0; border-radius: 2px; background: var(--surface); width: min(520px, calc(100% - 24px)); box-shadow: 0 24px 70px rgba(0,0,0,.4); color: var(--ink); }
dialog.modal.wide { width: min(640px, calc(100% - 24px)); }
dialog.modal::backdrop { background: rgba(0,0,0,.55); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.modal-h h2 { font: 900 19px/1.3 var(--font); text-transform: uppercase; }
.modal-b { padding: 8px 22px 6px; max-height: calc(100vh - 220px); overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
.warns { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.warn { background: #FFF6D6; border-left: 4px solid var(--yellow); color: #5C3B00; padding: 10px 12px; font-size: 14px; font-weight: 700; }
.warn .btn { margin-top: 8px; }
.secret { font: 700 22px/1 ui-monospace, Consolas, Menlo, monospace; letter-spacing: .06em; padding: 14px; background: var(--black); color: var(--yellow); text-align: center; user-select: all; }

/* ---------- Team / nghỉ phép / bảng ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-bottom: 26px; }
.person { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.person .head { display: flex; gap: 12px; align-items: center; }
.person .head b { display: block; font-size: 16px; }
.person p { font-size: 14px; color: var(--ink-2); }
.person .btn { align-self: flex-start; }
.sect { font: 800 17px/1.3 var(--font); text-transform: uppercase; letter-spacing: .02em; margin: 6px 0 12px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }
.leave-card { padding: 16px 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.leave-card .grow { flex: 1; min-width: 220px; }

/* ---------- Dashboard ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-2); overflow: hidden; background: var(--surface); }
.seg button { height: 38px; padding: 0 16px; border: 0; background: none; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--black); color: var(--yellow); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px 16px; }
.stat b { display: block; font: 900 32px/1.1 var(--font); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13.5px; color: var(--muted); }
.stat.bad b { color: var(--red); }
.legend { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; font-size: 14px; font-weight: 700; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -1px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap .band { fill: transparent; }
.chart-wrap .band:hover, .chart-wrap .band:focus { fill: rgba(0,0,0,.06); outline: none; }
.c-grid { stroke: #E3E3E9; stroke-width: 1; } .c-base { stroke: #8A8A96; stroke-width: 1; }
.c-tick { fill: var(--muted); font-size: 12px; } .c-total { fill: var(--ink); font-size: 12px; font-weight: 800; }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--black); color: #fff; padding: 9px 12px; font-size: 13.5px; min-width: 150px; transform: translate(-50%, -100%); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.tip .t { color: #B7B7BE; margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 8px; }
.tip .r b { margin-left: auto; font-size: 15px; font-variant-numeric: tabular-nums; }
.tip .k { width: 14px; height: 3px; display: inline-block; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.rate { display: inline-block; min-width: 46px; text-align: right; font-weight: 700; }

#toasts { position: fixed; left: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--black); border-left: 4px solid var(--yellow); color: #fff; padding: 11px 16px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: 380px; }

/* ---------- Đăng nhập ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-hero { background: var(--hero); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-hero .logo { align-self: flex-start; }
.auth-hero .logo img { height: 96px; }
.auth-hero p { font: 900 28px/1.35 var(--font); text-transform: uppercase; max-width: 480px; }
.hero-track { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 420px; margin-top: 22px; }
.hero-track i { height: 9px; background: #4A3D7A; display: block; }
.hero-track i.d { background: #fff; opacity: .85; } .hero-track i.n { background: var(--yellow); }
.auth-form { display: grid; place-items: center; padding: 32px; }
.auth-form form { width: min(400px, 100%); }
.auth-form h1 { font: 900 28px/1.2 var(--font); text-transform: uppercase; margin-bottom: 6px; }
.auth-form .lead { color: var(--muted); margin-bottom: 22px; }
.auth-form .btn { width: 100%; height: 46px; }
.auth-form .form-error { padding: 0; margin-bottom: 12px; }

.loading { opacity: .55; transition: opacity .15s; }

@media (max-width: 1000px) {
  .detail { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .wrap, .topnav-in { width: calc(100% - 28px); }
  .topnav-in { gap: 14px; height: 60px; }
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav a { height: 60px; padding: 0 12px; }
  .logo img { height: 28px; }
  .userbtn span.nm { display: none; }
  .hero { padding: 22px 0 26px; }
  .page-title h1 { font-size: 24px; }
  .board { grid-template-columns: minmax(0, 1fr) !important; overflow-x: visible; }
  .col { min-width: 0; }
  .auth { grid-template-columns: 1fr; } .auth-hero { padding: 28px; } .auth-hero .logo img { height: 64px; }
  .row2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .track-lg small { display: none; } .track-lg > div.now small { display: block; grid-column: 1 / -1; }
  .tfilter { padding: 0 12px; }
  .mode-tab { padding: 0 12px; font-size: 15px; height: 54px; }
  .mode-tab[aria-pressed="true"]::after { left: 12px; right: 12px; }
  .tfilter .stage-select { margin-left: 0; padding: 0 0 10px; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer, .t-card { animation: none; transition: none; }
  .t-card:hover { transform: none; }
}
.composer[hidden] { display: none; }

/* Các vòng đấu */
.track-lg small.when { margin-top: 2px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.track-lg > div.now small.when { color: var(--ink-2); font-weight: 400; }
.round-list { display: grid; gap: 10px; }
.round-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: end; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.round-row .rr-t { display: grid; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.round-row .rr-b { display: flex; gap: 6px; justify-self: end; }
.btn.small { padding: 0 10px; min-height: 40px; min-width: 40px; }
@media (max-width: 560px) { .round-row { grid-template-columns: 1fr; } .round-row .rr-b { justify-self: start; } }

/* Lịch theo giờ */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.cal-nav { display: flex; gap: 6px; }
.cal-label { font-size: 17px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.cal-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; }
.cal { border: 1px solid var(--line); background: #fff; }
/* Gantt (giống mẫu: mỗi dòng một task, cột là ngày trong tháng) */
.gantt-scroll { overflow: auto; max-height: calc(100vh - 310px); min-height: 360px; position: relative; background: #fff; }
.g-inner { min-width: calc(190px + var(--days) * 34px); position: relative; }
.g-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 46px; }
.g-body { position: relative; }
.g-body > .g-row:nth-of-type(odd) .g-track { background: rgba(17, 17, 19, .035); }
.g-name { position: sticky; left: 0; z-index: 4; background: #fff; border: 0; border-right: 1px solid var(--line); padding: 6px 10px; text-align: left; font: inherit; color: var(--ink); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
button.g-name { cursor: pointer; }
button.g-name:hover b { text-decoration: underline; }
button.g-name:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.g-name b { font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-name small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-head { position: sticky; top: 0; z-index: 6; background: #fff; border-bottom: 1px solid var(--line); min-height: 50px; }
.g-head .g-name { font-weight: 800; z-index: 7; }
.g-days { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); }
.g-day { display: grid; place-items: center; align-content: center; gap: 1px; background: #fff; border-left: 1px solid var(--line); }
.g-day b { font-size: 14px; }
.g-day small { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.g-day.we { background: #F1F1F5; }
.g-day.today { background: var(--yellow); }
.g-day.today small { color: var(--ink); }
.g-cols { position: absolute; left: 190px; right: 0; top: 0; bottom: 0; display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); pointer-events: none; z-index: 0; }
.g-cols i { border-left: 1px solid #ECECF2; }
.g-cols i.odd { background: rgba(37, 99, 235, .035); }
.g-cols i.today { background: rgba(255, 186, 0, .18); }
.g-track { position: relative; z-index: 1; }
.g-bar { position: absolute; top: 9px; height: 28px; box-sizing: border-box; border: 0; padding: 0 6px; display: flex; align-items: center; justify-content: center; font: 800 12.5px/1 var(--font); color: #fff; border-radius: 3px; overflow: hidden; white-space: nowrap; }
button.g-bar { cursor: pointer; }
button.g-bar:hover { filter: brightness(.92); }
button.g-bar:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.g-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.g-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g-bar.pending, .sw.pending { background: var(--yellow); color: var(--ink); }
.g-bar.in_progress, .sw.in_progress { background: #2563EB; }
.g-bar.done, .sw.done { background: #4F7A1E; }
.g-bar.late, .sw.late { background: #C2410C; }
.g-bar.leave, .sw.leave { background: #9A9AA6; }
.g-bar.busy, .sw.busy { background: #C9C9D1; color: #3D3D3E; }
.g-who { position: absolute; top: 9px; height: 28px; display: flex; align-items: center; gap: 4px; padding: 0 5px; font-size: 12.5px; color: var(--muted); white-space: nowrap; pointer-events: none; }
.g-who.left { flex-direction: row; }
.tri { display: inline-block; border-style: solid; border-width: 7px 0 7px 10px; border-color: transparent transparent transparent #6B6B75; }
.g-empty { padding: 28px; text-align: center; color: var(--muted); position: relative; z-index: 1; background: #fff; }
.g-legend { margin: 0 0 10px; }
.sw { display: inline-block; width: 22px; height: 10px; margin-right: 6px; border-radius: 2px; }
.cal-bar select.input { height: 40px; }
@media (max-width: 720px) { .g-row { grid-template-columns: 120px minmax(0, 1fr); } .g-cols { left: 120px; } .g-inner { min-width: calc(120px + var(--days) * 30px); } .gantt-scroll { max-height: calc(100vh - 250px); } }

/* Chi tiết giờ: danh sách theo ngày */
.agenda { display: grid; gap: 18px; }
.ag-day { background: #fff; border: 1px solid var(--line); }
.ag-day.today { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--yellow); }
.ag-day h3 { margin: 0; padding: 12px 16px; font-size: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; background: #FAFAFC; }
.ag-day h3 small { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 13px; }
.ag-today { background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 800; padding: 2px 8px; }
.ag-empty { margin: 0; padding: 14px 16px; color: var(--muted); }
.ag-list { display: grid; }
.ag-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 170px 140px; gap: 12px; align-items: center; padding: 11px 16px 11px 12px; border: 0; border-bottom: 1px solid var(--line); border-left: 6px solid var(--c, #9A9AA6); background: #fff; text-align: left; font: inherit; color: var(--ink); width: 100%; box-sizing: border-box; }
.ag-row:last-child { border-bottom: 0; }
button.ag-row { cursor: pointer; }
button.ag-row:hover { background: #F6F6FA; }
button.ag-row:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.ag-row.pending { --c: var(--yellow); } .ag-row.in_progress { --c: #2563EB; } .ag-row.done { --c: #4F7A1E; } .ag-row.late { --c: #C2410C; } .ag-row.leave { --c: #9A9AA6; } .ag-row.busy { --c: #C9C9D1; background: #FAFAFC; color: #4A4A52; }
.ag-time b { display: block; font-size: 16px; white-space: nowrap; }
.ag-time small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ag-main { min-width: 0; }
.ag-main b { display: block; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.ag-main small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ag-who { font-weight: 700; font-size: 14px; }
.ag-badge { justify-self: start; font-size: 12.5px; font-weight: 800; padding: 4px 10px; white-space: nowrap; border: 2px solid var(--c, #9A9AA6); }
.ag-badge.pending { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.ag-badge.in_progress { background: #2563EB; border-color: #2563EB; color: #fff; }
.ag-badge.done { background: #4F7A1E; border-color: #4F7A1E; color: #fff; }
.ag-badge.late { background: #C2410C; border-color: #C2410C; color: #fff; }
.ag-badge.leave { background: #9A9AA6; border-color: #9A9AA6; color: #fff; }
.ag-badge.busy { background: #fff; border-color: #9A9AA6; color: #4A4A52; }
@media (max-width: 860px) { .ag-row { grid-template-columns: 1fr auto; } .ag-time { grid-column: 1 / -1; } .ag-who { grid-column: 1; } .ag-badge { grid-column: 2; grid-row: 2; justify-self: end; } }

.cseg { display: inline-flex; border: 1px solid var(--ink); }
.cseg-b { height: 40px; padding: 0 18px; border: 0; background: #fff; color: var(--ink); font: 700 14px/1 var(--font); cursor: pointer; }
.cseg-b + .cseg-b { border-left: 1px solid var(--ink); }
.cseg-b[aria-pressed="true"] { background: var(--ink); color: #fff; }
.cseg-b:focus-visible { outline: 3px solid var(--yellow); outline-offset: -3px; }
.cal-bar .cal-label { margin-right: auto; }

/* Chi tiết giờ: danh sách theo ngày */
.agenda { display: grid; gap: 18px; }
.ag-day { background: #fff; border: 1px solid var(--line); }
.ag-day.today { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--yellow); }
.ag-day h3 { margin: 0; padding: 12px 16px; font-size: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; background: #FAFAFC; }
.ag-day h3 small { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 13px; }
.ag-today { background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 800; padding: 2px 8px; }
.ag-empty { margin: 0; padding: 14px 16px; color: var(--muted); }
.ag-list { display: grid; }
.ag-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 170px 140px; gap: 12px; align-items: center; padding: 11px 16px 11px 12px; border: 0; border-bottom: 1px solid var(--line); border-left: 6px solid var(--c, #9A9AA6); background: #fff; text-align: left; font: inherit; color: var(--ink); width: 100%; box-sizing: border-box; }
.ag-row:last-child { border-bottom: 0; }
button.ag-row { cursor: pointer; }
button.ag-row:hover { background: #F6F6FA; }
button.ag-row:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.ag-row.pending { --c: var(--yellow); } .ag-row.in_progress { --c: #2563EB; } .ag-row.done { --c: #4F7A1E; } .ag-row.late { --c: #C2410C; } .ag-row.leave { --c: #9A9AA6; } .ag-row.busy { --c: #C9C9D1; background: #FAFAFC; color: #4A4A52; }
.ag-time b { display: block; font-size: 16px; white-space: nowrap; }
.ag-time small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.ag-main { min-width: 0; }
.ag-main b { display: block; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.ag-main small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ag-who { font-weight: 700; font-size: 14px; }
.ag-badge { justify-self: start; font-size: 12.5px; font-weight: 800; padding: 4px 10px; white-space: nowrap; border: 2px solid var(--c, #9A9AA6); }
.ag-badge.pending { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.ag-badge.in_progress { background: #2563EB; border-color: #2563EB; color: #fff; }
.ag-badge.done { background: #4F7A1E; border-color: #4F7A1E; color: #fff; }
.ag-badge.late { background: #C2410C; border-color: #C2410C; color: #fff; }
.ag-badge.leave { background: #9A9AA6; border-color: #9A9AA6; color: #fff; }
.ag-badge.busy { background: #fff; border-color: #9A9AA6; color: #4A4A52; }
@media (max-width: 860px) { .ag-row { grid-template-columns: 1fr auto; } .ag-time { grid-column: 1 / -1; } .ag-who { grid-column: 1; } .ag-badge { grid-column: 2; grid-row: 2; justify-self: end; } }

.seg { display: inline-flex; border: 1px solid var(--ink); }
.seg-b { height: 40px; padding: 0 18px; border: 0; background: #fff; color: var(--ink); font: 700 14px/1 var(--font); cursor: pointer; }
.seg-b + .seg-b { border-left: 1px solid var(--ink); }
.seg-b[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg-b:focus-visible { outline: 3px solid var(--yellow); outline-offset: -3px; }
.ag-day.ag-blank h3 { border-bottom: 0; background: #fff; padding: 9px 16px; font-size: 14px; color: var(--muted); }
.ag-day.ag-blank h3 small { margin-left: 0; }
.ag-day.ag-blank h3 .ag-today { color: var(--ink); }
