/* Dũng Mori CRM — giao diện chung. Nền kem ấm, thẻ bo lớn, menu ngang dạng nút tròn; màu nhấn xanh Dũng Mori.
   Icon nét tròn (crm/icons.py), không dùng emoji. */
:root {
  --mori: #56d060;
  --brand: #2f7d4a;            /* xanh đậm như nút icon trên web Dũng Mori */
  --brand-dark: #24633a;
  --brand-soft: #e3f1e2;
  --brand-ring: #bcdcbf;
  --hl: #cfeac6;               /* ô nổi bật (thẻ số đầu tiên) */
  --ink: #1e1a16;              /* nút đang chọn: nền gần đen như mẫu */
  --green: #2e9e3a; --green-soft: #e6f4e3;
  --red: #c8372d; --red-soft: #fbe7e2; --orange: #c87414; --orange-soft: #fcefd9; --blue: #2f6fd6; --blue-soft: #e8effb;
  --text: #1e1a16; --text-2: #4f473f; --muted: #8a8075; --line: #ece3d6; --line-2: #ddd2c3;
  --bg: #f4ede2;               /* nền trang */
  --surface: #fffcf7;          /* thẻ, bảng, ô nhập */
  --bg-soft: #f8f2e9; --bg-soft-2: #f1e9dd;
  --r: 22px; --r-sm: 12px; --h: 40px; --h-sm: 34px;
  --tn-h: 76px;                /* chiều cao thanh trên — trang toàn màn hình (hội thoại, khách hàng) trừ đi */
  --shadow: 0 1px 2px rgba(60, 40, 20, .05);
  --shadow-pop: 0 16px 40px rgba(60, 40, 20, .16);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Be Vietnam Pro", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
       color: var(--text); background: var(--bg); font-size: 15.5px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 30px; font-weight: 700; margin: 0; letter-spacing: -.025em; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 14px; letter-spacing: -.01em; }
.muted { color: var(--muted); }
small, .small { font-size: 14px; }
code { background: var(--bg-soft-2); padding: 1px 6px; border-radius: 5px; font-size: 14px; }

/* ---------- icon ---------- */
.ic { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8;
      stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }
/* icon trong vòng tròn xanh đậm — giống bộ nút Test / Cửa hàng / Tư vấn của Dũng Mori */
.bubble { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; flex: 0 0 auto;
          display: inline-flex; align-items: center; justify-content: center; }
.bubble .ic { width: 22px; height: 22px; stroke-width: 1.9; }
.bubble.sm { width: 34px; height: 34px; } .bubble.sm .ic { width: 18px; height: 18px; }
.bubble.soft { background: var(--brand-soft); color: var(--brand); }

/* ---------- dải lối vào dọc bên trái: web học, HRM, Phòng học, Quản lý lớp học (mở tab mới) ---------- */
.dm-rail { position: fixed; left: 0; top: 0; bottom: 0; z-index: 25; width: 64px; display: flex; flex-direction: column; align-items: center;
           gap: 6px; padding: calc(var(--tn-h) + 8px) 0 12px; background: var(--surface); border-right: 1px solid var(--line); }
.dm-rail a { width: 56px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border-radius: 14px;
             color: var(--text-2); font-size: 10.5px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; }
.dm-rail a .ic { width: 20px; height: 20px; }
.dm-rail a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
body:has(.dm-rail) { padding-left: 64px; }
.tn-o.dm-rail-m { display: none; }

/* ---------- thanh trên ---------- */
.tn { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: var(--tn-h);
      padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); font-size: 14px; }
.tn-logo { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; }
.tn-logo img { width: 42px; height: 42px; border-radius: 50%; display: block; box-shadow: 0 4px 12px rgba(226, 73, 47, .32); }
/* "by DMR" dưới logo, giống HRM */
.tn-by { font-size: 10px; font-weight: 700; letter-spacing: .5px; line-height: 1; color: var(--muted); white-space: nowrap; }
.tn-nav { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; }
.tn-nav::-webkit-scrollbar { display: none; }
/* 1 mục menu: nút tròn viền nhạt; đang mở = nền gần đen chữ trắng */
.tn-i { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 16px; border-radius: 999px; flex: none;
        background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px;
        white-space: nowrap; cursor: pointer; list-style: none; transition: background .12s, border-color .12s; }
.tn-i::-webkit-details-marker { display: none; }
.tn-i .ic { width: 18px; height: 18px; color: var(--text-2); }
.tn-i > .ic:last-child:not(:first-child) { width: 15px; height: 15px; margin: 0 -4px 0 -2px; }
a.tn-i:hover, summary.tn-i:hover { border-color: var(--line-2); background: var(--surface); text-decoration: none; }
.tn-i.on, .tn-i.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.tn-i.on .ic, .tn-i.dark .ic { color: #fff; }
a.tn-i.on:hover, summary.tn-i.on:hover, summary.tn-i.dark:hover { background: #3a332c; border-color: #3a332c; }
.tn-space { flex: none; }
.tn-i.soon { color: var(--muted); cursor: default; background: transparent; border-style: dashed; }
.tn-i.soon .ic { color: var(--muted); }
.tn-i.soon em { font-style: normal; font-size: 11px; font-weight: 500; }
/* số đếm cạnh mục: viên tròn đen (trên nút đang mở thì trắng) */
.tn-n { font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--ink); color: #fff;
        font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tn-i.on .tn-n { background: var(--surface); color: var(--ink); }
.tn-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; padding-left: 8px; }
.tn-btn, .tn-av { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
                  position: relative; flex: none; cursor: pointer; list-style: none; }
.tn-btn { background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
.tn-btn:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.tn-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tn-dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 2px var(--surface); }
.tn-av { background: var(--hl); color: var(--brand-dark); font-weight: 700; font-size: 15px; }
.tn-av::-webkit-details-marker { display: none; }
.tn-av:hover { box-shadow: 0 0 0 3px var(--brand-ring); }
.tn-dd { position: relative; flex: none; }
.tn-dd > summary { list-style: none; }
/* menu thả: vị trí cố định do script trong base.html đặt theo nút (để không bị dải cuộn cắt mất) */
.tn-pop { position: fixed; z-index: 40; min-width: 250px; max-width: calc(100vw - 16px); background: var(--surface); border-radius: 20px;
          box-shadow: var(--shadow-pop); border: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.tn-pop-h { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 6px 10px 8px; }
.tn-me .tn-pop-h { color: var(--text); font-size: 14px; }
.tn-pop-h small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; margin-top: 1px; }
.tn-o { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; color: var(--text); font: inherit;
        font-size: 14px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; white-space: nowrap; }
.tn-o .ic { width: 19px; height: 19px; color: var(--text-2); }
.tn-o:hover { background: var(--bg-soft-2); text-decoration: none; }
.tn-o.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.tn-pop form { margin: 0; }
.tn-sep { border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; margin-top: 4px; padding-top: 12px; }
.tn-sp { display: flex; gap: 11px; align-items: center; padding: 8px 10px; border-radius: 14px; color: var(--text); width: 340px; max-width: 100%; }
.tn-sp:hover { background: var(--bg-soft-2); text-decoration: none; }
.tn-sp.on { background: var(--brand-soft); }
.tn-sp b { display: block; font-size: 14px; }
.tn-sp small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; white-space: normal; }

.main { min-height: calc(100vh - var(--tn-h)); }
.page { padding: 0 24px 48px; max-width: 1480px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 0 22px; }
.topbar .grow, .grow { flex: 1; }
.topbar h1 small { font-size: 16.5px; font-weight: 400; color: var(--muted); letter-spacing: 0; }

