/* KTC Tools – giao diện chung v2: menu nhóm, chân menu, tìm nhanh, điện thoại, ô chọn tệp, trang chủ, đăng nhập */
body { -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
input[type=search] { font: inherit; font-size: 14px; color: var(--text); border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px 7px 34px; max-width: 100%;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a90a2' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 16px; }
input[type=search]:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.home-grid > *, .home-hero > * { min-width: 0; }
@media (max-width: 860px) { .home-hero > .row { flex-wrap: wrap; } .home-search { width: 100%; } .home-search kbd { display: none; } .list-toolbar input[type=search] { width: 100% !important; } }
.sidebar { width: 248px; padding: 14px 10px 10px; gap: 6px; }
.brand-row { padding-bottom: 6px; }
.nav-search { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 9px; background: var(--panel-2); border: 1px solid transparent; color: var(--muted); font-size: 13.5px; margin-bottom: 4px; }
.nav-search:hover { border-color: var(--border); color: var(--text); }
.nav-search .ico { width: 20px; display: grid; place-items: center; }
.nav-search .ic { width: 16px; height: 16px; }
.nav-search span.lbl { flex: 1; text-align: left; }
kbd { font: 600 11px/1 "Segoe UI", system-ui, sans-serif; padding: 3px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); }
#nav { overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; gap: 1px; }
#nav a { padding: 7px 10px; font-size: 14px; position: relative; }
#nav a .ico { width: 20px; display: grid; place-items: center; color: var(--muted); }
#nav a:hover .ico, #nav a.active .ico { color: var(--accent); }
#nav a .ic { width: 18px; height: 18px; }
#nav a.active::before { content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-grp { margin-top: 8px; }
.nav-sec { display: flex; align-items: center; width: 100%; border: 0; background: none; padding: 6px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-radius: 6px; }
.nav-sec:hover { color: var(--text); background: none; }
.nav-sec .lbl:first-child { flex: 1; text-align: left; }
.nav-sec .chev { display: grid; place-items: center; transition: transform .15s; opacity: .7; }
.nav-sec .chev .ic { width: 14px; height: 14px; }
.nav-grp.closed .chev { transform: rotate(-90deg); }
.nav-grp.closed .nav-items { display: none; }
.nav-items { display: flex; flex-direction: column; gap: 1px; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--warn); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.nav-badge[hidden] { display: none !important; }
.me { padding: 10px 4px 0; gap: 4px; align-items: center; justify-content: flex-start; }
.me-name { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; padding: 4px; border-radius: 9px; }
.me-name:hover { background: var(--panel-2); }
.me-name .lbl { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-name b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.me-name small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #086288, #4D8DBA); color: #fff; font-weight: 700; font-size: 14px; }
.me-btn { flex: none; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 8px; }
.me-btn:hover, .me-btn.active { background: var(--panel-2); color: var(--accent); }
.me-btn .ico { width: auto; display: grid; place-items: center; }
.me-btn .ic { width: 18px; height: 18px; }
#ver { padding: 6px 8px 0; font-size: 11px; }
.shell.nav-collapsed .sidebar { width: 68px; }
.shell.nav-collapsed .nav-search { justify-content: center; padding: 8px 0; }
.shell.nav-collapsed .nav-sec { padding: 0; height: 1px; background: var(--border); margin: 6px 10px; pointer-events: none; }
.shell.nav-collapsed .nav-grp { margin-top: 4px; }
.shell.nav-collapsed .nav-grp.closed .nav-items { display: flex; }
.shell.nav-collapsed #nav a.active::before { left: -2px; }
.shell.nav-collapsed .me { flex-direction: column; }
.shell.nav-collapsed .me-name { padding: 0; flex: none; }
.mbar, .nav-scrim { display: none; }

/* Điện thoại / cửa sổ hẹp: thanh trên + menu trượt */
@media (max-width: 860px) {
  .shell { flex-direction: column !important; height: 100vh !important; min-height: 0 !important; }
  .mbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--border); flex: none; z-index: 30; }
  .mbar .brand { padding: 0; font-size: 16px; }
  .mbar .logo { width: 28px; height: 28px; }
  .mbar-title { flex: 1; text-align: right; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-menu { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 0; background: none; color: var(--text); }
  .m-menu .ic { width: 22px; height: 22px; }
  .sidebar { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: 280px !important; flex-direction: column !important; align-items: stretch !important; padding: 14px 10px 10px !important;
    overflow: hidden !important; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
  .sidebar #nav { flex-direction: column !important; }
  .sidebar .me { border-top: 1px solid var(--border) !important; padding: 10px 4px 0 !important; flex-direction: row !important; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10, 12, 20, .45); }
  .shell .sidebar .lbl, .shell .sidebar .nav-sec { display: flex !important; }
  .shell .sidebar #ver { display: block !important; }
  .view { padding: 18px 14px 50px !important; flex: 1; overflow: auto; }
  .page-head { align-items: flex-start; }
}

/* Tìm nhanh (Ctrl+K) */
.cmdk-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(10, 12, 20, .4); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: uiFade .12s; }
@keyframes uiFade { from { opacity: 0; } }
.cmdk { width: min(640px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.cmdk-in .ic { width: 20px; height: 20px; flex: none; }
.cmdk-in input { flex: 1; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: none !important; font-size: 16px; padding: 4px 0; color: var(--text); }
.cmdk-list { overflow: auto; padding: 6px; }
.cmdk-g { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.cmdk-it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.cmdk-it.on, .cmdk-it:hover { background: var(--accent-soft); }
.cmdk-ic { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2); color: var(--accent); }
.cmdk-ic .ic { width: 16px; height: 16px; }
.cmdk-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-l { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cmdk-empty { padding: 28px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); background: var(--panel-2); }
.cmdk-foot kbd { margin-right: 3px; }

/* Ô chọn tệp tiếng Việt, kéo thả */
.fpick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 1.5px dashed var(--border); border-radius: 10px; background: var(--panel); position: relative; cursor: pointer; font-weight: 400; transition: border-color .12s, background .12s; min-height: 44px; color: var(--text); }
.fpick:hover, .fpick.over { border-color: var(--accent); background: var(--accent-soft); }
.fpick.has { border-style: solid; }
.fpick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; margin: 0 !important; }
.fp-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; background: var(--panel-2); color: var(--text); font-size: 13px; font-weight: 600; }
.fpick.has .fp-btn { background: var(--accent); color: #fff; }
.fp-btn .ic { width: 15px; height: 15px; }
.fp-name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fpick.has .fp-name { color: var(--text); }

/* Nhãn trường: chú thích nằm cùng dòng với tên trường */
label.field { display: block; }
label.field > input:not([type=checkbox]):not([type=radio]), label.field > select, label.field > textarea { display: block; width: 100%; margin-top: 6px; }
label.field > .fpick { margin-top: 6px; }
label.field > .small, label.field > .muted { font-weight: 400; }
label.field + label.field, .grid + label.field, label.field + .grid { margin-top: 12px; }

/* Trang chủ */
.home-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.home-hero h1 { font-size: 26px; margin: 2px 0 4px; }
.home-search { display: flex; align-items: center; gap: 10px; min-width: 300px; color: var(--muted); background: var(--panel); }
.home-search span { flex: 1; text-align: left; }
.home-search .ic { width: 16px; height: 16px; }
.home-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.hs { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); min-height: 74px; }
.hs.sk { background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: uiSk 1.2s infinite; }
@keyframes uiSk { to { background-position: -200% 0; } }
a.hs:hover { border-color: var(--accent); }
.hs-ic { grid-row: 1 / 3; width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.hs-ic .ic { width: 20px; height: 20px; }
.hs b { font-size: 22px; line-height: 1.1; }
.hs small { color: var(--muted); font-size: 12.5px; }
.home-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 8px; align-items: stretch; }
.home-grid .card + .card { margin-top: 0; }
.home-recent h2, .home-flow h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.home-recent h2 .ic { width: 18px; height: 18px; color: var(--accent); }
.hr-list { margin-top: 10px; display: flex; flex-direction: column; }
.hr { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 9px; color: var(--text); }
.hr:hover { background: var(--panel-2); }
.hr-dot { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.hr-dot .ic { width: 17px; height: 17px; }
.hr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hr-t b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-t small { color: var(--muted); font-size: 12px; }
.hr-empty { padding: 26px 8px; text-align: center; }
.home-flow { background: linear-gradient(160deg, color-mix(in srgb, var(--cream) 70%, var(--panel)), var(--panel) 75%); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.hf-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; margin-bottom: 10px; }
.hf-ic .ic { width: 22px; height: 22px; }
.hf-steps { list-style: none; counter-reset: s; padding: 0; margin: 6px 0 16px; display: grid; gap: 8px; }
.hf-steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; font-size: 13.5px; }
.hf-steps li::before { content: counter(s); grid-row: 1 / 3; width: 24px; height: 24px; border-radius: 50%; background: var(--panel); border: 1.5px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.hf-steps span { color: var(--muted); font-size: 12.5px; }
.home .home-sec { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.home-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ht { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; color: var(--text); transition: border-color .12s, transform .12s, box-shadow .12s; }
.ht:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.ht-ic { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.ht-ic .ic { width: 20px; height: 20px; }
.ht b { display: block; font-size: 14.5px; }
.ht small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } .home-stats { grid-template-columns: 1fr 1fr; } .home-search { min-width: 0; flex: 1; } .home-hero > .row { width: 100%; } }

/* Đăng nhập */
.auth { padding: 0 !important; display: block !important; place-items: normal !important; }
.auth.hidden { display: none !important; }
.auth-split { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art { background: radial-gradient(circle at 12% 10%, #4D8DBA 0, #086288 45%, #053f59 100%); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; width: 560px; height: 560px; right: -200px; bottom: -220px; border-radius: 50%; background: rgba(255,255,255,.07); }
.auth-art::before { content: ""; position: absolute; width: 260px; height: 260px; right: 80px; top: -120px; border-radius: 50%; background: rgba(255,255,255,.05); }
.auth-art .brand { color: #fff; padding: 0; font-size: 20px; justify-content: flex-start; position: relative; z-index: 1; }
.auth-art .logo { background: #FFEFC4; color: #086288; }
.auth-art h1 { font-size: 34px; line-height: 1.2; margin: 0 0 14px; max-width: 520px; }
.auth-art p { opacity: .85; max-width: 480px; margin: 0; }
.auth-feats { display: grid; gap: 12px; margin-top: 28px; max-width: 480px; position: relative; z-index: 1; }
.auth-feats div { display: flex; gap: 12px; align-items: center; font-size: 14.5px; }
.auth-feats .ic { width: 18px; height: 18px; flex: none; padding: 8px; box-sizing: content-box; border-radius: 10px; background: rgba(255,255,255,.14); }
.auth-foot { font-size: 12.5px; opacity: .7; position: relative; z-index: 1; }
.auth-form-wrap { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.auth-form-wrap .card { width: 100%; max-width: 380px; padding: 30px 28px; }
.auth-form-wrap h2 { font-size: 22px; margin: 0 0 4px; }
.auth form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.auth form button.primary { justify-content: center; padding: 11px; font-weight: 600; margin-top: 4px; }
@media (max-width: 860px) { .auth-split { grid-template-columns: 1fr; } .auth-art { padding: 28px 24px; min-height: 0; } .auth-art h1 { font-size: 24px; } .auth-feats, .auth-foot { display: none; } }

/* Trạng thái trống & thanh công cụ danh sách */
.list-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.empty-state { text-align: center; padding: 40px 16px; }
.es-ic { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.es-ic .ic { width: 26px; height: 26px; }
.empty-state h3 { margin: 4px 0; font-size: 17px; }
.empty-state .row { justify-content: center; margin-top: 14px; }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 6px; }
.theme-pick button { flex-direction: column; align-items: stretch; padding: 6px; gap: 6px; font-size: 12.5px; white-space: normal; }
.theme-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.theme-pick .sw { display: block; width: 100%; height: 34px; border-radius: 6px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.fl-mode { white-space: normal; min-width: 0; }

/* ---- bảng màu #086288 · #4D8DBA · #97D7FF · #FFEFC4 ---- */
.logo { background: linear-gradient(135deg, #086288, #4D8DBA) !important; color: #fff !important; }
.auth-art .logo { background: #FFEFC4 !important; color: #086288 !important; }
.auth-feats .ic { background: rgba(151,215,255,.22); }
.nav-badge { background: #FFEFC4; color: #7a5200; }
.hs-ic { background: var(--accent-soft); }
.hf-ic { background: linear-gradient(135deg, #086288, #4D8DBA); }
.fl-hero { background: linear-gradient(100deg, color-mix(in srgb, var(--cream) 65%, var(--panel)), var(--panel)); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.fl-demo { background: color-mix(in srgb, var(--cream) 55%, var(--panel)); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover:not(:disabled), .btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.home-sec, .nav-sec { letter-spacing: .07em; }
#nav a { padding: 6px 10px; font-size: 13.5px; }
.nav-grp { margin-top: 4px; }
@media (prefers-color-scheme: dark) {
  .nav-badge { color: #5a3d00; }
  .home-flow, .fl-hero, .fl-demo { background: linear-gradient(160deg, #1d3340, var(--panel)); }
}
/* menu gọn để vừa màn hình 900px không phải cuộn */
#nav a { padding: 5px 10px; }
.nav-sec { padding: 5px 10px 2px; }
.nav-grp { margin-top: 2px; }
.brand-row { padding-bottom: 2px; }
.nav-search { padding: 6px 10px; margin-bottom: 2px; }
.sidebar { gap: 4px; padding-top: 12px; }
/* icon loại hoạt động học tập (kịch bản, dự án, việc) */
.act-ic { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 7px; vertical-align: middle; color: var(--ai, #086288); background: var(--ab, #e3f2fb); }
.act-ic svg { width: 16px; height: 16px; }
.act-ic.sm { width: 22px; height: 22px; border-radius: 6px; } .act-ic.sm svg { width: 14px; height: 14px; }
.act-ic.lg { width: 34px; height: 34px; border-radius: 9px; } .act-ic.lg svg { width: 19px; height: 19px; }
.act-video { --ai: #ffffff; --ab: #086288; }
.act-reading { --ai: #086288; --ab: #dbeefa; }
.act-interactive { --ai: #ffffff; --ab: #4D8DBA; }
.act-quiz { --ai: #7a5200; --ab: #FFEFC4; }
.act-discussion { --ai: #2f6f9c; --ab: #e6f6ff; }
.act-assignment { --ai: #8a5d00; --ab: #fff5d9; }
.act-live { --ai: #086288; --ab: #97D7FF; }
@media (prefers-color-scheme: dark) {
  .act-reading { --ai: #97D7FF; --ab: #12394f; } .act-discussion { --ai: #97D7FF; --ab: #163042; } .act-assignment { --ai: #FFEFC4; --ab: #3a3016; }
}
.tk-title { display: flex; gap: 8px; align-items: flex-start; }
.tk-title .act-ic { margin-top: 2px; }
.fl-act, .fl-pmain { gap: 10px; }
.fl-tools .ic, .fl-out .ic { width: 15px; height: 15px; }
.fl-out a { display: inline-flex; align-items: center; gap: 5px; }
/* thẻ số liệu trang Dự án: icon nét theo bảng màu */
.fl-stat > span { color: var(--accent); background: var(--accent-soft) !important; font-size: 0 !important; }
.fl-stat > span .ic { width: 21px; height: 21px; }
.fl-stat.fs-gear > span { color: #4D8DBA; }
.fl-stat.fs-done > span { color: #138a4b; background: #e3f6ec !important; }
.fl-stat.fs-tasks > span { color: #7a5200; background: #FFEFC4 !important; }
@media (prefers-color-scheme: dark) { .fl-stat.fs-done > span { background: #173326 !important; color: #4cc98a; } .fl-stat.fs-tasks > span { background: #3a3016 !important; color: #FFEFC4; } }
