/* English with Khoa: design system. One file for every page of the platform. */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&display=swap');

:root {
  --bg: #f6f5f1; --surface: #fff; --sunken: #f0eee9;
  --ink: #17191c; --ink-2: #474c54; --ink-3: #777d87; --ink-4: #a3a7ae;
  --line: #e3e1da; --line-2: #eeece6;
  --accent: #14694a; --accent-2: #0e5139; --accent-soft: #e5f1ea; --accent-line: #b9d9c8;
  --amber: #a15c07; --amber-soft: #fbf1dd; --amber-line: #ecd3a0;
  --red: #b3261e; --red-soft: #fbeae8; --red-line: #f0c2be;
  --blue: #2553b8; --blue-soft: #e9effb; --blue-line: #c3d2f2;
  --r: 10px; --r-s: 7px;
  --shadow: 0 1px 2px rgba(23, 25, 28, .05);
  --shadow-2: 0 8px 28px rgba(23, 25, 28, .12);
  --side: 236px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.5 "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.right { margin-left: auto; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; }
.gap-s { gap: 6px; } .gap-l { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico.s { width: 15px; height: 15px; }
.ico.fill { fill: currentColor; stroke: none; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand i { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 14px; font-weight: 700; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--ink-3); letter-spacing: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--sunken); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.nav a .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--amber); color: #fff; font-size: 11.5px; font-weight: 600; text-align: center; line-height: 20px; }
.nav .sep { margin: 12px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); }
.side .me { margin-top: auto; border-top: 1px solid var(--line-2); padding: 12px 8px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sunken); color: var(--ink-2); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.avatar.l { width: 44px; height: 44px; font-size: 16px; background: var(--accent-soft); color: var(--accent-2); }
.side .me a { color: var(--ink-3); display: grid; place-items: center; padding: 6px; border-radius: 6px; }
.side .me a:hover { background: var(--sunken); color: var(--ink); }
.main { min-width: 0; padding: 30px 36px 64px; }
.page { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.page.narrow { max-width: 760px; }
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head .sub { color: var(--ink-3); margin-top: 4px; }
.crumb { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; margin-bottom: 6px; }
.crumb a { color: var(--ink-3); }
.banner { background: var(--amber-soft); border: 1px solid var(--amber-line); color: #6d3f05; border-radius: var(--r-s); padding: 9px 14px; font-weight: 500; display: flex; gap: 10px; align-items: center; }
.tabbar { display: none; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); transition: background .12s, border-color .12s, transform .06s; }
.btn:hover { background: var(--sunken); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible, .seg button:focus-visible, .switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); }
.btn.s { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.l { height: 44px; padding: 0 20px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field > em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.input { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); }
textarea.input { resize: vertical; min-height: 76px; line-height: 1.5; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.form { display: grid; gap: 14px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: inline-flex; background: var(--sunken); border-radius: var(--r-s); padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 5px; font-weight: 600; font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.switch { position: relative; width: 36px; height: 20px; border-radius: 99px; border: 0; background: var(--ink-4); cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(16px); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { cursor: pointer; }
.days input { position: absolute; opacity: 0; }
.days span { display: grid; place-items: center; min-width: 44px; height: 34px; border: 1px solid var(--line); border-radius: var(--r-s); font-weight: 600; font-size: 12.5px; color: var(--ink-3); background: var(--surface); }
.days input:checked + span { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-2); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 18px 20px; }
.card > header { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.card > header h2 { flex: 1; }
.card > .body { padding: 16px 20px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.stat { padding: 14px 16px; }
.stat .k { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin-top: 2px; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.stat .d { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.green { background: var(--accent-soft); color: var(--accent-2); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.bar { height: 8px; border-radius: 99px; background: var(--sunken); position: relative; overflow: visible; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bar > b { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink-3); border-radius: 2px; }
.bar.thin { height: 5px; }
.level { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.level span { padding: 2px 9px; border-radius: 6px; background: var(--sunken); font-size: 12.5px; }
.level span:last-child { background: var(--accent); color: #fff; }
.level svg { color: var(--ink-4); }
.empty { padding: 28px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }

/* ---------- tables and lists ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 10px 20px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: #faf9f6; }
.table td.tight, .table th.tight { width: 1%; white-space: nowrap; }
.list > * { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }
.list > *:last-child { border-bottom: 0; }
.list > a { color: inherit; }
.list > a:hover, .list > .click:hover { background: #faf9f6; text-decoration: none; cursor: pointer; }
.date { width: 46px; flex: none; text-align: center; line-height: 1.15; }
.date b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.date span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.date.today b, .date.today span { color: var(--accent); }
.date.none b { color: var(--ink-4); } .date.none span { text-transform: none; letter-spacing: 0; font-size: 10.5px; }
.n { width: 26px; height: 26px; border-radius: 7px; background: var(--sunken); color: var(--ink-2); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.n.done { background: var(--accent); color: #fff; }
.agenda { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.agenda li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; }
.agenda li b { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 500; }
.note { background: var(--sunken); border-radius: var(--r-s); padding: 10px 12px; }
.note.fb { background: var(--accent-soft); color: #0b3e2c; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 14px; font-weight: 600; font-size: 13.5px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent-2); border-color: var(--accent); }
.tabs a .count { background: var(--amber); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; line-height: 18px; }

/* ---------- timeline (milestones) ---------- */
.miles { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; }
.mile { position: relative; padding: 26px 16px 0 0; }
.mile::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--line); }
.mile::after { content: ""; position: absolute; top: 2px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-4); }
.mile.done::after { background: var(--accent); border-color: var(--accent); }
.mile.now::after { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.mile .m { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.mile h3 { margin: 2px 0 4px; }
.mile p { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }

/* ---------- chart ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart .target { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart text { font: 500 10.5px "Be Vietnam Pro", sans-serif; fill: var(--ink-3); }
.chart text.t { fill: var(--amber); font-weight: 600; }

/* ---------- dialog and toast ---------- */
dialog { border: 0; padding: 0; border-radius: 14px; box-shadow: var(--shadow-2); width: min(560px, calc(100vw - 32px)); color: var(--ink); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgba(23, 25, 28, .38); }
dialog > form, dialog > div { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
dialog header { padding: 18px 22px 0; display: flex; align-items: flex-start; gap: 12px; }
dialog header h2 { flex: 1; font-size: 18px; }
dialog .body { padding: 16px 22px; overflow: auto; }
dialog footer { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 9px; font-weight: 500; box-shadow: var(--shadow-2); z-index: 100; animation: rise .18s ease-out; }
.toast.bad { background: var(--red); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- recorder and audio ---------- */
.rec { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border: 1px dashed var(--line); border-radius: var(--r-s); background: #fbfaf8; }
.rec .time { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 44px; }
.rec.live { border-style: solid; border-color: var(--red-line); background: var(--red-soft); }
.rec .live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
audio { height: 34px; max-width: 100%; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .pitch { background: var(--accent); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth .pitch h1 { font-size: 34px; line-height: 1.15; max-width: 15ch; }
.auth .pitch p { color: rgba(255, 255, 255, .78); max-width: 42ch; margin-top: 14px; font-size: 15px; }
.auth .pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: rgba(255, 255, 255, .9); font-weight: 500; }
.auth .pitch li { display: flex; gap: 10px; align-items: center; }
.auth .panel { display: grid; place-items: center; padding: 32px; }
.auth form { width: min(360px, 100%); display: grid; gap: 16px; }
.auth .err { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-line); border-radius: var(--r-s); padding: 9px 12px; font-weight: 500; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { padding: 0; } .side .brand small { display: none; }
  .side .nav { display: none; }
  .side .me { margin: 0 0 0 auto; border: 0; padding: 0; } .side .me .grow { display: none; }
  .main { padding: 20px 16px 96px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 30; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 11px; font-weight: 600; color: var(--ink-3); border-radius: 8px; position: relative; }
  .tabbar a.on { color: var(--accent-2); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--amber); color: #fff; border-radius: 99px; font-size: 10px; padding: 0 5px; line-height: 15px; }
  .grid.c2, .grid.c3, .grid.c4, .grid.main-side { grid-template-columns: 1fr; }
  .grid.c4.keep2 { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 22px; }
  .miles { grid-auto-flow: row; }
  .mile { padding: 0 0 18px 26px; }
  .mile::before { top: 0; bottom: 0; left: 5px; right: auto; width: 2px; height: auto; }
  .mile::after { top: 3px; }
  .form .two { grid-template-columns: 1fr; }
  .table th, .table td { padding: 10px 14px; }
  .table .hide-m { display: none; }
  .card > header, .card > .body, .list > * { padding-left: 16px; padding-right: 16px; }
  .agenda li { grid-template-columns: 1fr; gap: 0; }
  .auth { grid-template-columns: 1fr; }
  .auth .pitch { display: none; }
}
@media print {
  .side, .tabbar, .no-print { display: none !important; }
  .shell { display: block; } .main { padding: 0; } body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