/* ---------- nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: var(--h);
       padding: 0 18px; border-radius: 999px; border: 1px solid transparent; background: var(--brand); color: #fff;
       font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn .ic { width: 18px; height: 18px; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.soft:hover { background: #d3e9d1; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #bf3535; }
.btn.danger-ghost { background: var(--surface); color: var(--red); border-color: #f2c9c9; }
.btn.danger-ghost:hover { background: var(--red-soft); }
.btn.sm { height: var(--h-sm); padding: 0 12px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: var(--h-sm); height: var(--h-sm); border-radius: 50%; border: 0; background: none; color: var(--text-2);
            display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; flex: 0 0 auto; }
.icon-btn:hover { background: var(--bg-soft-2); color: var(--text); }
.icon-btn.on { background: var(--brand-soft); color: var(--brand); }
.icon-btn .ic { width: 19px; height: 19px; }

/* ---------- ô nhập ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-2);
                          border-radius: var(--r-sm); padding: 0 13px; max-width: 100%; }
input, select { height: var(--h); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); padding: 0; }
input[type=color] { width: 40px; padding: 3px; }
input[type=file] { height: auto; padding: 6px; }
textarea { padding: 9px 11px; width: 100%; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-ring); outline-offset: 0; border-color: var(--brand); }
select { appearance: none; padding-right: 32px; cursor: pointer;
         background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d848e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.5 9.5 5.5 5.5 5.5-5.5'/%3E%3C/svg%3E") no-repeat right 11px center / 16px; }
select[multiple] { background-image: none; padding: 4px; height: auto; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .ic { position: absolute; left: 11px; color: var(--muted); pointer-events: none; width: 18px; height: 18px; }
.input-icon input { padding-left: 36px; width: 100%; }
label.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

/* công tắc bật/tắt */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .tr { width: 38px; height: 22px; border-radius: 11px; background: #cfd4da; position: relative; transition: background .15s; flex: 0 0 38px; }
.switch .tr::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
                     background: var(--surface); transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .tr { background: var(--brand); }
.switch input:checked + .tr::after { left: 19px; }
.switch input:focus-visible + .tr { outline: 3px solid var(--brand-ring); }

.msg { padding: 11px 14px; border-radius: var(--r-sm); margin: 14px 0 0; background: var(--green-soft); color: #1c5a2b; }
.msg.error { background: var(--red-soft); color: #9c2b2b; }
.msg.info { background: var(--blue-soft); color: #1f4f9a; }
.msg.warning { background: var(--orange-soft); color: #8a4b0f; }

/* ---------- nhãn ---------- */
/* nhãn theo màu riêng (giai đoạn, thẻ): đặt style="--c:#màu" — nền nhạt, chữ đậm cùng màu */
.stage { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 14px;
         font-weight: 500; white-space: nowrap; color: color-mix(in srgb, var(--c, #7d848e) 78%, #000);
         background: color-mix(in srgb, var(--c, #7d848e) 13%, #fff); }
.stage::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #7d848e); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 500;
       white-space: nowrap; color: color-mix(in srgb, var(--c, #2e9e3a) 80%, #000); background: color-mix(in srgb, var(--c, #2e9e3a) 14%, #fff); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 13px;
        background: var(--bg-soft-2); color: var(--text-2); white-space: nowrap; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #c8ccd2; display: inline-block; flex: 0 0 8px; }
.dot.on { background: #2fbf4f; }

/* ---------- thẻ số liệu, khung ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px 22px; display: block; color: inherit; background: var(--surface); }
.kpis > .kpi:first-child { background: var(--hl); border-color: var(--hl); }
.kpis > .kpi:first-child span { color: #2c5232; }
a.kpi:hover { border-color: var(--brand-ring); text-decoration: none; }
.kpi b { display: block; font-size: 34px; font-weight: 700; margin-top: 10px; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--text-2); font-size: 15.5px; font-weight: 500; }
.kpi.warn b { color: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; margin-bottom: 18px; background: var(--surface); }
.card h2 small { font-weight: 400; color: var(--muted); }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h2 { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty img { width: 96px; display: block; margin: 0 auto 8px; }

.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: 15px; }
.bar .track { background: var(--bg-soft-2); border-radius: 999px; height: 14px; overflow: hidden; }
.bar .fill { background: var(--green); height: 100%; border-radius: 999px; }
.bar .num { text-align: right; font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.seg a, .seg button { padding: 0 14px; height: 32px; display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; color: var(--text-2);
                      font: inherit; font-size: 14.5px; border: 0; background: none; cursor: pointer; white-space: nowrap; }
.seg a.on, .seg button.on { background: var(--ink); color: #fff; font-weight: 600; }
.seg a:hover { text-decoration: none; color: var(--text); }

/* ---------- bảng ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14px; padding: 11px 14px;
          border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-soft); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: var(--bg-soft); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; overflow-x: auto; background: var(--surface); }
.tbl-wrap .tbl tr:last-child td { border-bottom: 0; }
.who-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-cell b { font-weight: 500; color: var(--text); display: block; }
.who-cell small { color: var(--muted); }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--hl); color: var(--brand-dark); font-size: 14px; font-weight: 600;
      display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }

/* thanh công cụ danh sách: tìm + vài bộ lọc chính + nút "Bộ lọc" */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .input-icon { flex: 1 1 280px; max-width: 420px; }
.toolbar select { min-width: 150px; }
.more-filters { display: none; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; padding: 16px; background: var(--surface); border: 1px solid var(--line);
                border-radius: var(--r); margin-bottom: 12px; }
.more-filters.open { display: flex; }
.more-filters .field { display: flex; flex-direction: column; gap: 4px; }
.more-filters .field label { font-size: 14px; color: var(--muted); margin: 0; }
.count { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand);
         color: #fff; font-size: 12px; align-items: center; justify-content: center; font-weight: 600; }
.bulk { position: sticky; top: 0; z-index: 3; display: none; gap: 10px; align-items: center; padding: 8px 12px; margin-bottom: 8px;
        background: var(--ink); color: #fff; border-radius: 999px; }
.bulk.show { display: flex; }
.bulk select { height: var(--h-sm); }
.pager { display: flex; gap: 8px; justify-content: center; margin: 18px 0; align-items: center; }

/* ---------- chi tiết khách ---------- */
.detail { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.info dl { display: grid; grid-template-columns: 112px 1fr; gap: 9px 10px; margin: 0; font-size: 15px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; word-break: break-word; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.stepper { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.stepper button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 0 14px; height: 32px;
                  font: inherit; font-size: 14.5px; cursor: pointer; color: var(--text-2); }
.stepper button:hover { border-color: var(--brand); color: var(--text); }
.stepper button.on { color: #fff; border-color: transparent; font-weight: 600; }
.lost-box { display: none; gap: 8px; align-items: center; margin: -6px 0 16px; flex-wrap: wrap; }
.lost-box.show { display: flex; }
.act-form { display: grid; gap: 10px; }
.act-form .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.act-form .row input { flex: 1; min-width: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .tl-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-soft-2); color: var(--text-2);
                   display: flex; align-items: center; justify-content: center; }
.timeline .tl-ic .ic { width: 16px; height: 16px; }
.timeline .tl-ic.contact { background: var(--brand-soft); color: var(--brand); }
.timeline .meta { font-size: 14px; color: var(--muted); }
.timeline .body { white-space: pre-wrap; margin-top: 2px; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task-list li:last-child { border-bottom: 0; }
.task-list li.done .t { text-decoration: line-through; color: var(--muted); }
.task-list form { margin: 0; }
.check { width: 20px; height: 20px; border: 1.5px solid #bfc5cc; border-radius: 50%; background: var(--surface); cursor: pointer;
         padding: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.check .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.check:hover { border-color: var(--brand); }
.done .check { background: var(--brand); border-color: var(--brand); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.inline-form input:not([type=checkbox]):not([type=color]):not([type=file]) { flex: 1; min-width: 140px; }

/* ---------- form ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; max-width: 860px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 14.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.field .err { color: var(--red); font-size: 14.5px; margin-top: 4px; }
.field .hint { color: var(--muted); font-size: 14px; margin-top: 4px; }
.errorlist { color: var(--red); margin: 8px 0; padding-left: 18px; }

/* ---------- pipeline kéo thả ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.col { flex: 0 0 264px; background: var(--bg-soft-2); border-radius: var(--r); display: flex; flex-direction: column;
       max-height: calc(100vh - var(--tn-h) - 110px); }
.col-h { padding: 12px; font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.col-h::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.col-h .n { color: var(--muted); font-weight: 400; margin-left: auto; }
.col-b { padding: 0 8px 10px; overflow-y: auto; min-height: 80px; flex: 1; }
.col.over { outline: 2px dashed var(--brand); }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 11px; margin-bottom: 8px;
         cursor: grab; display: block; color: inherit; font-size: 14.5px; box-shadow: var(--shadow); }
.kcard:hover { border-color: var(--brand-ring); text-decoration: none; }
.kcard b { display: block; font-weight: 500; font-size: 15px; margin-bottom: 3px; }
.kcard .m { color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.kcard.dragging { opacity: .4; }
.tgroup h2 { margin-top: 20px; }
.tgroup.late h2 { color: var(--red); }

/* ---------- đăng nhập ---------- */
body.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.login-art { background: linear-gradient(160deg, #e5f6e8, #c9ecd0); display: flex; flex-direction: column; align-items: center;
             justify-content: center; padding: 40px; text-align: center; color: #1f5c34; }
.login-art img { width: min(320px, 70%); }
.login-art h2 { font-size: 22px; margin: 16px 0 6px; }
.login-art p { margin: 0; color: #3d6b4b; max-width: 360px; }
/* khung đăng nhập theo Pancake: tiêu đề lớn, ô nhập cao bo tròn, nút tròn dài, "Hoặc tiếp tục với" + Facebook */
.login-box { margin: auto; width: min(400px, 90vw); display: flex; flex-direction: column; gap: 14px; }
.login .brand { display: flex; align-items: center; gap: 10px; }
.login .brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 4px 12px rgba(226, 73, 47, .35); }
.login .brand span { font-weight: 700; font-size: 16.5px; letter-spacing: -.01em; }
.login .brand small, .doc-page .brand small { display: block; font-size: 12.5px; font-weight: 600; color: #e2492f; letter-spacing: .04em; }
.login h1 { font-size: 32px; letter-spacing: -.03em; margin: 18px 0 4px; }
.login .msg { margin: 0; }
.login form { display: grid; gap: 12px; }
.login input:not([type=hidden]) { height: 50px; border-radius: 12px; padding: 0 16px; font-size: 16.5px; }
.login .btn { height: 50px; border-radius: 999px; font-size: 16.5px; font-weight: 600; }
.login-help { margin: 0; font-size: 14.5px; color: var(--muted); }
.login-or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* nút Facebook (đăng nhập, liên kết) */
.btn.fb-btn { background: #1877f2; color: #fff; }
.btn.fb-btn:hover { background: #0f63d0; }
.btn.fb-btn:disabled { opacity: .45; cursor: not-allowed; }
.fb-f { width: 20px; height: 20px; border-radius: 50%; background: var(--surface); color: #1877f2; display: inline-flex; align-items: flex-end;
        justify-content: center; font: 700 17px/1 Helvetica, Arial, sans-serif; overflow: hidden; flex: none; }
.fb-f::before { content: "f"; margin-bottom: -2px; margin-left: 2px; }
.fb-linked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.fb-linked small { display: block; }

/* ---------- cài đặt ---------- */
.st { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; padding-top: 22px; }
.st-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; align-self: start; }
.st-nav h1 { margin: 0 0 14px 10px; }
.st-nav a { display: flex; align-items: center; gap: 11px; padding: 0 14px; height: 42px; border-radius: 999px; color: var(--text-2); }
.st-nav a .ic { color: var(--muted); width: 19px; height: 19px; }
.st-nav a:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.st-nav a.on { background: var(--ink); color: #fff; font-weight: 600; }
.st-nav a.on .ic { color: #fff; }
.st-nav .sep { height: 1px; background: var(--line); margin: 8px 10px; }
.st-h { font-size: 20px; margin: 0 0 4px; }
.st-sub { color: var(--muted); margin: 0 0 18px; }
.st-section { margin-top: 28px; }
.st-section > h2 { display: flex; align-items: center; gap: 8px; }

/* kết nối kênh */
.connect { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 8px; }
.cn-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.cn-card .cn-top { display: flex; align-items: center; gap: 12px; }
.cn-card b { font-size: 16.5px; display: block; }
.cn-card p { margin: 0; color: var(--muted); font-size: 14.5px; flex: 1; }
.cn-card .note { font-size: 13px; color: var(--orange); }
.pf-logo { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
           color: #fff; font-weight: 700; font-size: 20px; flex: 0 0 auto; }
.pf-logo.sm { width: 36px; height: 36px; border-radius: 10px; }
.pf-logo.facebook { background: #1877f2; } .pf-logo.facebook::before { content: "f"; font-size: 26px; font-family: Helvetica, Arial, sans-serif; }
.pf-logo.zalo { background: #0068ff; } .pf-logo.zalo::before { content: "Zalo"; font-size: 13px; }
.pf-logo.zalo_ca_nhan { background: var(--surface); color: #0068ff; box-shadow: inset 0 0 0 2px #0068ff; } .pf-logo.zalo_ca_nhan::before { content: "Zalo"; font-size: 13px; }
.pf-logo.tiktok { background: #111; } .pf-logo.tiktok::before { content: "♪"; font-size: 22px; }
.ch-list { border: 1px solid var(--line); border-radius: var(--r); }
.ch-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 16px; }
.ch-row + .ch-row, .ch-edit + .ch-row { border-top: 1px solid var(--line); }
.ch-row .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-row .acts { display: flex; gap: 4px; align-items: center; }
.ch-edit { display: none; padding: 0 16px 16px 64px; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.ch-edit.open { display: flex; }
.ch-edit .field { min-width: 200px; }
.ch-err { color: var(--red); font-size: 14px; margin-top: 2px; }
details.guide { border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px; margin-top: 12px; }
details.guide summary { cursor: pointer; padding: 13px 0; font-weight: 500; color: var(--text-2); }
details.guide[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }

/* xoay vòng */
.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.modes button { text-align: left; padding: 14px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface);
                font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 10px; color: var(--text); }
.modes button:hover { border-color: var(--brand-ring); }
.modes button b { font-weight: 600; font-size: 15px; }
.modes button small { color: var(--muted); }
.modes button.on { border-color: var(--brand); background: var(--brand-soft); }
.modes button.on .bubble { background: var(--brand); color: #fff; }
.sw { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.sw input { margin-top: 2px; }
.cfg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); align-items: center; }
.cfg:first-of-type { border-top: 0; }
.cfg small { display: block; color: var(--muted); margin-top: 3px; font-size: 14.5px; }
.cfg .row, .grp .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.day-chk { font-size: 14px; display: inline-flex; gap: 3px; align-items: center; }
.rr-tbl .pick { display: inline-flex; align-items: center; gap: 4px; }
.rr-tbl .ord { min-width: 18px; font-size: 12px; color: var(--brand); font-weight: 600; }
.rr-tbl .ratio { width: 64px; height: var(--h-sm); }
.st-seg button { height: 28px; padding: 0 10px; font-size: 14px; }
.grp { padding: 12px 0; border-top: 1px solid var(--line); }
.grp .members { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 15px; }
.perm-wrap { overflow-x: auto; }
.perm th.c, .perm td.c { text-align: center; font-size: 14px; }
.perm .role-h td { background: var(--bg-soft); font-weight: 600; }
.perm tr.off td { opacity: .55; }
.perm .ch-sel { min-width: 150px; }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; min-height: 140px; justify-content: center; }
.qr-box img { width: 240px; height: 240px; image-rendering: pixelated; }
.qr-box .av-big { width: 64px; height: 64px; border-radius: 50%; }

/* biểu tượng nền tảng nhỏ (gắn cạnh tên trang) */
.pf { width: 16px; height: 16px; border-radius: 50%; font-style: normal; font-size: 10px; font-weight: 700; color: #fff;
      display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; flex: 0 0 auto; }
.pf-facebook { background: #1877f2; } .pf-facebook::before { content: "f"; font-size: 12px; }
.pf-zalo { background: #0068ff; } .pf-zalo::before { content: "Z"; }
.pf-zalo_ca_nhan { background: var(--surface); color: #0068ff; box-shadow: inset 0 0 0 1.5px #0068ff; } .pf-zalo_ca_nhan::before { content: "Z"; }
.pf-tiktok { background: #111; } .pf-tiktok::before { content: "♪"; }

/* ---------- thống kê ---------- */
.multiples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-bottom: 8px; }
.mchart { margin: 0; }
.mchart figcaption { display: flex; justify-content: space-between; align-items: baseline; font-size: 14.5px; color: var(--muted); margin-bottom: 8px; }
.mchart figcaption b { font-size: 22px; color: var(--text); font-weight: 600; }
.plot { position: relative; height: 140px; border-bottom: 1px solid #e3e6e9; }
.plot .ymax { position: absolute; top: -2px; left: 0; font-size: 12px; color: var(--muted); }
.plot::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; border-top: 1px solid #f0f1f3; }
.cols { position: absolute; inset: 16px 0 0; display: flex; align-items: flex-end; gap: 2px; }
.col-hit { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.col-hit i { display: block; width: 100%; max-width: 24px; background: var(--green); border-radius: 4px 4px 0 0; }
.col-hit:hover i { background: #237a33; }
.xax { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.tip { position: fixed; z-index: 30; background: #223; color: #fff; font-size: 14px; padding: 4px 8px; border-radius: 6px; pointer-events: none; }
.medal { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; font-size: 12px; font-weight: 700; align-items: center;
         justify-content: center; margin-right: 6px; color: #fff; background: #b08d2c; }
.medal.m2 { background: #8a9099; } .medal.m3 { background: #a0673a; }
.rating-avg { font-size: 30px; font-weight: 600; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.rating-avg .ic { color: #eda100; fill: #eda100; width: 26px; height: 26px; }

/* ---------- điện thoại ---------- */
@media (max-width: 900px) {
  /* thanh trên 2 tầng: logo + không gian + tài khoản, dưới là dải menu cuộn ngang */
  :root { --tn-h: 116px; }
  /* điện thoại: không có dải dọc, lối vào nằm trong menu tài khoản */
  .dm-rail { display: none; }
  body:has(.dm-rail) { padding-left: 0; }
  .tn-o.dm-rail-m { display: flex; }
  .tn { flex-wrap: wrap; height: auto; min-height: var(--tn-h); padding: 8px 12px 6px; gap: 6px 8px; align-content: center; }
  .tn-logo img { width: 40px; height: 40px; }
  .tn-nav { order: 3; flex: 1 1 100%; margin: 0 -12px; padding: 2px 12px 4px; }
  .tn-i { height: 40px; padding: 0 14px; }
  .tn-btn, .tn-av { width: 40px; height: 40px; }
  .page { padding: 0 16px 32px; }
  h1 { font-size: 24px; }
  .kpi b { font-size: 26px; }
  .kpi { padding: 16px 18px; }
  .card { padding: 18px; }
  .grid2, .detail, .form-grid, .st { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 110px 1fr 56px; }
  .tbl .hide-m { display: none; }
  .toolbar .input-icon { max-width: none; }
  .col { flex-basis: 78vw; }
  .st-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .st-nav h1 { width: 100%; }
  .modes, .multiples { grid-template-columns: 1fr 1fr; }
  .cfg { grid-template-columns: 1fr; }
  .ch-row { grid-template-columns: 1fr; }
  .ch-edit { padding-left: 16px; }
  body.login { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
.tag .x { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; display: inline-flex; opacity: .7; }
.tag .x:hover { opacity: 1; }
.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ch-pick { position: relative; }
.ch-pick summary { list-style: none; cursor: pointer; height: var(--h-sm); display: inline-flex; align-items: center; gap: 6px; padding: 0 30px 0 12px;
                   border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 14.5px; white-space: nowrap;
                   background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d848e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.5 9.5 5.5 5.5 5.5-5.5'/%3E%3C/svg%3E") no-repeat right 8px center / 15px; }
.ch-pick summary::-webkit-details-marker { display: none; }
.ch-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
          box-shadow: var(--shadow-pop); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 240px; }
.ch-pop label { font-size: 14.5px; }


/* ---------- Bảng điều khiển trang + chế độ gộp trang (theo Pancake) ---------- */
.dash { display: flex; flex-direction: column; gap: 12px; padding-top: 22px; min-width: 0; }
.dash > * { min-width: 0; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.dash-head h1 { margin: 0 0 12px; font-size: 20px; }
.dash-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-q { flex: 0 1 420px; }
.dash-q input { background: var(--bg-soft); border-color: transparent; height: 40px; border-radius: 10px; }
.dash-q input:focus { background: var(--surface); }
.dash-bar .icon-btn { width: 40px; height: 40px; }
.dash-tabs { display: flex; gap: 6px; padding: 10px; overflow-x: auto; }
.dash-tabs button { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 0; border-radius: 10px;
  background: none; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.dash-tabs button:hover { background: var(--bg-soft); }
.dash-tabs button.on { background: var(--brand-soft); color: var(--brand); }
.dash-tabs button .ic { width: 18px; height: 18px; }
.dash-tabs i, .gop-tabs i { font-style: normal; font-size: 13px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--bg-soft-2); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.dash-tabs button.on i, .gop-tabs button.on i { background: var(--brand); color: #fff; }
.dash-tabs .pf { width: 18px; height: 18px; border-radius: 5px; }
.dash-none { margin: 4px 0 0; }
.dash .empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 40px 20px; }

.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.pg-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 40px 12px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; min-width: 0;
  transition: border-color .12s, box-shadow .12s, transform .12s; }
.pg-card:hover { border-color: var(--brand-ring); box-shadow: 0 6px 18px rgba(16, 24, 40, .08); transform: translateY(-1px); text-decoration: none; }
.pg-card[hidden] { display: none; }
.pg-card.off { opacity: .6; }
.pg-av { position: relative; width: 64px; height: 64px; flex: none; border-radius: 12px; overflow: hidden; background: var(--brand-soft);
  display: flex; align-items: center; justify-content: center; }
.pg-av b { color: var(--brand); font-size: 24px; }
.pg-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pg-t { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-t b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-t small { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 14.5px; white-space: nowrap; overflow: hidden; }
.pg-t small .pf { width: 17px; height: 17px; border-radius: 4px; }
.pg-warn { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: #f08c2e; color: #fff;
  display: flex; align-items: center; justify-content: center; }
.pg-warn .ic { width: 16px; height: 16px; stroke-width: 2.4; }

/* hộp thoại dùng chung (thẻ <dialog>) */
.dlg { border: 0; padding: 0; border-radius: 18px; width: min(520px, 94vw); max-height: 88vh; box-shadow: var(--shadow-pop); color: var(--text); }
.dlg::backdrop { background: rgba(20, 30, 40, .45); }
.dlg[open] { display: flex; flex-direction: column; }
.dlg form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dlg-lg { width: min(1040px, 94vw); height: min(720px, 88vh); background: var(--bg-soft); }
.dlg-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 10px; }
.dlg-h b { font-size: 18px; }
.dlg-b { padding: 6px 22px 18px; overflow-y: auto; flex: 1; }
.dlg-f { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface); }
.kn-list { display: flex; flex-direction: column; gap: 8px; }
.kn-it { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
a.kn-it:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.kn-it small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.kn-it.off { opacity: .55; }
.kn-go { transform: rotate(-90deg); color: var(--muted); }

.gop-tabs { display: flex; align-items: flex-end; justify-content: space-between; padding: 6px 22px 0; }
.gop-tabs > div { display: flex; gap: 4px; overflow-x: auto; }
.gop-tabs button:not(.icon-btn) { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px; border: 0;
  border-radius: 12px 12px 0 0; background: none; font: inherit; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.gop-tabs button.on { background: var(--surface); color: var(--text); font-weight: 600; }
.dlg-lg .dlg-b { background: var(--surface); padding-top: 16px; }
.gop-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.pg-card.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pg-card.pick .pg-chk { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--line-2); background: var(--surface); }
.pg-card.pick.on { background: var(--brand-soft); border-color: var(--brand-ring); }
.pg-card.pick.on .pg-chk { background: var(--brand); border-color: var(--brand); }
.pg-card.pick.on .pg-chk::after { content: ""; position: absolute; left: 7px; top: 3.5px; width: 5px; height: 10px; border: solid #fff;
  border-width: 0 2px 2px 0; transform: rotate(45deg); }
.gop-key { display: inline-flex; align-items: center; gap: 6px; }
.gop-key .ic { width: 18px; height: 18px; }
kbd { font: inherit; font-size: 13px; padding: 2px 8px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px;
  background: var(--surface); color: var(--text-2); }
@media (max-width: 700px) {
  .pg-grid { grid-template-columns: 1fr; }
  .dash { padding-top: 12px; }
  .dash-card { padding: 14px; }
  .dash-q { flex: 1 1 100%; }
  .dash-bar .grow { display: none; }
  .dash-bar .btn { flex: 1; }
  .pg-av { width: 52px; height: 52px; }
  .gop-key { display: none; }
}
.btn[hidden] { display: none; }
.dlg-h .icon-btn:focus-visible { outline: none; background: var(--bg-soft-2); }

/* trang công khai: chính sách quyền riêng tư / xóa dữ liệu */
body.doc-page { background: #f6f8f7; margin: 0; padding: 32px 16px; }
.doc-page article { max-width: 720px; margin: 0 auto; background: var(--surface); border-radius: 16px; padding: 32px; line-height: 1.65; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.doc-page .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: inherit; text-decoration: none; }
.doc-page .brand img { width: 36px; height: 36px; border-radius: 10px; }
.doc-page h1 { font-size: 26px; margin: 24px 0 8px; }
.doc-page h2 { font-size: 17px; margin: 22px 0 6px; }
.doc-page a { color: var(--brand); }
.login-links { font-size: 14px; color: #888; text-align: center; }
.login-links a { color: inherit; }

/* đăng nhập Facebook lần đầu: nhân viên mới gửi yêu cầu / người cũ gắn tài khoản */
.login-lead { margin: -6px 0 12px; color: var(--text-2); }
.join-opt { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.join-opt b { font-size: 16.5px; }
.join-opt span { color: var(--text-2); font-size: 14.5px; line-height: 1.45; }
.join-opt .btn { margin-top: 6px; }
details.join-opt summary { display: flex; flex-direction: column; gap: 6px; cursor: pointer; list-style: none; }
details.join-opt summary::-webkit-details-marker { display: none; }
details.join-opt summary b::after { content: " ›"; color: var(--muted); }
details.join-opt[open] summary b::after { content: " ⌄"; }
details.join-opt #lf { margin-top: 10px; }
.join-other { text-align: center; margin: 6px 0 4px; }
.linkish { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14.5px; cursor: pointer; text-decoration: underline; }
.linkish:hover { color: var(--text); }

/* yêu cầu tham gia (Nhân viên & quyền) */
.join-req { border-color: var(--orange); margin-bottom: 18px; }
.join-req h2 { display: flex; align-items: center; gap: 8px; }
.jr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.jr-who { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; }
.jr-who > div { display: flex; flex-direction: column; min-width: 0; }
.jr-av { width: 36px; height: 36px; border-radius: 50%; background: #1877f2; color: #fff; display: inline-flex; align-items: center;
         justify-content: center; font-weight: 700; flex: none; }
.jr-row select { width: auto; }
.btn.ghost.danger { background: var(--surface); color: var(--red); border: 1px solid var(--red-soft); }
.btn.ghost.danger:hover { background: var(--red-soft); }
.st-nav .cnt { background: var(--orange); }
.st-nav .cnt { color: #fff; font-size: 12px; font-weight: 700; border-radius: 9px; padding: 0 6px; margin-left: auto; }

/* màn chọn không gian sau đăng nhập */
body.spaces { min-height: 100vh; background: linear-gradient(180deg, #e6f1dc 0, var(--bg) 420px); }
.sp-top { display: flex; align-items: center; gap: 12px; padding: 16px 28px; }
.sp-top form { margin: 0; }
.spaces .brand { display: flex; align-items: center; gap: 10px; }
.spaces .brand img { width: 38px; height: 38px; border-radius: 12px; }
.spaces .brand span { font-weight: 700; font-size: 16.5px; }
.spaces .brand small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.sp-main { max-width: 980px; margin: 0 auto; padding: 24px 24px 60px; text-align: center; }
.sp-mk { width: 120px; }
.sp-main h1 { font-size: 28px; letter-spacing: -.02em; margin: 8px 0 4px; }
.sp-main > p { margin: 0 0 28px; }
.sp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; text-align: left; }
.sp-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border: 1px solid var(--line); border-radius: 16px;
           background: var(--surface); color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s, box-shadow .15s; }
.sp-card:hover { text-decoration: none; border-color: var(--brand-ring); transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.sp-card .bubble { width: 48px; height: 48px; margin-bottom: 8px; }
.sp-card .bubble .ic { width: 24px; height: 24px; }
.sp-card b { font-size: 17px; }
.sp-desc { color: var(--text-2); font-size: 15px; }
.sp-stat { margin-top: auto; padding-top: 12px; font-size: 14.5px; color: var(--brand); font-weight: 600; }
@media (max-width: 600px) { .sp-top { padding: 12px 16px; } .sp-top .muted { display: none; } .sp-main { padding: 8px 16px 40px; } }
.dt-grid { grid-template-columns: 1.6fr 1fr; }
.dt-note { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.tbl b.neg { color: var(--red); font-weight: 600; }
@media (max-width: 900px) { .dt-grid { grid-template-columns: 1fr; } }
.pb-pick { display: flex; flex-direction: column; gap: 5px; font-size: 14.5px; white-space: nowrap; }
.act-form .pb-pick { flex-direction: row; gap: 18px; }

/* đơn hàng */
.row-link { cursor: pointer; }
.row2 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row2 > input, .row2 > select { flex: 1 1 140px; min-width: 0; }
.row2 > .btn { height: var(--h); }   /* nút cao bằng ô nhập bên cạnh */
.row2 > .grow { flex: 3 1 260px; }
.od-form { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.od-main .card h2, .od-sum h2, .od-pay h2 { margin-top: 0; }
.od-cust { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--brand-ring); background: var(--brand-soft); border-radius: var(--r); }
.od-cust small { display: block; }
.od-sug { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }
.od-sug button { display: flex; justify-content: space-between; gap: 10px; text-align: left; border: 0; background: var(--bg-soft); padding: 9px 12px; border-radius: var(--r-sm); font: inherit; cursor: pointer; }
.od-sug button:hover { background: var(--brand-soft); }
.od-sug button span { color: var(--muted); font-size: 14.5px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.fgrid label, .od-form label.full, .od-sum label, .od-amt label { display: flex; flex-direction: column; gap: 5px; font-size: 14.5px; color: var(--text-2); }
.od-form label.full { margin-top: 12px; }
.sh-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.sh-row select:first-child { flex: 1; }
.sh-row .pct { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.sh-row .pct input { width: 64px; text-align: right; }
.od-sum { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; }
.od-sum dl, .od-dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 10px; margin: 0; font-size: 15px; }
.od-sum dt, .od-dl dt { color: var(--muted); }
.od-sum dd, .od-dl dd { margin: 0; }
.od-sum dd { text-align: right; font-variant-numeric: tabular-nums; }
.od-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.od-total b { font-size: 24px; color: var(--brand); font-variant-numeric: tabular-nums; }
.od-go { height: 46px; font-size: 16.5px; }
.od-detail { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.od-who { margin-bottom: 16px; }
.od-dl dd b.neg, .neg { color: var(--red); }
.od-dl .pill { margin: 0 4px 4px 0; }
.od-pay { display: flex; flex-direction: column; gap: 12px; }
.od-amt { display: flex; gap: 8px; align-items: flex-end; }
.od-amt label { flex: 1; }
.od-qr { width: 100%; max-width: 280px; align-self: center; border: 1px solid var(--line); border-radius: 12px; }
.od-copy { display: grid; gap: 8px; background: var(--bg-soft); border-radius: var(--r); padding: 12px; }
.od-copy div { display: flex; flex-direction: column; }
.od-copy b { word-break: break-word; }
/* nút dưới QR: hàng 1 nút chính đủ rộng, hàng 2 tải ảnh + chép nội dung — không bao giờ tràn khung */
.od-btns { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.od-btns > :first-child { grid-column: 1 / -1; }
.od-btns .btn { min-width: 0; }
.od-acc select { width: 100%; }
.od-add { margin-top: 12px; } .od-add summary { list-style: none; } .od-add form { margin-top: 10px; }
.od-cancel { position: relative; } .od-cancel summary { list-style: none; }
.pop-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: flex; gap: 8px; background: var(--surface); padding: 10px;
            border-radius: var(--r); box-shadow: var(--shadow-pop); width: 340px; }
.pop-form input { flex: 1; }
.tx .tx-c { max-width: 340px; word-break: break-word; font-size: 14.5px; }
.tx-match { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.tx-match input { width: 150px; height: var(--h-sm); }
.sim { margin-top: 20px; border-style: dashed; }
@media (max-width: 900px) { .od-form, .od-detail { grid-template-columns: 1fr; } .fgrid { grid-template-columns: 1fr; } .od-sum { position: static; } }
.od-mini { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.od-mini:last-child { border-bottom: 0; }
.od-mini:hover { text-decoration: none; background: var(--bg-soft); }
[hidden] { display: none !important; }

/* trang Lên đơn: 1 cột giữa màn hình, chỉ 1 việc */
.ld { max-width: 680px; margin: 28px auto 40px; }
.qk { padding: 30px 32px; display: flex; flex-direction: column; gap: 18px; }
.qk-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.qk-h h1 { margin: 0; font-size: 30px; }
.qk-f { position: relative; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.qk-f > label { font-size: 14.5px; font-weight: 600; color: var(--text-2); }
.qk-f input:not([type=hidden]), .qk-f select { width: 100%; }
.qk #qk-q, .qk #qk-cq, .qk #qk-name { height: 50px; font-size: 17.5px; }
.qk .input-icon > .ic { width: 20px; height: 20px; }
.qk .input-icon input { padding-left: 40px; }
.qk-pick { display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 8px 0 14px; border-radius: var(--r-sm);
           background: var(--brand-soft); border: 1px solid var(--brand-ring); font-weight: 600; font-size: 16.5px; }
.qk-pick span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qk-x { border: 0; background: none; color: var(--text-2); cursor: pointer; display: flex; padding: 6px; border-radius: 6px; }
.qk-x:hover { background: var(--surface); } .qk-x .ic { width: 18px; height: 18px; }
.qk-dd { position: absolute; top: 80px; left: 0; right: 0; z-index: 20; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-pop);
         padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow: auto; }
.qk-dd button { display: flex; justify-content: space-between; gap: 10px; text-align: left; border: 0; background: none; padding: 10px 12px;
                border-radius: var(--r-sm); font: inherit; font-size: 15.5px; cursor: pointer; }
.qk-dd button:hover, .qk-dd button.on { background: var(--brand-soft); }
.qk-dd button b { font-weight: 500; } .qk-dd button span { color: var(--muted); white-space: nowrap; }
.qk-dd p { margin: 8px 12px; }
.qk-top { display: flex; flex-wrap: wrap; gap: 6px; }
.qk-top button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 14.5px;
                 cursor: pointer; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qk-top button:hover { border-color: var(--brand); color: var(--brand); }
.qk-conv { font-size: 14.5px; }
.qk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.qk-row > * { min-width: 0; }
.qk-go { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.qk-go > div { display: flex; flex-direction: column; }
.qk-go b { font-size: 28px; color: var(--brand); font-variant-numeric: tabular-nums; line-height: 1.2; }
.qk-miss { text-align: right; margin: 6px 0 0; }
.qk-kh { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .qk-kh { grid-template-columns: 1fr; } }
.qk-go .btn { height: 52px; padding: 0 26px; font-size: 17.5px; font-weight: 600; }
.qk-go .btn:disabled { opacity: .45; cursor: not-allowed; }
.qk-more { margin: -6px 0 0; font-size: 14.5px; text-align: center; }
.qk-more a { color: var(--muted); }
@media (max-width: 600px) { .ld { margin-top: 12px; } .qk { padding: 18px 16px; } .qk-row { grid-template-columns: 1fr; }
  .qk-go { flex-direction: column; align-items: stretch; } .qk-go .btn { width: 100%; } }
.od-send .btn { width: 100%; }
.od-link label { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; color: var(--text-2); }
.od-link-on { display: flex; align-items: center; gap: 8px; margin-top: -4px; }
.od-link-on span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qk-conv { font-size: 14.5px; height: var(--h-sm) !important; }
.od-btns .icon-only { padding: 0 14px; }

/* căn chỉnh chung: cột lưới không bị bảng rộng / ô chọn chữ dài kéo giãn (gây cuộn ngang cả trang) */
.grid2 > *, .detail > *, .st > *, .od-form > *, .od-detail > *, .od-main > *, .dt-grid > *, .fgrid > *, .kpis > * { min-width: 0; }
.fgrid select, .fgrid input, .od-sum select { width: 100%; }
/* nút đứng cạnh ô nhập luôn cao bằng ô nhập */
.inline-form .btn, .sh-row .icon-btn, .tx-match .btn { height: var(--h); }
.tx-match input { height: var(--h); }
.act-form > *, .act-form input:not([type=checkbox]):not([type=radio]), .act-form select { min-width: 0; }
.act-form > input, .act-form > select { width: 100%; }
.tbl-scroll { overflow-x: auto; }
.inline-form > form, .inline-form input[type=file] { min-width: 0; max-width: 100%; }
.inline-form > form { flex: 1 1 auto; }
.btn.block { white-space: normal; height: auto; min-height: var(--h); padding-top: 6px; padding-bottom: 6px; text-align: center; }
@media (max-width: 900px) { .dash-tabs { flex-wrap: wrap; overflow: visible; } }

/* đơn Yên: sale ghi tiền kèm bill, kế toán đối chiếu */
.od-yen { display: grid; gap: 12px; }
.od-yen label { display: grid; gap: 6px; font-weight: 500; }
.od-yen input[type=file] { min-width: 0; max-width: 100%; }
.od-dc { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dc-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.dc-bar input[name=reason] { flex: 1 1 220px; min-width: 0; }
.tbl td.dc-ck, .tbl th.dc-ck { width: 36px; }
.qk-cur { margin-left: auto; }
.qk-bill { grid-column: 1 / -1; }
.qk-bill small { display: block; margin-top: 4px; }
@media (max-width: 600px) { .qk-cur { margin-left: 0; } }
.od-wait { display: block; margin-top: 3px; color: var(--orange); font-size: 13px; font-weight: 500; white-space: normal; line-height: 1.3; }
@media (max-width: 600px) { .toolbar .seg { max-width: 100%; overflow-x: auto; } .toolbar .seg a { flex: none; white-space: nowrap; } }
.od-yen-tip { margin: -4px 0 14px; }
/* tự điền từ hội thoại Pancake */
.qk-pk { margin-top: 8px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg-soft); display: grid; gap: 6px; min-width: 0; }
.qk-pk p { margin: 0; }
.qk-pk-h { overflow-wrap: anywhere; }
.qk-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.qk-sug-h { margin-top: 4px !important; font-weight: 600; }
.qk-sug { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); cursor: pointer; min-width: 0; }
.qk-sug:hover { border-color: var(--brand); }
.qk-sug span { color: var(--muted); font-variant-numeric: tabular-nums; }
.qk-sug q { grid-column: 1 / -1; color: var(--muted); font-size: 13px; font-style: italic; overflow-wrap: anywhere; }
.qk-yen-hint q { font-style: italic; color: var(--muted); }
input.qk-auto { background: #fffbe6; border-color: #f0d264; }
/* đơn nhiều dòng */
.qk-lines { display: grid; gap: 6px; }
.qk-lines:not(:empty) { margin-bottom: 8px; }
.qk-line { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--green-soft); min-width: 0; flex-wrap: wrap; }
.qk-line.gift { background: var(--bg-soft); }
.qk-line > b { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.qk-lp { color: var(--muted); font-variant-numeric: tabular-nums; }
.qk-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.qk-qty button { width: 26px; height: 26px; border: 0; background: none; cursor: pointer; font-size: 16.5px; color: var(--text-2); }
.qk-qty em { font-style: normal; min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.qk-gift { display: inline-flex; align-items: center; gap: 4px; font-size: 14.5px; color: var(--text-2); cursor: pointer; }
.qk-go #qk-disc { display: block; max-width: 340px; line-height: 1.35; }
.od-lines td.num, .od-lines th.num { white-space: nowrap; }
.od-dd { display: block; }
/* loại sản phẩm (VAT), bán thêm */
.od-mini-row { display: flex; align-items: center; gap: 8px; }
.od-mini-row .od-mini { flex: 1; min-width: 0; }
.od-mini-row > .btn { flex: none; }
.od-kinds { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pill.kind-sach, .kind-tag.kind-sach { background: var(--blue-soft); color: var(--blue); }
.pill.kind-tron, .kind-tag.kind-tron { background: var(--orange-soft); color: var(--orange); }
.od-parent { margin: 0 0 16px; }
.od-mini-row { border-bottom: 1px solid var(--line); }
.od-mini-row:last-child { border-bottom: 0; }
.od-mini-row .od-mini { border-bottom: 0; }
.qk-parent { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--blue-soft); }
.qk-parent > div { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.qk-line > b .pill { margin-left: 6px; font-weight: 500; }
.kind-tag { font-style: normal; font-size: 12px; font-weight: 500; padding: 1px 6px; border-radius: 4px; margin-left: 6px; }
.qk-warn { margin: 0; color: var(--orange); }
.kind-tag.kind-pos { background: var(--bg-soft-2); color: var(--muted); }
.qk-dd button b small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
#qk-warns:empty { display: none; }
#qk-warns { display: grid; gap: 4px; }
.qk-disc { list-style: none; margin: -6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14.5px; color: var(--text-2); }
.qk-disc:empty { display: none; }
.qk-disc li { display: flex; justify-content: space-between; gap: 12px; }
.qk-disc li span { min-width: 0; }
.qk-disc li b { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qk-disc li.qk-kinds { padding-top: 4px; border-top: 1px dashed var(--line); }
.qk-disc li.qk-dgrp { color: var(--text); font-weight: 600; }
.qk-disc li.qk-dsub { padding-left: 12px; font-size: 13px; color: var(--muted, var(--text-2)); }
.qk-disc li.qk-kinds b { white-space: normal; text-align: right; }

/* ---------- lớp học ---------- */
.lop-lead { margin: -6px 0 14px; }
.lop-new { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; }
.lop-new input { flex: 1 1 260px; }
.lop-new select { flex: 0 0 120px; }
.lop-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.lop-them { position: relative; margin-bottom: 12px; }
.lop-them .input-icon { display: flex; }
.lop-them .input-icon input { width: 100%; }
.lop-mem td { vertical-align: middle; }
.lop-act { white-space: nowrap; width: 1%; }
.lop-act form { display: inline; }
.lop-tt { white-space: nowrap; width: 1%; }
.lop-tt .pill { margin-right: 4px; }
.lop-roi-h { font-size: 13px; font-weight: 600; margin: 18px 0 6px; }
/* đổi trạng thái học viên trong lớp: bảo lưu / chuyển / nghỉ */
.tt-dd { display: inline-block; position: relative; }
.tt-dd > summary { list-style: none; cursor: pointer; }
.tt-dd > summary::-webkit-details-marker { display: none; }
.tt-f { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: min(340px, calc(100vw - 32px)); white-space: normal;
  display: grid; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12); text-align: left; }
.tt-f label { display: grid; gap: 4px; font-size: 13px; }
.tt-f select, .tt-f input[type=date], .tt-f input[name=ly_do] { width: 100%; }
.tt-kieu { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tt-kieu label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.hv-lop-h .tt-dd .tt-f { right: auto; left: 0; }
.lop-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lop-err { margin-bottom: 16px; }
.lop-err ul { margin: 6px 0 10px; padding-left: 18px; }
.lop-form .field.full small { margin-left: 8px; }
.od-lop { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.od-lop-f, .od-hoc form { display: inline-flex; gap: 6px; align-items: center; }
.od-lop-f select { max-width: 240px; }
.od-hoc { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.od-acc { background: var(--bg-soft); border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 8px 12px; white-space: pre-line; font-size: 14.5px; }

@media (max-width: 900px) {
  .lop-grid { grid-template-columns: 1fr; }
}
.qk-online { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--line);
             border-radius: var(--r-sm); background: var(--bg-soft); }
.qk-online input { margin-top: 3px; }
.qk-online small { display: inline; }
.od-dl dd { min-width: 0; overflow-wrap: anywhere; }
.od-hoc form, .od-lop-f { flex-wrap: wrap; }
.lop-grid > * { min-width: 0; }
@media (max-width: 560px) {
  .od-dl { grid-template-columns: 96px minmax(0, 1fr); }
  .lop-form { grid-template-columns: 1fr; }
}

/* ---------- giao diện mới: chỉnh thêm ---------- */
/* nút không gian: xanh nhạt (khác nút đang mở màu đen) */
.tn-i.dark { background: var(--hl); border-color: var(--hl); color: var(--brand-dark); }
.tn-i.dark .ic { color: var(--brand-dark); }
summary.tn-i.dark:hover { background: #bfe2b4; border-color: #bfe2b4; }
.seg a.on *, .seg button.on * { color: inherit !important; opacity: .75; }
.tn-dd:not([open]) > .tn-pop { display: none; }   /* menu đang đóng: không chiếm chỗ (khỏi gây cuộn ngang trên điện thoại) */
@media (max-width: 600px) {
  /* điện thoại: thẻ số 2 cột, thẻ nổi bật đầu tiên trải hết hàng */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis > .kpi:first-child { grid-column: 1 / -1; }
  .kpi { padding: 14px 16px; border-radius: 18px; }
  .kpi span { font-size: 14.5px; }
  .kpi b { font-size: 22px; margin-top: 6px; }
}
.sp-card { border-radius: var(--r); }
.od-amt .btn { height: var(--h); }
.lop-code { font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--hl); border-radius: var(--r-sm);
            padding: 2px 8px; vertical-align: middle; letter-spacing: .02em; white-space: nowrap; }
h1 .lop-code { font-size: 14.5px; }
.lop-room p { margin: 0; overflow-wrap: anywhere; }
.hv-lop { padding: 10px 0; border-top: 1px solid var(--line); }
.hv-lop:first-of-type { border-top: 0; padding-top: 0; }
.hv-lop-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hv-lop-h .grow { flex: 1; }
.hv-dd { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.hv-d { font-size: 12.5px; padding: 3px 8px; border-radius: 999px; background: var(--red-soft); color: var(--red); }
.hv-d.on { background: var(--green-soft); color: var(--green); }
.hv-rec { display: inline-flex; color: var(--brand); margin-left: -3px; }
.lop-wait { background: var(--bg-soft); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 10px; line-height: 1.7; }
.lop-wait b { display: block; }
.lop-wait small:first-of-type { display: block; margin-bottom: 2px; }
.od-lop-st { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.od-lop-f .chk { white-space: nowrap; }
.od-lop-f { max-width: 100%; }
.od-lop-f select { flex: 1 1 200px; min-width: 0; max-width: 100%; }
.od-tay { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: 100%; }
.od-tay input, .od-lop-f input { flex: 1 1 220px; min-width: 0; height: 34px; }
.od-tay-h { flex-basis: 100%; }
/* ---------- thông báo cho nhân viên ---------- */
.tb-banner { background: var(--surface); border: 1px solid var(--orange-soft); border-left: 4px solid var(--orange);
             border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px; }
.tb-h { display: flex; align-items: center; gap: 6px; color: var(--orange); margin-bottom: 6px; }
.tb-h b { color: var(--text); }
.tb-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.tb-row:first-of-type { border-top: 0; }
.tb-row a { flex: 1; min-width: 0; color: var(--text); }
.tb-row a:hover { text-decoration: none; }
.tb-row a:hover b { text-decoration: underline; }
.tb-row a b { display: block; }
.tb-row a small { display: block; color: var(--text-2); overflow-wrap: anywhere; }
.tb-lop_day a b, .tb-bill_sai a b { color: var(--red); }
.tb-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 50%; flex: 0 0 auto; }
.tb-x:hover { background: var(--bg-soft-2); color: var(--text); }
.tb-on { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--hl); border-radius: var(--r);
         padding: 10px 14px; margin-bottom: 14px; font-size: 15px; }
.tb-on span { flex: 1 1 220px; }
.tb-on[hidden] { display: none; }

/* ---------- thanh trên: nút tìm (⌘K), chuông "Việc của tôi", mục "Sắp có" trong menu Khác ---------- */
.tn-find { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 14px; border-radius: 999px; flex: none;
           background: var(--surface); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
.tn-find:hover { background: #fff; border-color: var(--line-2); color: var(--text-2); }
.tn-find .ic { width: 18px; height: 18px; color: var(--text-2); }
.tn-find span { margin-right: 18px; }
kbd { font-family: inherit; font-weight: 600; font-size: 12.5px; line-height: 1; color: var(--text-2); background: var(--bg-soft-2); border: 1px solid var(--line);
      border-radius: 8px; padding: 5px 7px; }
.tn-cnt { position: absolute; top: -3px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
          background: var(--red); color: #fff; font-weight: 700; font-size: 11px; line-height: 20px; font-style: normal; text-align: center;
          box-shadow: 0 0 0 2px var(--bg); }
.tn-cnt[hidden] { display: none; }
.tn-viec[open] > .tn-btn { background: var(--ink); border-color: var(--ink); color: #fff; }
.tn-o.soon { color: var(--muted); cursor: default; }
.tn-o.soon:hover { background: none; }
.tn-o.soon .ic { color: var(--muted); }
.tn-o.soon em { margin-left: auto; padding-left: 14px; font-style: normal; font-size: 11.5px; }

/* danh sách việc trong menu chuông */
.vc-pop { width: 380px; }
.vc-list { max-height: min(440px, calc(100vh - 120px)); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.vc-it { display: flex; align-items: flex-start; gap: 4px; border-radius: 14px; }
.vc-it:hover { background: var(--bg-soft-2); }
.vc-a { flex: 1; min-width: 0; display: flex; gap: 11px; padding: 9px 4px 9px 10px; color: var(--text); }
.vc-a:hover { text-decoration: none; }
.vc-x { flex: none; width: 32px; height: 32px; margin: 8px 6px 0 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
        color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; }
.vc-x .ic { width: 16px; height: 16px; }
.vc-it:hover .vc-x, .vc-x:focus-visible { opacity: 1; }
.vc-x:hover { color: var(--green); border-color: var(--green); }
@media (hover: none) { .vc-x { opacity: 1; } }
.vc-empty { margin: 0; padding: 22px 12px; color: var(--muted); text-align: center; display: flex; gap: 8px; justify-content: center; align-items: center; }

/* hộp tìm chung */
.tk { width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 120px)); margin: 88px auto auto; padding: 0;
      border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
      overflow: hidden; flex-direction: column; }
.tk[open] { display: flex; }
.tk::backdrop { background: rgba(30, 26, 22, .28); backdrop-filter: blur(2px); }
.tk-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.tk-in > .ic { color: var(--muted); }
.tk-in input { flex: 1; height: 60px; border: 0; background: none; font: inherit; font-size: 16px; padding: 0; outline: none; box-shadow: none; }
.tk-in input::-webkit-search-cancel-button { display: none; }
.tk-res { overflow-y: auto; padding: 8px; }
.tk-hint { margin: 0; padding: 18px 12px; color: var(--muted); }
.tk-g + .tk-g { margin-top: 6px; }
.tk-g > b { display: block; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px 4px; }
.tk-it { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 14px; color: var(--text); }
.tk-it:hover { background: var(--bg-soft-2); text-decoration: none; }
.tk-it.on { background: var(--brand-soft); }
.tk-ic { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--bg-soft-2); color: var(--text-2);
         display: inline-flex; align-items: center; justify-content: center; }
.tk-ic .ic { width: 17px; height: 17px; }
.tk-it.on .tk-ic { background: var(--surface); color: var(--brand); }
.tk-t { min-width: 0; display: flex; flex-direction: column; }
.tk-t b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-t small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-a .tk-t b, .vc-a .tk-t small { white-space: normal; }
.tk-t em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

@media (max-width: 1500px) { .tn-find span, .tn-find kbd { display: none; } .tn-find { width: 44px; padding: 0; justify-content: center; } }
@media (max-width: 900px) {
  .tn-find { width: 40px; height: 40px; }
  .tk { margin-top: 12px; max-height: calc(100vh - 24px); }
  .tk-in kbd { display: none; }
}
/* điện thoại: nút cài đặt vào menu tài khoản để thanh trên còn 1 hàng (logo · không gian · tìm · chuông · tài khoản) */
.tn-set-m { display: none; }
.tn-o-n { margin-left: auto; padding-left: 14px; font-style: normal; font-size: 11.5px; color: var(--orange); font-weight: 600; }
@media (max-width: 900px) {
  .tn-set { display: none; }
  .tn-set-m { display: flex; }
  .tn-right { gap: 6px; }
}
@media (min-width: 901px) and (max-width: 1500px) { .tn-i { padding: 0 10px; } .tn-nav { gap: 4px; } }

/* ---------- Chăm sóc khách hàng + hồ sơ học viên ---------- */
.cs-list { list-style: none; margin: 0; padding: 0; }
.cs-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 9px 0; border-top: 1px solid var(--line); }
.cs-list li:first-child { border-top: 0; padding-top: 0; }
.cs-list .grow { flex: 1; }
.cs-new { display: grid; gap: 10px; margin-bottom: 16px; }
.cs-new h2 { margin: 0; }
.cs-new-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cs-new-row .grow { flex: 1; }
.cs-new-row label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cs-pick { position: relative; flex: 1 1 260px; min-width: 0; }
.cs-pick .input-icon { display: flex; }
.cs-pick .input-icon input { width: 100%; }
.cs-pick .qk-dd { top: calc(var(--h) + 6px); }
.cs-new > input, .cs-new > textarea { width: 100%; min-width: 0; }
.cs-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 10px;
  background: var(--brand-soft); border-radius: var(--r-sm); }
.cs-bulk select { min-width: 160px; }
.cs-chk { width: 36px; }
.cs-sub { margin-top: 14px; }
.cs-body { white-space: pre-wrap; }
.cs-f { grid-template-columns: repeat(3, 1fr); }
.act-form textarea { width: 100%; min-width: 0; }
.hs-av { width: 40px; height: 40px; flex: none; }
.hs-giao select { width: 100%; max-width: 220px; }
@media (max-width: 900px) { .cs-f { grid-template-columns: 1fr; } }
.vc-it.late .tk-ic { background: var(--red-soft); color: var(--red); }
.vc-it.late small { color: var(--red); }

/* ---------- form tạo / sửa lớp ---------- */
.lf { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.lf-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lf-main .card h2 { margin-bottom: 16px; }
.lf .field + .field, .lf .field + .lf-row, .lf .lf-row + .field, .lf .lf-row + .lf-row { margin-top: 16px; }
.lf .hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.lf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lf-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lf-row > * { min-width: 0; }
.lf-row .field + .field { margin-top: 0; }
.lf-name { background: var(--hl); border-color: transparent; }
.lf-name label { display: block; font-size: 14.5px; font-weight: 600; color: var(--brand-dark); margin-bottom: 8px; }
.lf-name input { width: 100%; height: 52px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; border-color: transparent; }
.lf-name .hint { color: var(--brand-dark); opacity: .8; }
.lf-name .linkish { color: var(--brand-dark); font-size: 14px; padding: 0; }
/* cấp độ: viên tròn chọn 1 */
.lf-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.lf-pills label { margin: 0; cursor: pointer; position: relative; }
.lf-pills input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.lf-pills span { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2);
                 background: var(--surface); font-weight: 600; font-size: 15.5px; color: var(--text); }
.lf-pills span:hover { border-color: var(--text-2); }
.lf-pills input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.lf-pills input:focus-visible + span { outline: 3px solid var(--brand-ring); }
/* ngày học trong tuần */
.lf-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 520px; }
.lf-days button { height: 44px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; font-weight: 600;
                  color: var(--text-2); cursor: pointer; }
.lf-days button:hover { border-color: var(--text-2); }
.lf-days button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.lf-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lf-quick button { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px dashed var(--line-2); background: none; font: inherit;
                   font-size: 14px; color: var(--text-2); cursor: pointer; }
.lf-quick button:hover { border-style: solid; color: var(--text); }
.lf-quick button.on { border-style: solid; border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.lf-auto { font-style: normal; font-size: 12px; font-weight: 600; color: var(--brand-dark); background: var(--brand-soft); border-radius: 999px;
           padding: 1px 7px; margin-left: 4px; }
.lf-auto.off { color: var(--orange); background: var(--orange-soft); cursor: pointer; }
/* giáo viên */
.lf-gv-find { position: relative; max-width: 520px; }
.lf-dd { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line);
         border-radius: 18px; box-shadow: var(--shadow-pop); padding: 6px; max-height: 340px; overflow-y: auto; }
.lf-dd button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; text-align: left; border: 0;
                background: none; padding: 9px 12px; border-radius: 12px; font: inherit; cursor: pointer; color: var(--text); }
.lf-dd button.on, .lf-dd button:hover { background: var(--brand-soft); }
.lf-dd b { font-weight: 600; } .lf-dd b small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.lf-dd span { color: var(--brand-dark); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.lf-dd p { margin: 8px 12px; }
.lf-empty { display: flex; gap: 10px; align-items: center; margin: 14px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--bg-soft);
            color: var(--muted); }
.lf-empty[hidden] { display: none; }
.lf-gv { margin-top: 14px; border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; background: var(--bg-soft); }
.lf-gv-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lf-gv-h > div:not(.seg) { flex: 1; min-width: 180px; }
.lf-gv-h b { display: block; } .lf-gv-h small { color: var(--muted); font-size: 14px; }
.lf-gv-h .seg button { height: 30px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 14.5px; cursor: pointer; }
.lf-rates { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.lf-rate-h, .lf-rate { display: grid; grid-template-columns: 1.2fr 1.3fr 1fr .9fr 34px; gap: 8px; align-items: center; }
.lf-rate-h span { font-size: 13px; color: var(--muted); font-weight: 500; padding-bottom: 4px; }
.lf-rate + .lf-rate { margin-top: 8px; }
.lf-rate input, .lf-rate select { width: 100%; min-width: 0; }
.lf-rate input[data-k=muc] { text-align: right; font-weight: 600; }
.lf-rate-add { margin-top: 10px; padding: 0; color: var(--brand); text-decoration: none; font-weight: 500; }
/* tóm tắt bên phải */
.lf-side { position: sticky; top: calc(var(--tn-h) + 8px); }
.lf-sum { display: flex; flex-direction: column; gap: 10px; }
.lf-sum-name { font-size: 18px; line-height: 1.35; letter-spacing: -.01em; word-break: break-word; }
.lf-sum dl { display: grid; grid-template-columns: 76px 1fr; gap: 8px 10px; margin: 6px 0 4px; font-size: 15px; }
.lf-sum dt { color: var(--muted); } .lf-sum dd { margin: 0; font-weight: 500; }
.lf-sum dd small { color: var(--muted); font-weight: 400; }
.lf-sum .btn { width: 100%; justify-content: center; }
@media (max-width: 1000px) {
  .lf { grid-template-columns: 1fr; }
  .lf-side { position: static; }
}
@media (max-width: 600px) {
  .lf-row, .lf-row.three { grid-template-columns: 1fr; }
  .lf-row .field + .field { margin-top: 16px; }
  .lf-name input { font-size: 17px; }
  .lf-days { gap: 4px; } .lf-days button { height: 40px; border-radius: 12px; font-size: 14.5px; }
  .lf-rate-h { display: none; }
  .lf-rate { grid-template-columns: 1fr 1fr 34px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .lf-rate > :nth-child(1) { grid-area: 1 / 1; } .lf-rate > :nth-child(2) { grid-area: 1 / 2; } .lf-rate > :nth-child(5) { grid-area: 1 / 3; }
  .lf-rate > :nth-child(3) { grid-area: 2 / 1; } .lf-rate > :nth-child(4) { grid-area: 2 / 2; }
}
.lop-info-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.lop-info-h h2 { margin: 0; }
.lop-info dl { display: grid; grid-template-columns: 92px 1fr; gap: 9px 12px; margin: 0; font-size: 15.5px; }
.lop-info dt { color: var(--muted); } .lop-info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.lop-gv + .lop-gv { margin-top: 6px; }
.lop-tl { display: block; color: var(--text-2); }
@media (max-width: 600px) { .lf-rate input[type=date] { padding: 0 6px; font-size: 14.5px; } }

/* ---------- Đào tạo › Giáo viên ---------- */
.gv-nhap { position: relative; }
.gv-nhap > summary { list-style: none; }
.gv-nhap > summary::-webkit-details-marker { display: none; }
.gv-nhap-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 360px; max-width: calc(100vw - 32px);
               display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-pop); }
.gv-nhap-pop p { margin: 0; }
.gv-loc { flex-wrap: wrap; }
.gv-loc .seg small { opacity: .6; margin-left: 2px; }
.gv-loc .input-icon { flex: 1 1 240px; }
.gv-loc select { width: auto; }
.gv-av { object-fit: cover; padding: 0; }
.pill.gv-pl { background: var(--bg-soft-2); color: var(--text-2); }
.gv-xl { display: inline-flex; min-width: 30px; height: 24px; padding: 0 8px; border-radius: 8px; align-items: center; justify-content: center;
         font-weight: 700; font-size: 14px; background: var(--bg-soft-2); color: var(--text-2); }
.gv-xl.xa { background: var(--hl); color: var(--brand-dark); }
.gv-xl.xa-1, .gv-xl.xa_ { background: var(--brand); color: #fff; }
.gv-xl.xc { background: var(--orange-soft); color: var(--orange); }
.gv-tbl small.pos { color: var(--green); font-weight: 500; }
.gv-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.gv-photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex: none; font-size: 22px; }
.gv-head-t { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.gv-head-t > b { font-size: 22px; letter-spacing: -.01em; }
.gv-head-t > small { color: var(--muted); }
.gv-head-p { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.gv-head-n { display: flex; gap: 10px; }
.gv-head-n > div { background: var(--bg-soft); border-radius: 16px; padding: 10px 16px; text-align: center; min-width: 92px; }
.gv-head-n b { display: block; font-size: 24px; } .gv-head-n small { color: var(--muted); font-size: 13px; }
.gvf textarea { width: 100%; resize: vertical; }
.gv-nghi[hidden] { display: none; }
.lf-pills.multi input:checked + span { background: var(--brand); border-color: var(--brand); }
.gv-luong { display: flex; gap: 6px; }
.gv-luong input { flex: 1; min-width: 0; text-align: right; font-weight: 600; }
.gv-luong select { width: 92px; flex: none; }
.gv-rieng > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gv-rieng > summary::-webkit-details-marker { display: none; }
.gv-rieng > summary h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.gv-rieng > summary h2 .ic { width: 18px; height: 18px; color: var(--muted); }
.gv-rieng[open] > summary { margin-bottom: 16px; }
.gv-note { width: 100%; }
.gv-lops { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.gv-lops h2 { margin-bottom: 6px; }
.gv-lop { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--bg-soft); color: var(--text); }
.gv-lop:hover { background: var(--bg-soft-2); text-decoration: none; }
.gv-lop small { color: var(--muted); font-size: 14px; } .gv-lop .gv-tl { color: var(--text-2); }
.gv-lop .pos { color: var(--green); }
/* màn Quản lý giáo viên (PĐT) — order 28/10: 20 cột, lọc nhiều lựa chọn, tách khối */
.gv-khoi { margin-bottom: 14px; flex-wrap: wrap; } .gv-khoi small { opacity: .6; margin-left: 2px; }
.gv-chua { margin: 0 0 12px; }
.gv-loc2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.gv-loc2 .input-icon { flex: 1 1 240px; }
.ms { position: relative; }
.ms > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: var(--h-sm); padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 14.5px; white-space: nowrap; }
.ms > summary::-webkit-details-marker { display: none; }
.ms > summary b { color: var(--brand); font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.ms > summary .ic { width: 14px; height: 14px; color: var(--muted); }
.ms[open] > summary { border-color: var(--brand); }
.ms-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; max-width: calc(100vw - 32px); max-height: 320px; overflow: auto;
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow-pop); }
.ms-pop .chk { display: flex; align-items: center; gap: 8px; padding: 3px 0; white-space: nowrap; }
.ms-pop input[name=dnq] { margin-top: 4px; }
.gv-ky { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.gv-ky input[type=date] { width: auto; height: var(--h-sm); }
.gv-ql-wrap { max-height: calc(100vh - 260px); overflow: auto; }
.gv-ql { font-size: 14px; }
.gv-ql th { white-space: nowrap; position: sticky; top: 0; z-index: 2; background: var(--surface); }
.gv-ql td { vertical-align: top; }
.gv-ql .gv-sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 210px; box-shadow: 1px 0 0 var(--line); }
.gv-ql th.gv-sticky { z-index: 3; }
.gv-ql .gv-email { white-space: nowrap; }
.gv-ql td { white-space: nowrap; } .gv-ql td.gv-nghi-c, .gv-ql td.gv-sticky { white-space: normal; }
.gv-ql small, .gv-tn small { display: block; }
.gv-nghi-c { min-width: 220px; max-width: 280px; font-size: 13.5px; color: var(--text-2); }
.gv-tn { white-space: nowrap; }
.gv-so { display: inline-block; min-width: 28px; padding: 2px 8px; border-radius: 8px; background: var(--bg-soft); font-weight: 600; text-align: center; }
.gv-so:hover { background: var(--brand-soft); text-decoration: none; }
.gv-dlg { border: 0; border-radius: var(--r); padding: 20px; width: min(860px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); background: var(--surface); color: var(--text); }
.gv-dlg::backdrop { background: rgba(30, 26, 22, .35); }
.gv-dlg form { margin-top: 12px; text-align: right; }
.gvl h2 small { color: var(--muted); font-weight: 400; font-size: 14px; }
.gv-nghi-ls { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 18px; }
.gv-nghi-add .btn + small { margin-left: 6px; }
.gv-nghi-i { padding: 10px 12px; border-radius: 14px; background: var(--bg-soft); font-size: 14.5px; display: flex; flex-direction: column; gap: 2px; }
.gv-nghi-add > summary { list-style: none; } .gv-nghi-add > summary::-webkit-details-marker { display: none; }
.gv-nghi-add[open] { padding: 12px; border: 1px dashed var(--line-2); border-radius: 14px; }
.gv-nghi-add[open] > summary { margin-bottom: 10px; }
.gv-anh-nguon { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.gv-anh-nguon img { width: 120px; height: 150px; object-fit: cover; border-radius: 12px; background: var(--bg-soft); }
.gv-ls { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow: auto; }
.gv-ls-i { font-size: 13.5px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.gv-nhap-loi ul { margin: 6px 0; padding-left: 20px; color: var(--red); }
.gv-nhap-loi h2 { display: flex; align-items: center; gap: 8px; color: var(--red); }
.gv-nhap-ok { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.gv-the-ds { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.gv-the { display: flex; gap: 12px; align-items: flex-start; color: var(--text); padding: 14px 16px; }
.gv-the:hover { text-decoration: none; box-shadow: var(--shadow-pop); }
.gv-the .av { flex: none; }
.gv-the-p { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.gv-dl { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; margin: 0; }
.gv-dl dt { color: var(--muted); } .gv-dl dd { margin: 0; overflow-wrap: anywhere; }
.gv-anh-f { align-items: flex-end; margin-top: 10px; }
@media (max-width: 640px) {
  .gv-dl { grid-template-columns: 1fr; gap: 2px; } .gv-dl dd { margin-bottom: 8px; }
  .gv-the-ds { grid-template-columns: 1fr; }
  .gv-ql .gv-sticky { min-width: 160px; }
}
.lf-gv-h .seg button.on { background: var(--ink); color: #fff; font-weight: 600; }

/* ---------- Đào tạo › Mở lớp ---------- */
.ml-tabs a { gap: 6px; } .ml-tabs .ic { width: 16px; height: 16px; }
.ml-kpi-ic .ic { width: 30px; height: 30px; }
.ml-loc { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.ml-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ml-lb { font-size: 14px; color: var(--muted); font-weight: 500; width: 112px; flex: none; }
.ml-chips button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font: inherit;
                   font-size: 14.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.ml-chips button small { font-weight: 500; opacity: .6; margin-left: 2px; }
.ml-chips button:hover { border-color: var(--text-2); }
.ml-chips button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ml-chips button.ton { border-color: var(--red); color: var(--red); }
.ml-chips button.ton.on { background: var(--red); color: #fff; }
.ml-tb { margin: 0; flex-wrap: wrap; }
.ml-tb select { width: auto; }
.ml-tb .input-icon { flex: 1 1 240px; }
.ml-nhom { margin-bottom: 22px; }
.ml-nhom h2 { margin: 0 0 10px; font-size: 17px; }
.ml-nhom h2 small { color: var(--muted); font-weight: 400; font-size: 14.5px; }
.ml-nhom.ton h2 { color: var(--red); }
.ml-tbl td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
.ml-tbl small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.ml-tbl .pill { margin: 2px 2px 0 0; font-size: 12px; padding: 1px 7px; }
.ml-gv { min-width: 170px; } .ml-gv a { color: var(--text); }
.ml-lop { min-width: 210px; max-width: 280px; font-size: 14.5px; }
.ml-lop > a, .ml-lop > span { color: var(--text); overflow-wrap: anywhere; }
.ml-in { height: 32px; font-size: 14.5px; padding: 0 8px; border-radius: 10px; border-color: var(--line); background: transparent; }
.ml-in:hover { border-color: var(--line-2); background: var(--surface); }
.ml-in[type=date] { width: 124px; }
.ml-lv { width: 76px; margin-top: 6px; padding-right: 24px; background-position: right 6px center; }
.ml-lich { width: 54px; } .ml-gio { width: 64px; }
.ml-note { width: 190px; min-height: 32px; height: 32px; padding: 6px 8px; resize: none; line-height: 1.35; overflow: hidden; }
.ml-tt { width: 146px; font-weight: 600; }
.ml-tt.tt-cho { color: var(--blue); background: var(--blue-soft); border-color: transparent; }
.ml-tt.tt-day_len { color: var(--brand-dark); background: var(--brand-soft); border-color: transparent; }
.ml-tt.tt-da_xep { color: var(--green); }
.ml-tt.tt-tam_chua { color: var(--orange); background: var(--orange-soft); border-color: transparent; }
.ml-tt.tt-ngung, .ml-tt.tt-khong_tinh { color: var(--muted); }
.ml-in.saving { opacity: .5; } .ml-in.saved { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.ml-in.err { border-color: var(--red); }
.ml-check { display: flex; gap: 6px; align-items: center; margin-top: 4px; white-space: nowrap; }
.ml-check .linkish { display: inline-flex; align-items: center; gap: 3px; padding: 0; font-size: 13px; text-decoration: none; }
.ml-check .linkish .ic { width: 14px; height: 14px; }
.ml-check .linkish.saved { color: var(--green); }
.ml-check small { margin: 0; }
tr.can-check { background: #fff8ec; }
.nowrap { white-space: nowrap; }
.ml-them { width: min(520px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 22px; padding: 0; background: var(--surface);
           box-shadow: var(--shadow-pop); color: var(--text); }
.ml-them::backdrop { background: rgba(30, 26, 22, .28); }
.ml-them-f { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.ml-them-f h2 { margin: 0; } .ml-them-f p { margin: 0; }
.ml-them-f .lf-row .field + .field { margin-top: 0; }
.ml-them-f input, .ml-them-f select, .ml-them-f textarea { width: 100%; }
.ml-lg { display: flex; gap: 6px; }
.ml-them-b { display: flex; justify-content: flex-end; gap: 8px; }
/* xoay vòng */
.xv-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; }
.xv-head p { margin: 0; flex: 1; min-width: 280px; }
.xv-m { margin-bottom: 14px; padding: 16px 20px; }
.xv-m > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.xv-m > summary::-webkit-details-marker { display: none; }
.xv-m > summary h2 { margin: 0; }
.xv-m[open] > summary { margin-bottom: 14px; }
.xv-m.nay { border: 2px solid var(--brand); }
.xv-sum { color: var(--text-2); font-size: 15px; }
.xv-tbl tr.xv-kw td { border-top: 2px solid var(--line-2); }
.xv-in { width: 64px; height: 32px; text-align: right; font-weight: 700; padding: 0 8px; border-radius: 10px; border-color: var(--line); background: var(--bg-soft); }
.xv-in.saving { opacity: .5; } .xv-in.err { border-color: var(--red); }
.xv-ton { color: var(--red); font-size: 13px; font-weight: 600; white-space: nowrap; }
.xv-b { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.xv-b.neg { background: var(--red-soft); color: var(--red); } .xv-b.pos { background: var(--green-soft); color: var(--green); }
.xv-dat { display: inline-block; width: 54px; height: 6px; border-radius: 3px; background: var(--bg-soft-2); margin-right: 6px; vertical-align: middle; overflow: hidden; }
.xv-dat i { display: block; height: 100%; background: var(--brand); }
b.pos { color: var(--green); } b.neg { color: var(--red); }
.gv-dung[hidden], .gvf .field[hidden] { display: none; }
.gvf .lf-row .field[hidden] + .field { margin-top: 0; }
.gv-bang { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 18px; padding: 16px 22px; }
.gv-bang > div > b { font-size: 14.5px; color: var(--text-2); }
.gv-bang > p { flex-basis: 100%; margin: 0; }
.gv-bang-t { border-collapse: collapse; margin-top: 6px; font-size: 15px; }
.gv-bang-t th { font-weight: 600; color: var(--muted); font-size: 13px; padding: 2px 12px; text-align: center; }
.gv-bang-t td { padding: 4px 12px; text-align: center; font-weight: 700; } .gv-bang-t td:first-child { text-align: left; font-weight: 500; color: var(--text-2); padding-left: 0; }
.gv-bang-t a, .gv-bang p a { color: var(--text); }
.gv-bang p { margin: 6px 0 0; } .gv-bang-n { font-size: 20px; font-weight: 700; }

/* Đào tạo › Bảng công giáo viên */
.bc-thang a { font-variant-numeric: tabular-nums; }
.bc-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px; }
.bc-t td[rowspan] { vertical-align: top; }
.bc-t tr.bc-first td { border-top: 1px solid var(--line); }
.bc-them { display: grid; gap: 12px; }
.bc-tim .input-icon { width: 280px; max-width: 100%; }
@media (max-width: 720px) { .bc-thang a:not(.on) { padding: 0 10px; } }

/* Giáo viên tự khai (trang công khai /gv/khai/…) */
body.gk { background: var(--bg); }
.gk-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.gk-head { text-align: center; margin-bottom: 18px; }
.gk-head img { width: 44px; height: 44px; }
.gk-head h1 { font-size: 28px; margin: 8px 0 0; }
.gk-steps { display: flex; gap: 10px; list-style: none; padding: 0; margin: 0 0 16px; justify-content: center; flex-wrap: wrap; }
.gk-steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 15px; }
.gk-steps li b { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--bg-soft-2); font-size: 14px; }
.gk-steps li.on { color: var(--text); }
.gk-steps li.on b { background: var(--green); color: #fff; }
.gk-steps li + li::before { content: ""; width: 48px; height: 2px; background: var(--line-2); margin-right: 4px; }
.gk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.gk-card h2 { font-size: 18px; margin: 0 0 8px; }
.gk-card > p { margin: 0 0 10px; color: var(--text-2); }
.gk-req-note i, .gk-l i, .gk-check i { color: var(--red); font-style: normal; }
.gk-f { padding: 16px 0; border-top: 1px solid var(--line); }
.gk-l { display: block; font-weight: 600; margin-bottom: 4px; }
.gk-h { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.gk-ok { color: var(--green); }
.gk-f input[type=text], .gk-f input[type=email], .gk-f input[type=tel], .gk-f input[type=date], .gk-f select, .gk-f textarea { width: 100%; max-width: 100%; }
.gk-f input[type=date] { max-width: 220px; }
.gk-opts { display: grid; gap: 8px; }
.gk-opts label, .gk-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.gk-opts input, .gk-check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--green); }
.gk-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.gk-thumbs img { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.gk-e { color: var(--red); margin: 6px 0 0; font-size: 14px; }
.gk-f.has-err input, .gk-f.has-err select, .gk-f.has-err textarea { border-color: var(--red); }
.gk-top-err, .gk-note { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 12px 16px; margin: 0 0 14px; }
.gk-top-err { color: var(--red); }
.gk-nav { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.gk-msg { text-align: center; }
@media (max-width: 560px) { .gk-card { padding: 18px 16px; } .gk-steps { flex-wrap: nowrap; gap: 6px; } .gk-steps li { font-size: 14px; gap: 6px; } .gk-steps li + li::before { width: 14px; } }

/* Đào tạo › Bản khai giáo viên */
.bk-tao .inline-form { flex-wrap: wrap; }
.bk-ma { width: 190px; }
.bk-loc { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 16px 0; }
.bk-loc .seg { flex-wrap: wrap; }
.bk-link-row { display: flex; gap: 8px; }
.bk-link textarea { width: 100%; }
.bk-link .row { margin-top: 8px; }
.bk-link-row input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: 14px; }
.bk-cb p { display: flex; gap: 8px; margin: 4px 0; color: var(--text); }
.bk-cb .ic { color: var(--red); flex: none; }
.bk-anh { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.bk-anh p { grid-column: 1 / -1; margin: 0; }
.bk-anh img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.bk-xl { display: grid; gap: 10px; }
.bk-xl .row { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-t td:first-child { color: var(--text-2); width: 32%; }
.bk-t tr.bk-sec td { background: var(--bg-soft); font-weight: 600; color: var(--text); }
.bk-t tr.bk-doi td:nth-child(2) { background: var(--orange-soft); }
.bk-t tr.bk-nc td:nth-child(2) { background: var(--red-soft); }
.tbl .row-act { width: 1%; white-space: nowrap; text-align: right; padding-left: 4px; }

/* Lên đơn gọn trong 1 màn hình: khoảng cách nhỏ lại, 3 ô ưu đãi / chiết khấu / tài khoản 1 hàng, thanh "Tạo đơn" luôn hiện ở đáy */
.ld { margin-top: 12px; max-width: 780px; }
.qk { padding: 20px 28px 0; gap: 12px; }
.qk-h { flex-wrap: nowrap; }
.qk-h h1 { font-size: 26px; white-space: nowrap; }
.qk-h > .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.qk-f { gap: 5px; }
.qk-online { margin: 0; padding: 8px 12px; }
.qk-go { position: sticky; bottom: 0; z-index: 5; background: var(--surface); padding: 12px 0 14px; margin-top: 2px; }
.qk-more { margin: 0 0 14px; }
@media (min-width: 700px) { #qk-vnd { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .qk { padding: 16px 16px 0; } .qk-h { flex-wrap: wrap; } .qk-go { padding-bottom: 12px; } }

/* Lên đơn trên màn rộng: 2 cột ngang — trái: hội thoại, khách, khoá; phải: ưu đãi, lớp dự kiến, kích hoạt, tạo đơn */
.qk-c1, .qk-c2 { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 1100px) {
  .ld { max-width: 1240px; }
  .ld .qk { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 28px; row-gap: 12px; align-items: start; }
  .ld .qk > .qk-h, .ld .qk > .qk-parent, .ld .qk > .qk-err { grid-column: 1 / -1; }
  .ld .qk-c2 { position: sticky; top: calc(var(--tn-h) + 8px); padding-left: 28px; border-left: 1px solid var(--line); }
  .ld #qk-vnd { grid-template-columns: 1fr 1fr; }
  .ld .qk-go { position: static; padding-top: 14px; }
}

/* Ô chọn lớp (_lop_chon.html + lop_chon.js): đủ thông tin lớp + thanh sĩ số */
.lp { position: relative; }
.lp .input-icon { position: relative; }
.lp .lp-in { padding-right: 34px; }
.lp-caret { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); cursor: pointer; font-size: 14px; }
.lp-pop { position: absolute; z-index: 40; left: 0; width: 100%; top: calc(100% + 6px); max-height: min(420px, 60vh); overflow-y: auto;
          background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: 0 12px 32px rgba(30, 26, 22, .14); padding: 6px; }
.lp-o { display: grid; grid-template-columns: 1fr 128px; column-gap: 14px; align-items: center; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.lp-o + .lp-o { border-top: 1px solid var(--line); }
.lp-o:hover, .lp-o.on { background: var(--bg-soft); }
.lp-o.off { cursor: not-allowed; opacity: .55; }
.lp-t { grid-column: 1; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.lp-t b { font-variant-numeric: tabular-nums; }
.lp-m { grid-column: 1; color: var(--text-2); font-size: 14px; margin-top: 2px; }
.lp-s { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: 4px; justify-items: end; text-align: right; }
.lp-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--bg-soft-2); overflow: hidden; }
.lp-bar i { display: block; height: 100%; border-radius: 3px; background: var(--green); }
.lp-sub { font-size: 13px; color: var(--muted); }
.lp-s.con .lp-sub { color: var(--green); }
.lp-s.sap .lp-bar i { background: var(--orange); }
.lp-s.sap .lp-sub { color: var(--orange); }
.lp-s.day .lp-bar i { background: var(--red); }
.lp-s.day .lp-sub { color: var(--red); font-weight: 600; }
.lp-none { padding: 12px; color: var(--muted); }
.od-lop-f .lp { flex: 1 1 420px; min-width: min(260px, 100%); max-width: 560px; }
.od-lop > a.pill { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .lp-o { grid-template-columns: 1fr; }
  .lp-s { grid-column: 1; grid-row: auto; grid-template-columns: auto 1fr auto; align-items: center; justify-items: start; text-align: left; margin-top: 6px; gap: 8px; }
}

/* CSKH › Vận hành lớp */
.vh-sub { margin: -6px 0 14px; max-width: 900px; }
.vh-bar { display: inline-block; width: 64px; height: 6px; border-radius: 99px; background: var(--line); vertical-align: middle; overflow: hidden; }
.vh-bar i { display: block; height: 100%; background: var(--orange); border-radius: 99px; }
.vh-bar.full i { background: var(--green); }
.vh-bn { margin-left: 6px; font-variant-numeric: tabular-nums; }
.vh-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.vh-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.vh-dots i.on { background: var(--green); }
.vh-moc { display: flex; align-items: center; gap: 8px; }
.vh-moc .ic { width: 18px; height: 18px; flex: none; }
.vh-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.vh-grid > * { min-width: 0; }
.vh-side { display: grid; gap: 14px; position: sticky; top: calc(var(--tn-h) + 8px); }
.vh-side .card, .vh-main { padding: 18px 20px; }
.vh-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.vh-h h2 { margin: 0; }
.vh-kpi { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-2); }
.vh-loc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.vh-loc [data-loc] { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: inherit; cursor: pointer; color: var(--text-2); }
.vh-loc [data-loc] i { font-style: normal; color: var(--muted); margin-left: 3px; }
.vh-loc [data-loc].on { background: var(--ink); border-color: var(--ink); color: #fff; }
.vh-loc [data-loc].on i { color: #ddd; }
.vh-hv td { padding-top: 9px; padding-bottom: 9px; }
.vh-c { text-align: center; width: 1%; white-space: nowrap; }
.vh-t { display: inline-flex; cursor: pointer; position: relative; }
.vh-t input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vh-t span { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; }
.vh-t input:checked + span { background: var(--green); border-color: var(--green); }
.vh-t input:checked + span::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.vh-t input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.vh-t.saving span { opacity: .5; }
.vh-in { width: 100%; min-width: 120px; height: 34px; }
.vh-in.saving { opacity: .6; } .vh-in.err, .vh-links input.err { border-color: var(--red); }
.vh-dl { display: grid; grid-template-columns: 96px 1fr; gap: 8px 10px; margin: 0 0 12px; }
.vh-dl dt { color: var(--muted); } .vh-dl dd { margin: 0; min-width: 0; }
.vh-dl select { width: 100%; height: 36px; }
.vh-links { display: grid; gap: 8px; }
.vh-links label { display: grid; gap: 4px; font-weight: 600; color: var(--text-2); }
.vh-links input { height: 36px; font-weight: 400; }
.vh-lt { display: grid; gap: 6px; }
.vh-li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.vh-li input { width: 18px; height: 18px; accent-color: var(--green); }
.vh-li span { display: flex; flex-direction: column; }
.vh-tin { width: 100%; resize: vertical; font: inherit; line-height: 1.5; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-soft); }
@media (max-width: 1100px) { .vh-grid { grid-template-columns: 1fr; } .vh-side { position: static; } }
.vh-hv td:first-child { min-width: 220px; }
.vh-hv .vh-in { min-width: 110px; }

/* lên đơn: email học viên, địa chỉ nhận sách (Việt Nam / Nhật) */
.qk-email { margin-top: 8px; }
.qk-dc { display: flex; gap: 10px; align-items: stretch; }
.qk-dc .seg { flex: none; }
.qk-dc input { flex: 1; min-width: 0; }
@media (max-width: 560px) { .qk-dc { flex-direction: column; } }
.od-amt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 10px; }
.od-amt-chips a { font-size: 14px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: inherit; text-decoration: none; }
.od-amt-chips a.on { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.od-sach-f { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.od-sach-f input { flex: 1; min-width: 200px; }
.qk-giao { gap: 8px; }
.qk-g3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.qk-g3 > * { min-width: 0; }
.qk-g3 [hidden] { display: none; }
.qk-them { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; }
.qk-them > summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.qk-them[open] { display: grid; gap: 8px; }
.qk-err { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.qk-trung { display: inline-flex; gap: 14px; align-items: center; }
.od-giao { display: grid; gap: 4px; }
/* màn Giao sách */
.gs-tbl td { vertical-align: top; }
.gs-nhan { min-width: 240px; }
.gs-f { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.gs-f input { width: 150px; }
.gs-act { min-width: 250px; }
/* Đợt chăm sóc (CSKH) */
.dot-intro { max-width: 820px; margin: -4px 0 14px; }
.dot-them { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.dot-them label { display: grid; gap: 4px; font-size: 13px; min-width: 120px; }
.dot-them label.grow { flex: 1 1 240px; }
.dot-them input[name=buoi] { width: 90px; }
.bc-tp { grid-column: 1 / -1; }
.bc-tp-f { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 14px; }
.bc-tp-f .field { flex: 1 1 150px; margin: 0; }
.bc-tp-f .field:nth-last-of-type(1) { flex: 3 1 260px; }
.bc-tien { display: flex; gap: 6px; }
.bc-tien input { flex: 1 1 auto; min-width: 0; }
.bc-tien select { flex: 0 0 84px; }
/* huỷ đơn: việc cần thu hồi */
.od-thu-hoi { margin: 0 0 16px; border-color: #f0c9c0; }
.th-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.th-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.th-list li.xong { opacity: .75; }
.th-t { flex: 1 1 260px; min-width: 0; }
.th-f { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 360px; justify-content: flex-end; }
.th-f input { flex: 1 1 180px; min-width: 0; height: 34px; }
.od-truot { display: inline-block; }
.od-truot > summary { list-style: none; }
.od-truot > summary::-webkit-details-marker { display: none; }
/* CSKH › Xếp lớp */
.xl-loc { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 0 0 14px; }
.xl-loc > label:not(.xl-q) { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.xl-q { flex: 1 1 260px; max-width: 380px; }
.xl-cap { display: flex; flex-wrap: wrap; gap: 4px 12px; border: 0; padding: 0; margin: 0; align-items: center; }
.xl-cap legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 4px; width: 100%; }
.xl-tabs { margin: 0 0 12px; }
.xl-tabs b { margin-left: 4px; font-weight: 600; }
.xl-help { margin: 0 0 12px; max-width: 900px; }
.xl-tbl td { vertical-align: top; }
.xl-tbl td small { display: block; }
.xl-hv { min-width: 170px; }
.xl-note { min-width: 160px; max-width: 240px; }
.xl-nf textarea { width: 100%; min-width: 150px; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); resize: vertical; }
.xl-act { white-space: nowrap; }
.xl-acts { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 6px; }
.xl-dd { display: inline-block; position: relative; }
.xl-dd > summary { list-style: none; }
.xl-dd > summary::-webkit-details-marker { display: none; }
.xl-pop { position: absolute; z-index: 30; width: min(420px, calc(100vw - 32px)); display: grid; gap: 8px; padding: 12px; white-space: normal;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.xl-pop input[name=ly_do], .xl-pop input[name=link_chat] { width: 100%; }
.xl-don { min-width: 200px; max-width: 280px; }
.xl-ns { color: var(--text-2); margin-top: 2px; }
.xl-lop { min-width: 150px; max-width: 220px; }
/* bản khai link chung: chọn hồ sơ để ghép */
.bk-ghep-ds { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 10px 0; }
.bk-ghep-o { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.bk-ghep-o small { color: var(--muted); }
.bk-ghep-o:hover { border-color: var(--brand); }
.bk-ghep-o.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.bk-xn { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.xl-buoi { display: flex; align-items: center; gap: 4px; }
.xl-buoi input { width: 64px; }
.xl-capsel { min-width: 104px; }
/* màn Xếp lớp: mọi ô / nút trong bảng cùng cao 34px, canh mép trên; ô lọc và nút Lọc cùng cao 40px */
.xl-tbl select, .xl-tbl input:not([type=checkbox]):not([type=radio]), .xl-tbl .btn.sm { height: var(--h-sm); font-size: 14px; }
.xl-tbl select { padding-top: 0; padding-bottom: 0; }
.xl-tbl form { margin: 0; }
.xl-nf textarea { display: block; min-height: var(--h-sm); height: var(--h-sm); padding: 6px 10px; line-height: 20px; font-size: 14px; border-color: var(--line-2); }
.xl-nf textarea:focus { height: 76px; }
.xl-loc .btn { height: var(--h); }
.xl-tbl td { padding: 12px 10px; }
.xl-tbl select[name=tt] { width: 158px; }
.xl-tbl .xl-capsel { width: 104px; min-width: 0; }
.xl-don { min-width: 170px; max-width: 230px; }
.xl-note { min-width: 140px; max-width: 200px; }
.xl-hv { min-width: 150px; }
.xl-acts { flex-wrap: wrap; max-width: 252px; }
.xl-nf textarea { min-width: 120px; }
.xl-q { flex: 1 1 200px; min-width: 200px; }
.xl-cap .chk { height: var(--h); }
.xl-cap legend { margin-bottom: 0; line-height: 18px; }
.xl-tbl td.nowrap small, .xl-don-ma { white-space: nowrap; }
.xl-loc .xl-cap { display: grid; gap: 4px; }
.xl-cap > span { font-size: 13px; color: var(--muted); }
.xl-cap-o { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: center; }

/* ---------- Đơn hàng: y màn /backend/invoice (crm/templates/crm/don_hang/danh_sach.html, don_hang.js) ---------- */
.dh-loc { gap: 10px 14px; }
.dh-loc .field { width: 190px; }
.dh-loc .field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-loc .field input, .dh-loc .field select { width: 100%; }
.dh-loc-btn { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dh-bar { gap: 10px; }
.btn.dh-blue { background: var(--blue); }
.btn.dh-blue:hover { background: #2559b0; }
.dh-tbl { font-size: 14px; }
.dh-tbl th, .dh-tbl td { padding: 9px 10px; vertical-align: top; }
.dh-tbl .c { text-align: center; }
.dh-tbl .num, .dh-sale { white-space: nowrap; }
.dh-tbl .pill { font-size: 12.5px; padding: 1px 8px; }
.dh-sp { min-width: 200px; text-align: center; }
.dh-ic .ic { width: 14px; height: 14px; }
.dh-sm { font-size: 13px; }
.dh-b { font-weight: 600; }
.dh-uuid { color: var(--muted); font-variant-numeric: tabular-nums; }
.dh-kh { min-width: 210px; }
.dh-kh a .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.dh-lk { display: flex; gap: 8px; }
.dh-note { color: var(--red); font-weight: 600; cursor: pointer; }
.dh-lv { margin: 0 2px 2px 0; }
.dh-gt { color: var(--blue); }
.dh-no { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--red); cursor: pointer; white-space: nowrap; }
.dh-no:hover { text-decoration: underline; }
.dh-st { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.dh-tg { white-space: nowrap; }
.dh-act { min-width: 250px; }
.dh-act-g { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dh-act form { margin: 0; display: contents; }
.dh-act .btn { width: 100%; padding: 0 8px; font-size: 13.5px; }
.dh-act .dh-wide { grid-column: 1 / -1; }
.dh-act .btn .ic { width: 15px; height: 15px; }
.dh-per select { height: var(--h-sm); }
.dh-dlg { height: min(860px, 92vh); }
.dh-dlg .dlg-b { background: var(--surface); }
.dh-h { font-size: 15.5px; color: var(--brand); margin: 18px 0 10px; }
.dh-h:first-of-type { margin-top: 4px; }
.dh-grid { max-width: none; }
.dh-req { color: var(--red); margin-left: 2px; }
.dh-dlg .err:empty { display: none; }
.dh-dlg .err { color: var(--red); font-size: 14px; margin-top: 4px; }
.dh-books { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.dh-bk { display: grid; grid-template-columns: 1fr 50px 90px 70px var(--h-sm); gap: 6px; align-items: center; font-size: 14px; }
.dh-bk input { height: var(--h-sm); padding: 0 8px; width: 100%; }
.dh-bk-h { color: var(--muted); font-size: 13px; }
.dh-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.dh-2 input, .dh-2 select { width: 100%; }
.dh-ma { display: flex; gap: 6px; }
.dh-ma input { flex: 1; min-width: 0; }
.dh-qua { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.dh-qua .chk { margin-right: 18px; }
.dh-bo { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dh-bo select { flex: 1; }
.dh-days { width: 90px; }
.dh-tt { font-weight: 700; height: var(--h); display: flex; align-items: center; }
.dh-co { font-weight: 600; height: var(--h); display: flex; align-items: center; }
.dh-qr-b { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.dh-qr-b img { width: 280px; max-width: 100%; }
.dh-xn-b { line-height: 2; }
.dh-ls { margin: 0; padding-left: 18px; line-height: 1.7; }
.dh-note-b { font-size: 17px; text-align: center; white-space: pre-wrap; }
.dh-lop { margin-top: 18px; }
.dh-lop .od-lop-f { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.dh-seg { margin-bottom: 14px; }
.dm-tbl input:not([type=checkbox]), .dm-tbl select { height: var(--h-sm); width: 100%; min-width: 90px; }
.dm-tbl .dm-so { min-width: 100px; }
.dm-tbl .dm-sm { min-width: 110px; }
.dm-tbl .dm-id { min-width: 60px; width: 70px; }
.dm-f p { margin-top: 14px; }
/* phiếu thu in */
.hd-body { background: #fff; }
.hd { max-width: 760px; margin: 24px auto; padding: 0 24px; color: #000; }
.hd-logo { height: 54px; }
.hd-t { text-align: center; font-size: 22px; margin: 18px 0; }
.hd-2 { display: flex; justify-content: space-between; gap: 20px; line-height: 2; }
.hd-tbl { width: 100%; border-collapse: collapse; margin-top: 18px; text-align: center; }
.hd-tbl th { background: #eee; padding: 10px; }
.hd-tbl td { padding: 8px; border-bottom: 1px solid #ddd; }
.hd-tbl .num { text-align: right; }
.hd-sum { margin: 10px 0 0 auto; width: 320px; line-height: 1.9; }
.hd-sum div { display: flex; justify-content: space-between; }
.hd-foot { margin-top: 28px; line-height: 1.9; }
.hd-cap { text-transform: capitalize; }
.hd-ky { display: flex; justify-content: space-around; text-align: center; margin: 40px 0; }
.hd-nut { text-align: center; }
@media print { .hd-nut { display: none; } }
@media (max-width: 700px) {
  .dh-loc .field { width: calc(50% - 7px); }
  .dh-bk { grid-template-columns: 1fr 70px 60px var(--h-sm); }
  .dh-bk > span:nth-child(2) { display: none; }
}
.dh-tbl .pos, .dh-xn-b .pos { color: var(--green); }
.page:has(.dh-tbl) { max-width: none; }   /* bảng đơn nhiều cột như backend: dùng hết bề ngang */
.dm-tbl td:first-child input:not([type=hidden]) { min-width: 220px; }
.dm-tbl select[name^="nhom_"] { min-width: 190px; }
/* [LUONG-GV] bắt đầu — Lương Online/Offline, Thưởng/Phạt, Quên điểm danh, cổng giáo viên (/gv/) */
.lg-loc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.lg-loc input, .lg-loc select, .lg-loc .ms > summary { height: var(--h); }
.lg-loc input[list] { width: 250px; }
.lg-loc select { min-width: 140px; }
.lg-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.lg-wrap { max-height: calc(100vh - 290px); overflow: auto; }
.lg-t { font-size: 14px; }
.lg-t th { white-space: nowrap; position: sticky; top: 0; z-index: 2; background: var(--surface); }
.lg-t td { white-space: nowrap; vertical-align: middle; padding: 10px 12px; }
.lg-t td.wrap { white-space: normal; min-width: 160px; }
.lg-t .btn.sm, .lg-t input:not([type=checkbox]), .lg-t select { height: var(--h-sm); }
.lg-t form { margin: 0; }
.lg-tip { cursor: help; border-bottom: 1px dotted var(--muted); }
.lg-so { height: var(--h-sm); }
.lg-tl { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lg-tl li { display: flex; gap: 10px; align-items: center; }
.lg-tl small { color: var(--muted); }
.lg-dem { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; }
.lg-form, .dlg form.lg-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; align-items: end;
  margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-soft); }
.lg-form .btn { height: var(--h); }
.lg-form p { grid-column: 1 / -1; margin: 0; }
.lg-msg { margin: 12px 22px 0; }
.dlg-b > .field { margin-bottom: 12px; }
tr.lg-tinh td { background: var(--green-soft); }
.gv-tabs { margin-bottom: 14px; }
/* [LUONG-GV] hết */

/* [LOP-BE] lớp học y backend: Quản lý nhóm cộng đồng, thành viên nhóm, popup Lớp của đơn, xếp lớp tiếp */
.lh-loc .lh-pick { position: relative; }
.lh-pick > summary { list-style: none; cursor: pointer; height: var(--h); display: flex; align-items: center; padding: 0 30px 0 13px;
                     border: 1px solid var(--line-2); border-radius: var(--r-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                     background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d848e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.5 9.5 5.5 5.5 5.5-5.5'/%3E%3C/svg%3E") no-repeat right 10px center / 15px; }
.lh-pick > summary::-webkit-details-marker { display: none; }
.lh-pick .ch-pop { left: 0; right: auto; max-height: 320px; overflow-y: auto; }
.lh-ck { display: flex; align-items: center; gap: 18px; height: var(--h); }
.lh-tbl td { vertical-align: middle; }
.lh-ten { min-width: 220px; }
.lh-st { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.lh-st select { height: var(--h-sm); padding: 0 10px; font-size: 14px; min-width: 130px; }
.lh-note { display: inline-block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--red); font-weight: 600; }
.lh-tbl .pos { color: var(--green); }
.lh-menu { position: relative; display: inline-block; }
.lh-menu > summary { list-style: none; margin: 0 auto; }
.lh-menu > summary::-webkit-details-marker { display: none; }
.lh-menu-b { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 250px; background: var(--surface); border: 1px solid var(--line);
             border-radius: var(--r-sm); box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column; text-align: left; }
.lh-menu-b a, .lh-menu-b button { display: flex; align-items: center; gap: 8px; height: var(--h-sm); padding: 0 10px; border: 0; background: none;
                                   font: inherit; font-size: 14.5px; color: var(--text); border-radius: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.lh-menu-b a:hover, .lh-menu-b button:hover { background: var(--bg-soft); }
.lh-menu-b .neg { color: var(--red); }
.lh-menu-b .ic { width: 16px; height: 16px; }
/* trang thành viên */
.lh-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -8px 0 14px; align-items: center; }
.lh-link { display: inline-flex; align-items: center; gap: 8px; }
button.pill { border: 0; cursor: pointer; font: inherit; font-size: 13px; }
.lh-vd { margin-bottom: 14px; padding: 12px 16px; }
.lh-vd > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lh-vd-b { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.lh-vd-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.lh-vd-f > label:first-child { min-width: 170px; color: var(--muted); font-size: 14px; }
.lh-vd-f input { height: var(--h-sm); }
.lh-vd-f input[name=skip_dates] { width: 260px; }
.lh-tv-loc input[name=textSearch] { width: 200px; }
.lh-tv-loc select { min-width: 170px; }
.lh-them { position: relative; width: 320px; max-width: 100%; }
.lh-them .input-icon { display: flex; } .lh-them input { width: 100%; }
.lh-them .qk-dd { top: calc(100% + 4px); }
.lh-tv-tbl td { vertical-align: middle; }
.lh-edit { border: 0; background: none; font: inherit; cursor: pointer; color: var(--blue); padding: 0; text-align: left; }
.lh-edit:hover { text-decoration: underline; }
.lh-ghi { min-width: 220px; } .lh-ghi > div + div { margin-top: 4px; }
.lh-act { white-space: nowrap; }
.lh-act form { display: inline; margin: 0; }
/* form lớp */
.lf-gen { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; color: var(--brand-dark); font-weight: 600; }
.lf-gen[hidden] { display: none; }
.lf-chk { height: var(--h); }
.lf-sec { margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.lf-gv .lf-rate-h, .lf-gv .lf-rate { grid-template-columns: 1.15fr 1.2fr .9fr .8fr 1fr 34px; }
.lf-gv .lf-rate-h.lf-hist, .lf-gv .lf-rate.lf-hist { grid-template-columns: 1fr 1.1fr .8fr .7fr .9fr 1fr 34px; font-size: 14px; }
.lf-rate.lf-hist > span { min-height: var(--h-sm); display: flex; align-items: center; }
.lf-rate.lf-x > span { text-decoration: line-through; color: var(--muted); }
.lf-gv .btn.lf-rate-add { margin-top: 10px; padding: 0 12px; }
.lf-side .err { color: var(--red); font-size: 14px; margin: 0; }
/* popup Lớp của đơn */
.lh-pop h3 { font-size: 15.5px; margin: 6px 0 8px; }
.lh-g { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 6px; }
.lh-g-t { flex: 1; min-width: 0; font-size: 14.5px; }
.lh-g-a { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lh-g-a .btn { white-space: nowrap; }
.lh-pop-tim { display: flex; gap: 10px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.lh-pop-tim input[type=search] { flex: 1 1 260px; height: var(--h); }
.lh-pop-tim .chk { height: var(--h); }
.dh-lv { border: 0; cursor: pointer; font: inherit; }
.dh-lop-chon { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; margin-top: 6px; }
.dh-lop-chon .lh-g { margin: 0; }
/* [LOP-BE] hết */
.tt-f.lh-menu-b { position: absolute; }
.tt-f.lh-menu-b form { margin: 0; }
.tt-f.lh-menu-b button { width: 100%; }
.tt-chuyen { display: flex; gap: 6px; align-items: center; padding: 2px 4px; }
.tt-chuyen input { height: var(--h-sm); width: 130px; }
.tt-chuyen button { width: auto !important; }
.dh-lop-chon .lh-g { cursor: pointer; user-select: none; }
.dh-lop-chon .lh-g.on { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.xl-be-f { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14.5px; }
.xl-be-f select { min-width: 220px; }
.xl-be-act { white-space: nowrap; }
.xl-be-act .btn + .btn { margin-left: 6px; }
.xl-so { width: 90px; }
/* CSKH 30/10: màn Xếp lớp y backend thêm ô tìm, lọc nhiều cấp, Note CS, trạng thái */
.xl-be { flex-wrap: wrap; row-gap: 8px; }
.xl-be .xl-be-q { flex: 1 1 240px; max-width: 320px; }
.xl-be .xl-be-f select { min-width: 170px; }
.xl-be-cap { display: inline-flex; align-items: center; gap: 0 12px; }
.xl-be-cap .chk { height: var(--h); white-space: nowrap; }
.xl-be-note textarea { width: 100%; min-width: 160px; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); resize: vertical; }
.xl-be-tbl td select { min-width: 150px; }
.xl-be-act .xl-dd { margin-left: 6px; text-align: left; }
.lh-loc .dh-loc-btn .icon-btn { width: var(--h); height: var(--h); border: 1px solid var(--line-2); }
.lh-tbl th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.lh-tbl th, .lh-tbl td { padding-left: 7px; padding-right: 7px; }
.lh-tbl .lh-ten { min-width: 170px; }
.lh-tbl .dh-tg { white-space: nowrap; }
.lh-tbl .lh-note { max-width: 90px; }
.lh-st select { min-width: 0; width: 124px; }
.lh-tbl { font-size: 13.5px; }
.lh-tbl .pill { font-size: 12.5px; }
.lh-tbl .lh-st select { font-size: 13.5px; width: 116px; padding: 0 8px; }
.lh-tbl th, .lh-tbl td { padding-left: 6px; padding-right: 6px; }
.lh-tbl .lh-ten { min-width: 150px; }
.lh-tbl .lh-st select { width: 122px; }
.lh-tbl td.dh-tg { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.lh-tbl .lh-note { max-width: 70px; }
.dh-no.lh-vh { color: var(--blue); }
.lf-days { max-width: 660px; } .lf-days button { white-space: nowrap; }
.xl-be-tbl td { vertical-align: middle; }
.dlg form.xl-gy-loc { flex-direction: row; flex-wrap: wrap; align-items: center; flex: 0 0 auto; }
.xl-gy-loc .input-icon { flex: 1 1 260px; max-width: 360px; }
.xl-gy-tbl { font-size: 13.5px; }
.xl-gy-tbl th, .xl-gy-tbl td { padding-left: 7px; padding-right: 7px; }
.xl-gy-tbl th { white-space: normal; line-height: 1.25; }
.xl-gy-tbl td form { display: block; }
.xl-gy-tbl .btn { white-space: nowrap; }

/* [CSKH-BE] CSKH y backend: Users management, Đợt chăm sóc (danh sách cấp / lớp / tick từng học viên) */
.um-loc .field { width: 180px; }
.cs-loc .field { width: 200px; }
.um-loc .lh-pick > summary { height: var(--h); }
.um-th { padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
         display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.um-th-r { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.um-tbl td { vertical-align: middle; }
.um-tbl th { white-space: nowrap; }
.um-ten, .um-lop { min-width: 150px; }
.um-email { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-chuoi { display: inline-flex; vertical-align: middle; margin-left: 4px; color: var(--red); }
.um-chuoi .ic { width: 16px; height: 16px; }
.um-pg { position: relative; width: 96px; height: 18px; border-radius: 999px; background: var(--bg-soft-2); overflow: hidden; }
.um-pg span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.um-pg.x span { background: var(--green); } .um-pg.c span { background: var(--orange); } .um-pg.d span { background: var(--red); }
.um-pg b { position: relative; display: block; text-align: center; font-size: 12px; line-height: 18px; color: var(--text); }
.um-act { display: flex; align-items: center; justify-content: center; gap: 2px; }
.um-act form { display: contents; }
.um-loc .dh-loc-btn .icon-btn { width: var(--h); height: var(--h); border: 1px solid var(--line-2); background: var(--surface); }
.um-tbl .um-so { color: var(--blue); }
.um-chuoi-hv { margin: 0 0 12px; line-height: 1.6; }
.cs-cap { display: grid; gap: 10px; max-width: 720px; }
.cs-cap-i { display: flex; align-items: center; height: 56px; padding: 0 18px; border: 1px solid var(--line); border-radius: var(--r-sm);
            background: var(--surface); color: var(--text); font-weight: 600; }
.cs-cap-i:hover { background: var(--bg-soft); text-decoration: none; }
.cs-loc { justify-content: flex-start; }
.cs-loc-r { margin-left: auto; }
.cs-loi { margin: 0 0 12px; }
.cs-the-ds { display: grid; gap: 10px; }
.cs-the { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); }
.cs-the:hover { background: var(--bg-soft); text-decoration: none; }
.cs-the-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cs-the-r { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 8px; font-size: 13px; font-style: italic; color: var(--text-2); }
.cs-ok { display: inline-flex; vertical-align: middle; margin-left: 4px; color: var(--green); }
.cs-ok .ic { width: 15px; height: 15px; }
.cs-radio { display: flex; flex-wrap: wrap; gap: 18px; min-height: var(--h); align-items: center; }
.cs-hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0 14px; }
.cs-dot-r { display: grid; grid-template-columns: 70px 160px auto var(--h-sm); gap: 8px; align-items: center; margin-bottom: 8px; }
.cs-dot-r label { font-size: 14.5px; color: var(--text-2); }
.cs-nut { gap: 6px; }
.cs-dd th, .cs-dd td { white-space: nowrap; }
.cs-dd .cs-ten { min-width: 170px; }
.cs-dd .cs-note { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.cs-dd .cs-dot-c { background: var(--orange-soft); color: var(--orange); }
.cs-dd .cs-o { width: 44px; padding-left: 4px; padding-right: 4px; }
.cs-dd .cs-o .ic { width: 16px; height: 16px; }
.cs-dd td { vertical-align: middle; }
.cs-dd .cs-o.co { color: var(--green); } .cs-dd .cs-o.vang { color: var(--red); }
.cs-ic { display: flex; gap: 2px; flex-wrap: nowrap; }
.cs-t { width: 24px; height: 24px; border: 0; padding: 0; background: none; color: #9aa0a6; cursor: pointer; display: inline-flex;
        align-items: center; justify-content: center; border-radius: 6px; }
.cs-t .ic { width: 16px; height: 16px; }
.cs-t.on { color: #fd6a7e; }
.cs-t:hover { background: var(--bg-soft-2); }
.cs-ngay td { background: var(--bg-soft); }
.cs-dd .cs-o.dcs { background: var(--orange-soft); }
.cs-dot-r .icon-btn { width: var(--h); height: var(--h); }
.cs-radio label.chk { display: inline-flex; margin: 0; font-weight: 400; }
.cs-radio input[type=radio] { width: auto; margin: 0; }

/* [OFFLINE] bắt đầu — lớp offline (dao_tao/lop_off*.html) */
.off-tbl .off-ten { min-width: 200px; }
.off-tbl .off-gv { min-width: 120px; }
.off-tbl td:nth-child(6) { min-width: 80px; }
.off-tbl .lh-st select { min-width: 200px; }
.off-note { all: unset; cursor: pointer; display: block; max-width: 240px; min-width: 160px; color: var(--text); word-break: break-word; }
.off-note:hover { color: var(--brand); }
.off-note:focus-visible { outline: 3px solid var(--brand-ring); border-radius: 6px; }
.off-hv-tbl .off-tt { min-width: 470px; }
.off-hv-tbl .off-tt .btn { margin: 3px 0; }
.off-hv-tbl tr.off-no td { background: var(--red-soft); }
.off-hv-tbl .off-ghi { min-width: 150px; }
.off-hv-tbl .off-ghi .btn { margin-top: 4px; }
.off-info p { margin: 6px 0; }
.off-dd .tbl tr.on td { background: var(--brand-soft); }
.off-dd-ct { margin-top: 16px; }
.off-dd-ct h2 + .tbl-wrap { margin-bottom: 16px; }
.off-dd-st { height: var(--h-sm); min-width: 120px; }
.off-hd-tbl th { min-width: 96px; }
/* invoice-list: 4 cột đầu cố định (ID 90 · Tên 160 · Điện thoại 150 · Email 220), tiêu đề cột 95% / 85% tô màu */
.off-hd-tbl tr > :nth-child(-n+4) { position: sticky; z-index: 1; background: var(--surface); }
.off-hd-tbl tr > :nth-child(1) { left: 0; min-width: 90px; max-width: 90px; }
.off-hd-tbl tr > :nth-child(2) { left: 90px; min-width: 160px; max-width: 160px; }
.off-hd-tbl tr > :nth-child(3) { left: 250px; min-width: 150px; max-width: 150px; }
.off-hd-tbl tr > :nth-child(4) { left: 400px; min-width: 220px; max-width: 220px; box-shadow: 1px 0 0 var(--line); }
.off-hd-tbl th:nth-child(-n+4) { z-index: 2; background: var(--bg-soft); white-space: normal; }
.off-hd-tbl th.off-c95 { background: #f4c7c3; color: #000; }
.off-hd-tbl th.off-c85 { background: #ffff00; color: #000; }
.off-thang { margin-top: 14px; }
.off-thang .lh-pick { position: relative; }
.off-thang .ch-pop { display: grid; grid-template-columns: repeat(4, minmax(96px, 1fr)); gap: 4px 12px; }
.off-no-tbl .off-no-tt { min-width: 220px; }
.off-no-tbl .off-no-tt > div { margin-bottom: 2px; }
.off-no-tbl .off-no-lop { min-width: 260px; font-size: 13.5px; }
.off-no-tbl .off-no-lop > div + div { margin-top: 4px; }
.tt-tong { margin: 4px 0 6px; font-size: 16px; }
.tt-tong p { margin: 4px 0; }
.tt-h { font-size: 16px; margin: 20px 0 8px; }
.off-nd-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
/* [OFFLINE] hết */
/* [QUYEN] Quản lý admin + Phân quyền menu (y backend) */
.qa-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.qa-head .st-h { margin: 0 auto 0 0; }
.qa-act { white-space: nowrap; }
.qa-act form { display: inline; }
.qa-forms { margin-top: 18px; }
.qa-forms label { display: grid; gap: 4px; font-size: 14px; }
.qa-forms input, .qa-forms select { height: var(--h); }
.qa-ghi { margin: 10px 0; padding-left: 18px; }
.tbl tr.off td { opacity: .55; }
.mp-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.mp-wrap > * { min-width: 0; }
.mp-list { padding: 10px; max-height: 70vh; overflow-y: auto; }
.mp-find input { width: 100%; height: var(--h); margin-bottom: 8px; }
.mp-admin { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.mp-admin:hover, .mp-admin.on { background: var(--bg-soft); }
.mp-admin .mp-n { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.mp-tool { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mp-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.mp-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.mp-tab { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px 10px; margin: 0; display: grid; gap: 5px; }
.mp-tab legend { font-weight: 600; padding: 0 4px; }
.mp-tab.erp { border-color: var(--blue); }
.mp-tab label.muted { opacity: .6; }
@media (max-width: 760px) { .mp-wrap { grid-template-columns: 1fr; } }

/* Đợt chăm sóc ở trang lớp: dòng chuyển lớp / bảo lưu tô xám (CLS:1076-1083); thông báo nhỏ sau khi tick */
.cs-dd tr.cs-mo > td, tr.cs-mo > td { background: var(--bg-soft); color: var(--muted); }
.cs-bao { position: fixed; right: 16px; bottom: 16px; z-index: 50; margin: 0; box-shadow: var(--shadow-pop); }

/* [TINH-NANG-LON] ảnh lớp (danh sách + form), nút Thêm của popup Lớp, đăng nhập thay GV, trang đối soát nhập lương */
.lh-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; float: left; }
.lh-add { display: contents; }
.lf-anh input[type=file] { height: var(--h); padding: 7px 10px; }
.lf-anh-cu { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.lf-anh-cu img { width: 64px; height: 64px; border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--line); }
.lg-ten { display: flex; align-items: center; gap: 4px; justify-content: space-between; }
.lg-ten form { margin: 0; }
.dnt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dnt form { margin: 0 0 0 auto; }
.nl-tong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.nl-tong form { margin: 0 0 0 auto; }
.nl-wrap { max-height: 70vh; }
.nl-t td.wrap { white-space: normal; min-width: 180px; }
.nl-cuoi { display: flex; justify-content: flex-end; margin-top: 14px; }

/* [NHOM-DT] menu Đào tạo: mỗi mục 1 icon riêng trong ô màu (anh Nghĩa 11/11) */
.tn-mau { gap: 12px; padding: 7px 12px; }
.tn-ico { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.tn-o .tn-ico .ic { width: 17px; height: 17px; color: inherit; }
.tn-ico.xanh { background: #e3edff; color: #2f6fe4; }   .tn-ico.cham { background: #ebe9ff; color: #5b4fd6; }
.tn-ico.ngoc { background: #dcf5f1; color: #0f8c7a; }   .tn-ico.cam { background: #ffecd9; color: #d96a0b; }
.tn-ico.do { background: #fde6e4; color: #d23b2c; }     .tn-ico.la { background: #e2f4e5; color: #23893a; }
.tn-ico.troi { background: #dff3fc; color: #0b84b8; }   .tn-ico.tim { background: #f3e6fb; color: #9234c4; }
.tn-ico.vang { background: #fff3cf; color: #b07d00; }   .tn-ico.xam { background: #eceff1; color: #546e7a; }
.tn-o .tn-ra { width: 14px; height: 14px; margin-left: auto; padding-left: 0; color: var(--muted); opacity: .7; }
.tn-mau:hover .tn-ico { filter: saturate(1.3) brightness(.97); }
.tn-pop-sep { display: block; height: 1px; background: var(--line); margin: 5px 10px; }

/* [GOP-Y] nút Góp ý cạnh phải mọi trang + hộp thoại gọn */
.gy-nut{position:fixed;right:0;top:50%;transform:translateY(-50%);z-index:40;padding:12px 7px;border:1px solid var(--line-2);border-right:0;border-radius:10px 0 0 10px;background:var(--surface);color:var(--text-2);font:inherit;font-size:13px;font-weight:600;cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,.08);display:flex;flex-direction:column;align-items:center;gap:6px}
.gy-nut span{writing-mode:vertical-rl}
.gy-nut:hover,.gy-nut:focus-visible{color:var(--brand);border-color:var(--brand)}
.gy-nut.co{color:var(--red);border-color:#f2c9c9}
.gy-so{font-style:normal;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--red);color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center}
.gy-so[hidden]{display:none}
@media print{.gy-nut{display:none}}
.gy-dlg{border:0;border-radius:16px;padding:0;width:min(440px,calc(100vw - 32px));box-shadow:0 12px 40px rgba(0,0,0,.25);background:var(--surface);color:var(--text)}
.gy-dlg::backdrop{background:rgba(0,0,0,.25)}
.gy-in{padding:16px;display:flex;flex-direction:column;gap:12px}
.gy-in[hidden]{display:none}
.gy-dh{display:flex;align-items:center;justify-content:space-between}
.gy-x{border:0;background:none;font-size:24px;line-height:1;cursor:pointer;color:var(--muted);padding:0 4px}
.gy-loai{display:flex;gap:6px}
.gy-loai label{cursor:pointer}.gy-loai input{position:absolute;opacity:0;pointer-events:none}
.gy-loai span{display:inline-block;padding:6px 14px;border:1px solid var(--line-2);border-radius:20px;font-size:14px;font-weight:600;color:var(--text-2)}
.gy-loai input:checked+span{background:var(--brand-soft);border-color:var(--brand);color:var(--brand)}
.gy-loai input[value=loi]:checked+span{background:var(--red-soft);border-color:var(--red);color:var(--red)}
.gy-loai input:focus-visible+span{outline:2px solid var(--brand)}
.gy-o{border:1px solid var(--line-2);border-radius:12px;background:var(--surface);padding:2px 2px 8px}
.gy-o:focus-within{border-color:var(--brand)}
.gy-o textarea{display:block;width:100%;border:0;outline:0;padding:10px 12px;font:inherit;font-size:15px;background:none;color:inherit;resize:vertical;min-height:84px}
.gy-anh-ds{display:flex;gap:8px;flex-wrap:wrap;padding:0 10px 6px}.gy-anh-ds:empty{display:none}
.gy-anh-ds span{position:relative}.gy-anh-ds img{height:56px;max-width:100px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.gy-anh-ds button{position:absolute;top:-6px;right:-6px;width:20px;height:20px;border-radius:50%;border:0;background:var(--text-2);color:#fff;cursor:pointer;line-height:1}
.gy-them-anh{display:inline-flex;align-items:center;gap:6px;margin-left:10px;padding:4px 10px;border-radius:8px;color:var(--muted);font-size:13px;cursor:pointer}
.gy-them-anh:hover{background:var(--bg-soft);color:var(--text-2)}.gy-them-anh .ic{width:16px;height:16px}
.gy-them-anh[hidden]{display:none}
.gy-cu{font-size:13px;color:var(--text-2);display:flex;flex-direction:column;gap:2px}.gy-cu a{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gy-cu[hidden]{display:none}
.gy-bt{display:flex;align-items:center;gap:10px}.gy-bt .gy-kq{flex:1;font-size:13px;color:var(--muted);text-align:right}
.gy-cua-toi{font-size:13px;color:var(--muted);display:inline-flex;align-items:center;gap:5px}
.gy-xong{padding:28px 20px;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.gy-xong[hidden]{display:none}
.gy-xong .ic{width:40px;height:40px;color:var(--brand);background:var(--brand-soft);border-radius:50%;padding:8px}
.gy-xong b{font-size:17px}.gy-xong span{color:var(--muted);font-size:14px}
