/* Dak Court — giao diện theo DAKLAB OS v5 (biến lấy từ AI-BOSS/os_web/tinh/os.css).
   Màu trạng thái theo LUAT-MAU-DAKLAB: xanh dương ↔ cam, lỗi đỏ rượu, luôn có dấu + chữ. */
:root {
  --page: #dfe0e3; --frame: #ebebed; --surface: #f6f6f7; --surface-2: #eeeef0; --surface-3: #e4e4e7;
  --line: #e2e2e5; --line-strong: #d3d3d8; --fg: #17181b; --muted: #61646c; --faint: #8b8e95;
  --ink: #17181b; --ink-fg: #f6f6f7;
  --cam: #a8410f; --cam-weak: #fde8dd; --cam-line: #f3c2a6;
  --accent: #2459d6; --accent-fg: #fff; --accent-weak: #e3eafa; --accent-line: #c3d3f7;
  --bad: #a01d3e; --bad-weak: #f8e3e9;
  --nau: #C96A3F;
  --shadow: inset 0 1px 0 rgba(255,255,255,1), 0 1px 2px rgba(17,19,24,.07), 0 4px 8px -2px rgba(17,19,24,.06), 0 14px 28px -10px rgba(17,19,24,.16);
  --shadow-o: inset 0 1px 0 rgba(255,255,255,.7), 0 1px 2px rgba(17,19,24,.05), 0 6px 14px -8px rgba(17,19,24,.14);
  --shadow-lg: 0 24px 60px rgba(17,19,24,.22), 0 4px 12px rgba(17,19,24,.08);
  --noi: linear-gradient(180deg, #fdfdfd 0%, #f5f5f7 100%);
  --r: 24px; --r-sm: 16px; --pill: 999px; --ease: cubic-bezier(.22,1,.36,1);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --soc: repeating-linear-gradient(-45deg, var(--cam-weak) 0 6px, #fff4ec 6px 12px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --page: #050506; --frame: #0e0f11; --surface: #17181b; --surface-2: #1e1f23; --surface-3: #27292e;
  --line: #24262a; --line-strong: #33363c; --fg: #ececee; --muted: #a3a6ad; --faint: #7d8087; --ink: #ececee; --ink-fg: #141518;
  --cam: #ff8a52; --cam-weak: #3a1e12; --cam-line: #6b3a20; --accent: #7ba5ff; --accent-fg: #0b1220; --accent-weak: #18233a; --accent-line: #2b4472;
  --bad: #f3809a; --bad-weak: #2c1820;
  --shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.5), 0 12px 28px -14px rgba(0,0,0,.8);
  --shadow-o: inset 0 1px 0 rgba(255,255,255,.04), 0 6px 14px -8px rgba(0,0,0,.7); --shadow-lg: 0 24px 60px rgba(0,0,0,.7);
  --noi: linear-gradient(180deg, #1c1d21 0%, #16171a 100%);
  --soc: repeating-linear-gradient(-45deg, #3a1e12 0 6px, #2a160d 6px 12px);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --page: #050506; --frame: #0e0f11; --surface: #17181b; --surface-2: #1e1f23; --surface-3: #27292e;
  --line: #24262a; --line-strong: #33363c; --fg: #ececee; --muted: #a3a6ad; --faint: #7d8087; --ink: #ececee; --ink-fg: #141518;
  --cam: #ff8a52; --cam-weak: #3a1e12; --cam-line: #6b3a20; --accent: #7ba5ff; --accent-fg: #0b1220; --accent-weak: #18233a; --accent-line: #2b4472;
  --bad: #f3809a; --bad-weak: #2c1820;
  --shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.5), 0 12px 28px -14px rgba(0,0,0,.8);
  --shadow-o: inset 0 1px 0 rgba(255,255,255,.04), 0 6px 14px -8px rgba(0,0,0,.7); --shadow-lg: 0 24px 60px rgba(0,0,0,.7);
  --noi: linear-gradient(180deg, #1c1d21 0%, #16171a 100%);
  --soc: repeating-linear-gradient(-45deg, #3a1e12 0 6px, #2a160d 6px 12px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body { margin: 0; background: var(--page); color: var(--fg); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15.5px; }
[hidden] { display: none !important; }
.phu { color: var(--muted); } .nho { font-size: 13px; } .so { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- khung app ---------- */
.app { min-height: 100dvh; padding: max(10px, env(safe-area-inset-top)) 10px calc(96px + env(safe-area-inset-bottom)); }
.khung { background: var(--frame); border-radius: 30px; min-height: calc(100dvh - 20px); padding: 12px 12px 24px; max-width: 1180px; margin: 0 auto; }
.dau { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 2px 0 10px;
  background: linear-gradient(var(--frame) 75%, transparent); }
.vien { background: var(--surface) var(--noi); border: 1px solid var(--line); border-radius: var(--pill); box-shadow: var(--shadow); display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 0 6px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; padding: 0 12px 0 4px; min-width: 0; text-decoration: none; color: var(--fg); }
.logo i { width: 36px; height: 36px; border-radius: 12px; background: var(--ink); color: var(--ink-fg); display: grid; place-items: center; flex: none; }
.logo b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; min-width: 0; }
.dau .day { flex: 1; min-width: 0; }
.dau .vien { min-width: 0; flex-shrink: 1; }
@media (max-width: 480px) { .dau .vien .nut.nho { padding: 0 12px; } .logo { padding-right: 8px; } .logo b { max-width: 48vw; } .dau #doi-nen, .dau .an-dt { display: none; } }
.nut-tron { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--fg); }
.nut-tron:hover { background: var(--surface-2); }

.dieu-huong { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; gap: 2px; padding: 5px; border-radius: var(--pill); background: var(--surface) var(--noi); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  transition: transform .35s var(--ease), opacity .25s; max-width: calc(100vw - 20px); }
.dieu-huong a { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 56px; padding: 7px 7px 5px; border-radius: var(--pill);
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; white-space: nowrap; }
.dieu-huong a svg { width: 21px; height: 21px; }
.dieu-huong a[aria-current="page"] { background: var(--ink); color: var(--ink-fg); }
/* Bàn phím bật thì giấu thanh dưới (góp ý anh Út 22/10/2026) */
body.go-chu .dieu-huong { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }

/* ---------- thẻ, nút, ô nhập ---------- */
.the { background: var(--surface) var(--noi); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.the + .the, .luoi + .the, .the + .luoi { margin-top: 12px; }
.the-dau { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.luoi { display: grid; gap: 12px; }
.luoi.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 900px) { .luoi.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); } .luoi.c2-lon { grid-template-columns: 1.4fr 1fr; } }
@media (max-width: 899px) { .luoi.c4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.chi-so { padding: 14px 16px; }
.chi-so .nhan { font-size: 12.5px; color: var(--muted); }
.chi-so .gt { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }

.nut { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 18px; border-radius: var(--pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font-weight: 600; text-decoration: none; white-space: nowrap; }
.nut:hover { background: var(--surface-2); }
.nut.chinh { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
.nut.xanh { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.nut.nhe { border-color: transparent; background: transparent; }
.nut.do { color: var(--bad); border-color: var(--bad); background: transparent; }
.nut.nho { min-height: 36px; padding: 0 13px; font-size: 13.5px; }
.nut.rong { width: 100%; }
.nut:disabled { opacity: .5; cursor: not-allowed; }
.hang-nut { display: flex; gap: 8px; flex-wrap: wrap; }

label.o { display: grid; gap: 5px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.o input, .o select, .o textarea, input.o-nhap, select.o-nhap {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font-size: 16px; }
.o textarea { padding: 10px 14px; min-height: 80px; }
.form { display: grid; gap: 12px; }
.form .doi { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chon-nhom { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--pill); background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.chon-nhom button { border: 0; background: transparent; min-height: 36px; padding: 0 14px; border-radius: var(--pill); font-weight: 500; color: var(--muted); }
.chon-nhom button[aria-pressed="true"] { background: var(--ink); color: var(--ink-fg); }

/* nhãn trạng thái: luôn có dấu + chữ */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tag.ok { background: var(--accent); color: var(--accent-fg); }
.tag.cho { background: var(--cam-weak); color: var(--cam); border: 1px solid var(--cam-line); }
.tag.loi { background: var(--bad); color: #fff; }
.tag.xam { background: var(--surface-3); color: var(--muted); }
.tag.den { background: var(--ink); color: var(--ink-fg); }

.bang { width: 100%; border-collapse: collapse; font-size: 14px; }
.bang th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.bang td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.bang .phai { text-align: right; }
.cuon-ngang { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.trong { padding: 22px; text-align: center; color: var(--muted); }
.ds { display: grid; gap: 8px; }
.dong-ds { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.dong-ds .chinh { flex: 1; min-width: 0; }
.dong-ds .chinh b { display: block; }

/* ---------- lịch sân: cột giờ + mỗi sân một cột ---------- */
.lich-dau { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.lich-dau .ngay { font-weight: 600; min-width: 140px; text-align: center; }
.chu-giai { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.chu-giai span { display: inline-flex; align-items: center; gap: 5px; }
.chu-giai i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lich { position: relative; overflow-x: auto; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.lich-trong { display: grid; position: relative; min-width: max-content; }
.lich .cot-gio { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--line); }
.lich .o-gio { height: 64px; font-size: 12px; color: var(--muted); padding: 2px 6px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lich .tieu-de { height: 38px; position: sticky; top: 0; z-index: 2; display: grid; place-items: center; font-weight: 600; font-size: 13.5px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.lich .cot-san { position: relative; border-right: 1px solid var(--line); width: 128px; }
.lich .o-trong { height: 32px; border-top: 1px dashed var(--line); background: transparent; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; display: block; padding: 0; }
.lich .o-trong:nth-child(2n) { border-top-style: solid; }
.lich .o-trong:hover { background: var(--accent-weak); }
.lich .o-trong.qua { background: repeating-linear-gradient(-45deg, transparent 0 5px, var(--surface-2) 5px 10px); }
.khoi { position: absolute; left: 4px; right: 4px; border-radius: 12px; padding: 5px 8px; font-size: 12.5px; line-height: 1.3; overflow: hidden; text-align: left;
  border: 1px solid transparent; z-index: 1; box-shadow: var(--shadow-o); }
.khoi b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.khoi.le { background: var(--accent-weak); color: var(--fg); border-color: var(--accent-line); border-left: 4px solid var(--accent); }
.khoi.codinh { background: var(--surface-3); color: var(--fg); border-left: 4px solid var(--ink); }
.khoi.online { background: var(--accent-weak); border-color: var(--accent-line); border-left: 4px dashed var(--accent); }
.khoi.giu { background: var(--soc); color: var(--fg); border-color: var(--cam-line); border-left: 4px solid var(--cam); }
.khoi.nghi { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); box-shadow: none; }
.khoi .tag { margin-top: 3px; font-size: 12px; padding: 0 6px; }
.vach-gio { position: absolute; left: 0; right: 0; height: 2px; background: var(--cam); z-index: 2; pointer-events: none; }
.vach-gio::before { content: ""; position: absolute; left: -1px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--cam); }

/* ---------- bán hàng ---------- */
.luoi-hang { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.o-hang { position: relative; display: grid; gap: 2px; text-align: left; padding: 12px; min-height: 92px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-o); }
.o-hang:active { transform: scale(.98); }
.o-hang b { font-size: 14.5px; }
.o-hang .gia { font-weight: 700; font-variant-numeric: tabular-nums; }
.o-hang .dem { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--ink); color: var(--ink-fg); font-weight: 700; font-size: 13px; display: grid; place-items: center; padding: 0 6px; }
.gio-hang { position: sticky; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 5; margin-top: 12px; }
.sl { display: inline-flex; align-items: center; gap: 2px; }
.sl button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; }
.sl span { min-width: 28px; text-align: center; font-weight: 600; }

/* ---------- hộp thoại ---------- */
dialog { border: 0; padding: 0; background: transparent; max-width: min(520px, calc(100vw - 20px)); width: 100%; color: var(--fg); }
dialog::backdrop { background: rgba(10,11,13,.45); }
dialog .the { max-height: calc(100dvh - 40px); overflow: auto; }
@media (max-width: 640px) {
  dialog { margin: auto 0 0; max-width: 100vw; }
  dialog .the { border-radius: 26px 26px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
.bao { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 60; padding: 11px 18px; border-radius: var(--pill);
  background: var(--ink); color: var(--ink-fg); font-weight: 500; box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px); }
.bao.loi { background: var(--bad); color: #fff; }

/* biểu đồ cột gọn */
.cot-bd { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.cot-bd .c { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; position: relative; }
.cot-bd .c i { display: block; border-radius: 4px 4px 0 0; min-height: 0; }
.cot-bd .c i.san { background: var(--ink); }
.cot-bd .c i.hang { background: repeating-linear-gradient(-45deg, var(--cam) 0 3px, color-mix(in srgb, var(--cam) 55%, transparent) 3px 6px); }
.truc-x { display: flex; gap: 3px; font-size: 12px; color: var(--faint); margin-top: 4px; }
.truc-x span { flex: 1; text-align: center; min-width: 0; }
.thanh { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.thanh i { display: block; height: 100%; background: var(--accent); }

@media (min-width: 900px) {
  .app { padding: 14px 14px 110px; }
  .khung { padding: 16px 22px 28px; border-radius: 34px; }
  .lich .cot-san { width: 150px; }
}

/* link chữ trong đoạn văn: vùng chạm đủ lớn cho ngón tay */
.lien-ket { display: inline-block; padding: 8px 2px; }
@media (max-width: 640px) { .chi-so { padding: 12px 14px; } .chi-so .gt { font-size: 19px; } }

/* ---------- tối ưu 01/11: gọn trên điện thoại ---------- */
.dai-so { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 10px; padding: 2px; }
.dai-so::-webkit-scrollbar { display: none; }
.dai-so span { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px; border-radius: var(--pill); background: var(--surface) var(--noi); border: 1px solid var(--line); box-shadow: var(--shadow-o); font-size: 13.5px; white-space: nowrap; }
.dai-so span b { font-variant-numeric: tabular-nums; }
.dai-so span.cho { background: var(--cam-weak); border-color: var(--cam-line); color: var(--cam); box-shadow: none; }
.the-lich { padding: 12px; }
.the-lich .lich-dau { margin-bottom: 8px; }
.chu-giai-gon { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 10px; margin-bottom: 8px; }
.chu-giai-gon::-webkit-scrollbar { display: none; }
.chu-giai-gon span { flex: none; }
/* Lịch cuộn trong khung: tiêu đề "Sân 1, Sân 2…" luôn dính trên cùng */
.the-lich .lich { max-height: calc(100dvh - 250px); min-height: 320px; overflow: auto; overscroll-behavior: contain; }
.lich .tieu-de { position: sticky; top: 0; z-index: 4; }
.lich .cot-gio .tieu-de { z-index: 5; }
.o-hang { min-height: 0; padding: 11px 12px; gap: 4px; }
.o-hang .gia .nho { font-weight: 500; }
.o-hang .canh { color: var(--cam); }
.o-hang.het { background: var(--surface-2); }
.o-hang.het b { color: var(--muted); }
.dong-kho { padding: 10px 12px; }
.dong-kho .chinh b .tag { margin-left: 4px; vertical-align: 1px; }
.tieu-de-nhom { font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 6px 6px; }
.tieu-de-nhom:first-child { margin-top: 2px; }
.dong-menu { text-decoration: none; color: inherit; background: transparent; padding: 12px; }
.dong-menu:hover { background: var(--surface-2); }
@media (max-width: 640px) {
  .khung { padding: 10px 10px 20px; border-radius: 26px; }
  .the { padding: 14px; border-radius: 22px; }
  .luoi-hang { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  h2 { font-size: 17px; }
}

.the-lich .lich-dau { flex-wrap: nowrap; gap: 6px; }
.the-lich .lich-dau .ngay { min-width: 0; flex: 1; }
.the-lich .lich-dau > span[style*="flex:1"] { display: none; }
.cuon-chip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cuon-chip::-webkit-scrollbar { display: none; }
.cuon-chip .nut { flex: none; }

.chon-nhom.cuon-chip { flex-wrap: nowrap; max-width: 100%; }
.cuon-chip button { white-space: nowrap; flex: none; }
