*, *::before { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; min-height: 100vh; }
/* Bố cục: các tấm kính mờ nổi trên nền có quầng màu; cột mục chính bên trái, bên phải là ô dự án lớn rồi hai bảng tóm tắt.
   Màu và chữ theo bộ WeHa (xanh chạng vạng + tím iris, Lora + Inter). Mặc định tối. */
:root {
  color-scheme: dark;
  --bg: #0E1424; --text: #F1F4FB; --text-2: #ACB8D0; --text-muted: #96A5BF; --idle: #7C8AA6;
  --accent: #B6A5FF; --accent-soft: rgba(182, 165, 255, 0.16); --on-accent: #191337;
  --glass: rgba(255, 255, 255, 0.06); --glass-strong: rgba(255, 255, 255, 0.11); --glass-line: rgba(255, 255, 255, 0.15);
  --shine: rgba(255, 255, 255, 0.10); --shade: rgba(4, 8, 20, 0.45); --hair: rgba(255, 255, 255, 0.09); --track: rgba(255, 255, 255, 0.13);
  --glow1: rgba(89, 68, 197, 0.55); --glow2: rgba(37, 99, 176, 0.38); --glow3: rgba(74, 58, 150, 0.50);
  --p1: #8B78F0; --p2: #E05A55; --p3: #2E9BB8; --p4: #BD7F26;
  --ok: #82D8A7; --ok-bg: rgba(130, 216, 167, 0.16); --down: #F8A39A;
  --sheet: #1B2540; --toast-bg: #F1F4FB; --toast-fg: #0E1424;
  --display: "Lora", Georgia, "Times New Roman", serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F5F7FC; --text: #19243B; --text-2: #52617B; --text-muted: #5A6983; --idle: #93A0B8;
    --accent: #5944C5; --accent-soft: rgba(89, 68, 197, 0.12); --on-accent: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.58); --glass-strong: rgba(255, 255, 255, 0.78); --glass-line: rgba(255, 255, 255, 0.9);
    --shine: rgba(255, 255, 255, 0.9); --shade: rgba(41, 55, 97, 0.13); --hair: rgba(25, 36, 59, 0.09); --track: rgba(25, 36, 59, 0.10);
    --glow1: rgba(89, 68, 197, 0.30); --glow2: rgba(37, 99, 176, 0.22); --glow3: rgba(182, 165, 255, 0.38);
    --p1: #5944C5; --p2: #C0392B; --p3: #1B8AA8; --p4: #B4701A;
    --ok: #18663E; --ok-bg: rgba(24, 102, 62, 0.12); --down: #AB342D;
    --sheet: #FFFFFF; --toast-bg: #19243B; --toast-fg: #F5F7FC;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F7FC; --text: #19243B; --text-2: #52617B; --text-muted: #5A6983; --idle: #93A0B8;
  --accent: #5944C5; --accent-soft: rgba(89, 68, 197, 0.12); --on-accent: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.58); --glass-strong: rgba(255, 255, 255, 0.78); --glass-line: rgba(255, 255, 255, 0.9);
  --shine: rgba(255, 255, 255, 0.9); --shade: rgba(41, 55, 97, 0.13); --hair: rgba(25, 36, 59, 0.09); --track: rgba(25, 36, 59, 0.10);
  --glow1: rgba(89, 68, 197, 0.30); --glow2: rgba(37, 99, 176, 0.22); --glow3: rgba(182, 165, 255, 0.38);
  --p1: #5944C5; --p2: #C0392B; --p3: #1B8AA8; --p4: #B4701A;
  --ok: #18663E; --ok-bg: rgba(24, 102, 62, 0.12); --down: #AB342D;
  --sheet: #FFFFFF; --toast-bg: #19243B; --toast-fg: #F5F7FC;
}
body { background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
h1, .num { font-family: var(--display); font-weight: 700; font-variant-numeric: lining-nums proportional-nums; text-wrap: balance; }
h2 { font-family: var(--body); font-weight: 700; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { flex: none; }
.c1 { --c: var(--p1); }
.c2 { --c: var(--p2); }
.c3 { --c: var(--p3); }
.c4 { --c: var(--p4); }
.c5 { --c: var(--idle); }

.sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(55% 45% at 6% 0%, var(--glow1), transparent 70%),
    radial-gradient(45% 40% at 100% 16%, var(--glow2), transparent 70%),
    radial-gradient(55% 45% at 55% 106%, var(--glow3), transparent 70%);
}
.glass {
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 12px 40px var(--shade), inset 0 1px 0 var(--shine);
}

.app {
  position: relative; z-index: 1; display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 24px; align-items: start;
  padding-block: 16px 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.side { border-radius: 24px; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 0 14px 6px; font-size: 16px; font-weight: 700; }
.brand span { flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-family: var(--display); }
.theme { margin-left: auto; width: 44px; height: 44px; flex: none; border: 1px solid var(--glass-line); border-radius: 14px; background: var(--glass-strong); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.theme .moon { display: none; }
:root[data-theme="light"] .theme .moon { display: block; }
:root[data-theme="light"] .theme .sun { display: none; }
.side a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--glass-line); }
.side .lab { padding: 18px 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }
.dot { width: 10px; height: 10px; border-radius: 99px; background: var(--c); flex: none; }

.main { min-width: 0; padding-top: 14px; }
.wrap { max-width: 1480px; margin: 0; display: flex; flex-direction: column; gap: 26px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; }
.head h1 { font-size: 36px; line-height: 1.15; }
.head p { margin-top: 6px; color: var(--text-2); }
.sample { padding: 4px 12px; border-radius: 99px; background: var(--glass); border: 1px solid var(--glass-line); color: var(--text-2); font-size: 13px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.tile {
  display: flex; flex-direction: column; gap: 14px; min-height: 210px; box-sizing: border-box; padding: 22px; border-radius: 24px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 7%, transparent)), var(--glass);
  border-color: color-mix(in srgb, var(--c) 38%, var(--glass-line));
}
.tile-top { display: flex; align-items: center; justify-content: space-between; color: var(--c); }
.ico { width: 46px; height: 46px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-line); color: var(--c); display: flex; align-items: center; justify-content: center; }
.tile h2 { font-size: 20px; color: var(--text); }
.desc { margin-top: 4px; font-size: 14px; color: var(--text-2); }
.tile-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--text-2); }
.big { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.big .num { font-size: 42px; line-height: 1; color: var(--text); }
.bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, transparent), var(--c)); }
.add { min-height: 210px; box-sizing: border-box; padding: 22px; border: 1.5px dashed var(--idle); border-radius: 24px; background: transparent; color: var(--text-2); font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.add.small { min-height: 150px; }

.card { min-width: 0; border-radius: 20px; padding: 20px 22px 8px; }
.card h2 { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.card .note { margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.count { padding: 2px 10px; border-radius: 99px; background: var(--track); color: var(--text-2); font-size: 13px; font-weight: 600; }
.rows { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--hair); min-height: 44px; box-sizing: border-box; }
.row .txt { flex: 1 1 150px; min-width: 0; }
.row b { display: block; font-weight: 600; }
.row small { display: block; font-size: 13px; color: var(--text-muted); }
.row .bar { flex: 2 1 110px; }
.row .frac { flex: none; width: 50px; text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st { color: var(--c); display: flex; }
.st.t { color: var(--idle); }
.idea { width: 8px; height: 8px; border-radius: 99px; background: var(--idle); flex: none; }

.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--text-2); font-weight: 500; }
.hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; padding: 26px; border-radius: 24px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 7%, transparent)), var(--glass);
  border-color: color-mix(in srgb, var(--c) 38%, var(--glass-line));
}
.hero-name { flex: 3 1 300px; min-width: 0; display: flex; align-items: center; gap: 16px; }
.hero-name .ico { width: 58px; height: 58px; border-radius: 18px; }
.hero h1 { font-size: 34px; line-height: 1.15; }
.hero-stat { flex: 2 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 13px; }
.hint { color: var(--text-muted); font-size: 14px; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; align-items: start; }
.group { padding: 20px 14px 10px; }
.group-head { padding: 0 8px; display: flex; flex-direction: column; gap: 10px; }
.group-head h2 { justify-content: space-between; }
.group-head .frac { flex: none; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.items { margin-top: 14px; }
.item { border-top: 1px solid var(--hair); display: flex; align-items: stretch; }
.stb { width: 44px; min-height: 50px; flex: none; padding: 0; border: 0; background: transparent; align-items: center; justify-content: center; border-radius: 10px; }
.nameb { flex: 1 1 auto; min-width: 0; min-height: 50px; padding: 6px 8px 6px 2px; border: 0; background: transparent; display: flex; align-items: center; gap: 12px; text-align: left; border-radius: 10px; }
.stb:hover, .nameb:hover { background: var(--hair); }
.sheet { width: min(440px, calc(100% - 32px)); box-sizing: border-box; padding: 22px; border: 1px solid var(--glass-line); border-radius: 22px; background: var(--sheet); color: var(--text); font-family: var(--body); box-shadow: 0 24px 80px var(--shade); }
.sheet::backdrop { background: rgba(8, 12, 26, 0.55); }
.sheet form { display: flex; flex-direction: column; gap: 16px; }
.sheet h2 { margin: 0; font-size: 18px; }
.fl { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; color: var(--text-2); }
.fl-col { display: flex; flex-direction: column; gap: 16px; }
.fl textarea { font: inherit; font-size: 16px; line-height: 1.5; width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--idle); background: var(--bg); color: var(--text); resize: vertical; }
.fl textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.work { padding: 18px 20px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--glass-line); border-radius: 99px; background: var(--track); color: var(--text-2); font-size: 14px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.filters select, .filters input { font: inherit; font-size: 14px; min-height: 40px; box-sizing: border-box; padding: 0 12px; border-radius: 99px; border: 1px solid var(--glass-line); background: var(--sheet); color: var(--text); }
.filters input { flex: 1 1 140px; min-width: 0; max-width: 260px; }
.filters .addbtn { margin-left: auto; min-height: 40px; }
.filters select:focus-visible, .filters input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wt { width: 100%; border-collapse: collapse; table-layout: fixed; }
.wt th { padding: 8px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); }
.wt th:nth-child(1) { width: 44px; padding: 0; }
.wt th:nth-child(2) { width: 30%; }
.wt th:nth-child(3) { width: 124px; }
.wt th:nth-child(4) { width: 15%; }
.wt th:nth-child(6) { width: 104px; }
.wt td { padding: 0; border-top: 1px solid var(--hair); vertical-align: top; }
.wt .c-t { padding: 7px 4px; }
.wt select.pill { font-family: inherit; min-height: 36px; padding: 0 8px; border: 1px solid transparent; cursor: pointer; }
.wt select.pill:hover { border-color: currentColor; }
.wt select.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wt select.pill option { background: var(--sheet); color: var(--text); }
.wt .c-d { padding: 14px 8px; font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.wt .cellb { width: 100%; min-height: 50px; padding: 13px 8px; border: 0; background: transparent; text-align: left; border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; color: var(--text-2); }
.wt .cellb.name { font-size: 15px; font-weight: 500; color: var(--text); }
.wt tr.x .cellb.name { color: var(--text-muted); }
.wt .cellb.no { color: var(--text-muted); opacity: 0; }
.wt tr:hover .cellb.no, .wt .cellb.no:focus-visible { opacity: 1; }
.wt .cellb:hover { background: var(--hair); }
.wt .none td { padding: 18px 8px; color: var(--text-muted); text-align: center; }
.pill.d { background: var(--accent-soft); color: var(--accent); }
.pill.x { background: var(--ok-bg); color: var(--ok); }
.fl input, .fl select { font: inherit; font-size: 16px; width: 100%; box-sizing: border-box; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--idle); background: var(--bg); color: var(--text); }
.fl input:focus-visible, .fl select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.segr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.segr label { position: relative; }
.segr input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.segr span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px; background: var(--track); color: var(--text-2); font-size: 14px; font-weight: 600; }
.segr input:checked + span { background: var(--accent); color: var(--on-accent); }
.segr input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; }
.acts.end { justify-content: flex-end; }
.acts button { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--glass-line); background: var(--track); font-weight: 600; font-size: 14px; }
.acts .del { margin-left: auto; color: var(--down); }
.acts .pri { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.item .name { flex: 1 1 auto; min-width: 0; font-weight: 500; }
.item.x .name { color: var(--text-muted); }
.pill { flex: none; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--track); color: var(--text-2); }
.item.d .pill { background: var(--accent-soft); color: var(--accent); }
.item.x .pill { background: var(--ok-bg); color: var(--ok); }
.gname { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -11px 0; border-radius: 8px; }
.gname svg { color: var(--text-muted); transition: transform .15s; }
.gname:hover svg { transform: translateX(3px); }
.more.all { color: var(--accent); font-weight: 600; box-sizing: border-box; }
.hn { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.pen { flex: none; width: 44px; height: 44px; margin: -11px 0; border: 0; border-radius: 12px; background: transparent; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.pen:hover { background: var(--hair); color: var(--text); }
.save { padding: 14px 12px 2px; font-size: 12px; color: var(--text-muted); }
.save.bad { color: var(--down); font-weight: 600; }
.projs { display: flex; flex-direction: column; gap: 4px; }
.items.flat { margin: 0 0 10px; }
.items.flat .item:first-child, .items.flat .more:first-child { border-top: 0; }
.done summary { min-height: 44px; padding: 0 8px; border-top: 1px solid var(--hair); display: flex; align-items: center; gap: 10px; color: var(--text-2); font-weight: 500; cursor: pointer; list-style: none; }
.done summary::-webkit-details-marker { display: none; }
.done summary::after { content: "+"; margin-left: auto; font-size: 18px; color: var(--text-muted); }
.done[open] summary::after { content: "−"; }
.done summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.more { width: 100%; min-height: 44px; padding: 0 8px; border: 0; border-top: 1px solid var(--hair); background: transparent; color: var(--text-muted); font-weight: 500; text-align: left; display: flex; align-items: center; gap: 8px; }

.toast { position: fixed; z-index: 5; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100% - 32px); box-sizing: border-box; padding: 10px 16px; border-radius: 12px; background: var(--toast-bg); color: var(--toast-fg); font-size: 14px; font-weight: 500; }

.charts { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
.chart { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.weeks { flex: 1; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; min-height: 190px; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 6px; border-radius: 8px; }
.wk:hover, .wk:focus-visible { background: var(--hair); }
.wk-n { font-size: 13px; font-weight: 600; text-align: center; white-space: nowrap; display: flex; justify-content: center; }
.wk-l { font-size: 12px; color: var(--text-muted); }
.wk-col { flex: 1; width: 100%; max-width: 24px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; border-bottom: 1px solid var(--track); }
.wk-col i { background: var(--c); flex: none; }
.wk-col i:first-of-type { border-radius: 4px 4px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend b { color: var(--text); }
.ring { position: relative; width: 180px; max-width: 100%; margin: auto; }
.ring svg { display: block; width: 100%; }
.ring .num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 38px; pointer-events: none; }
.arc { fill: none; stroke-width: 18; }
.arc.x { stroke: var(--accent); }
.arc.d { stroke: color-mix(in srgb, var(--accent) 45%, var(--bg)); }
.arc.t { stroke: var(--track); }
.sw { width: 10px; height: 10px; border-radius: 99px; }
.sw.x { background: var(--accent); }
.sw.d { background: color-mix(in srgb, var(--accent) 45%, var(--bg)); }
.sw.t { background: var(--track); }
.maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 28px; }
.map { display: flex; flex-direction: column; gap: 8px; border-radius: 8px; }
.cells { display: flex; flex-wrap: wrap; gap: 6px; }
.cell { width: 26px; height: 26px; border-radius: 7px; box-sizing: border-box; border: 1.5px solid color-mix(in srgb, var(--c) 45%, transparent); }
.cell.x { background: var(--c); border-color: var(--c); }
.cell.d { background: color-mix(in srgb, var(--c) 45%, transparent); }
.legend .cell { width: 14px; height: 14px; border-radius: 4px; }
.tip { position: fixed; z-index: 6; max-width: 260px; transform: translateX(-50%); padding: 6px 10px; border-radius: 8px; background: var(--toast-bg); color: var(--toast-fg); font-size: 13px; pointer-events: none; }

.charts.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles.four { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.lico { width: 46px; height: 46px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-line); color: var(--c); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex: none; box-sizing: border-box; }
.lico.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
.lico.lg { width: 58px; height: 58px; border-radius: 18px; font-size: 25px; }
.mini { height: 34px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; align-items: end; }
.mini i { background: var(--c); border-radius: 3px 3px 0 0; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 32px; color: var(--text-2); font-size: 13px; }
.stats .num { display: block; font-size: 34px; line-height: 1.1; color: var(--text); }
.pulls { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 6px; }
.pull { display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr) 40px; gap: 12px; align-items: center; min-height: 40px; border-radius: 8px; font-size: 14px; }
.pull b { text-align: right; font-variant-numeric: tabular-nums; }
.pbar { position: relative; height: 14px; }
.pbar i { display: block; height: 100%; background: var(--c); border-radius: 0 4px 4px 0; }
.pbar u { position: absolute; top: -8px; bottom: -8px; width: 2px; margin-left: -1px; background: var(--text-muted); }
.mark { width: 2px; height: 14px; background: var(--text-muted); }
.scroll { overflow-x: auto; }
.mx { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 14px; }
.mx th { font-weight: 500; color: var(--text-2); text-align: center; }
.mx th[scope="row"] { text-align: left; color: var(--text); }
.mx td { text-align: center; font-variant-numeric: tabular-nums; }
.mc { display: flex; align-items: center; justify-content: center; height: 36px; min-width: 34px; border-radius: 8px; background: color-mix(in srgb, var(--c) var(--k), var(--hair)); font-weight: 600; }
.sumc { font-weight: 700; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.item .name small { display: block; font-size: 13px; font-weight: 400; color: var(--text-muted); }
.rc { flex: none; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text-2); }

.head-r { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.addbtn { min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--glass-line); background: var(--glass-strong); color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.stats4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat { min-width: 0; border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.sl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.sv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sv .num { font-size: 36px; line-height: 1; }
.dl { font-size: 13px; font-weight: 600; white-space: nowrap; }
.dl.up { color: var(--ok); }
.dl.down { color: var(--down); }
.dl.flat { color: var(--text-muted); font-weight: 500; }
.micro { height: 20px; display: flex; align-items: flex-end; }
.micro > * { width: 100%; }
.micro .mini { height: 20px; }
.seg3 { display: flex; gap: 2px; height: 8px; }
.seg3 i { background: var(--c); border-radius: 2px; }
.seg3 i:first-child { border-radius: 99px 2px 2px 99px; }
.seg3 i:last-child { border-radius: 2px 99px 99px 2px; }
.seg3 i:only-child { border-radius: 99px; }
.seg3.tall { height: 14px; }
.seg3 .sw { width: auto; height: auto; }
.pips { display: flex; gap: 4px; height: 8px; }
.pips i { flex: 1; border-radius: 99px; background: var(--track); }
.pips i.on { background: var(--c); }
.tiles.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tiles.three .tile-top { align-items: flex-start; }
.pring { position: relative; width: 68px; height: 68px; flex: none; display: flex; align-items: center; justify-content: center; }
.pring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pring circle { fill: none; stroke-width: 7; }
.pring .rt { stroke: var(--track); }
.pring .rv { stroke: var(--c); stroke-linecap: round; }
.pring b { position: relative; font-family: var(--display); font-size: 17px; color: var(--text); }
.pcount { text-align: right; font-size: 13px; color: var(--text-2); }
.pcount .num { display: block; font-size: 38px; line-height: 1.1; color: var(--text); }
.grs { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.gr { display: grid; grid-template-columns: minmax(0, 1fr) 96px 14px; gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); }
.gr.ch { grid-template-columns: 24px minmax(0, 1fr) 44px; }
.gr svg { color: var(--text-muted); }
.gl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb { display: flex; gap: 2px; height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.gb i { background: var(--c); }
.gb i.d { background: color-mix(in srgb, var(--c) 45%, transparent); }
.gr b { text-align: right; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.lico.xs { width: 24px; height: 24px; border-radius: 7px; font-size: 11px; }
.stack { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.stack .card { flex: 1 1 auto; justify-content: space-between; }
.stack .big { color: var(--text-2); }

@media (max-width: 1020px) { .charts, .charts.even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 859px) {
  .app { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-block: 12px 48px; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; border-radius: 20px; }
  .brand { flex: 1 1 100%; padding: 0 0 4px 4px; }
  .side a { flex: 1 1 90px; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 4px; font-size: 13px; }
  .side .projs, .side .lab { display: none; }
  .save { flex: 1 1 100%; padding: 4px 4px 0; text-align: center; }
  .head h1 { font-size: 30px; }
  .stats4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hero h1 { font-size: 28px; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding: 12px 6px 0; }
.foot .save { flex: 1 1 100%; padding: 0 6px 2px; }
.foot button { min-height: 40px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); font-size: 13px; }
.foot button:hover { background: var(--hair); color: var(--text); }
.login { position: fixed; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.login form { width: min(360px, 100%); box-sizing: border-box; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login .err { margin: 0; min-height: 20px; font-size: 14px; color: var(--down); }
@media (max-width: 859px) {
  .foot { flex: 1 1 100%; justify-content: center; padding: 4px 0 0; }
  .foot .save { flex: 0 1 auto; padding: 0 8px 0 0; }
}
@media (max-width: 1120px) {
  .work { padding: 14px 12px; }
  .filters input { max-width: none; }
  .wt, .wt tbody { display: block; }
  .wt thead { display: none; }
  .wt tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; border-top: 1px solid var(--hair); padding: 4px 0; }
  .wt td { border: 0; }
  .wt .c-t { grid-column: 3; grid-row: 1; }
  .wt .c-w, .wt .c-g, .wt .c-d { grid-column: 2 / -1; }
  .wt .c-w .cellb, .wt .c-g .cellb { min-height: 34px; padding: 4px 8px; }
  .wt .c-w .cellb::before { content: "Giao: "; color: var(--text-muted); }
  .wt .c-w:has(.no), .wt .c-g:has(.no), .wt .c-d { display: none; }
  .wt .none { display: block; }
  .wt .none td { display: block; }
}
@media (hover: none) { .wt .cellb.no { opacity: 1; } }
