/* Locked look "Giấy ấm & Gạch nung": paper ground, ONE brick accent, serif headlines. */
:root {
  --bg: #F7F4EF; --card: #FFFDF9; --ink: #241E17; --sub: #5A5248; --muted: #8A8177;
  --line: #DED8CD; --primary: #B23A28; --primary-soft: #F3DFD9; --danger: #B23A28;
  --done: #5A5248; --serif: Constantia, "Source Serif 4", Cambria, "Noto Serif", serif;
  --sans: "Segoe UI", "Be Vietnam Pro", system-ui, sans-serif;
  --r: 10px;
}
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; font-variant-numeric: lining-nums tabular-nums;
  background: var(--bg) radial-gradient(circle at 100% 0, #EFE9DF 0, transparent 420px) no-repeat; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.08; margin: 0; font-variant-numeric: lining-nums; }
h1 { font-size: clamp(28px, 3.4vw, 40px); }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
em.hl { font-style: normal; color: var(--primary); }
small, .muted { color: var(--muted); }
button { cursor: pointer; }

.mock-banner { text-align: center; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--sub);
  background: #EDE7DC; padding: 6px 16px; border-bottom: 1px solid var(--line); }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - 31px); }
.shell > * { min-width: 0; }
.sidebar { position: sticky; top: 0; height: calc(100vh - 31px); display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px; border-right: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.brand b { display: block; font-family: var(--serif); font-size: 18px; }
.brand small { font-size: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; border-radius: 8px;
  padding: 8px 10px; font-size: 15px; color: var(--sub); }
.nav button .n { font-size: 11px; color: var(--muted); letter-spacing: .06em; width: 18px; }
.nav button:hover { background: #EFE9DF; color: var(--ink); }
.nav button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--primary), 0 0 0 1px var(--line); }
.count { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: var(--primary);
  border-radius: 999px; padding: 0 7px; line-height: 20px; }
.count:empty { display: none; }
.who { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 6px 0; font-size: 13px; }
.who small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.who p { margin: 6px 0 0; color: var(--sub); }

.view { padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1240px; outline: none; }

/* ---- page head: eyebrow + serif headline + one-line deck ---- */
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.eyebrow .bar { width: 1px; height: 12px; background: var(--line); }
.head { display: flex; justify-content: space-between; gap: 20px; align-items: end; flex-wrap: wrap; margin-bottom: 22px; }
.deck { color: var(--sub); margin: 8px 0 0; max-width: 62ch; }

/* ---- cards, frame with one notched corner ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.frame { position: relative; border: 1px solid var(--line); border-radius: 0; padding: 22px; background: var(--card);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%); }
.frame::after { content: ''; position: absolute; top: 0; right: 0; width: 31px; height: 1px; background: var(--line);
  transform-origin: 100% 0; transform: translate(-22px, 0) rotate(45deg); }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: 1.4fr 1fr; }
.stat b { display: block; font-family: var(--serif); font-size: 34px; line-height: 1; margin: 6px 0 4px; }
.stat small { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.stat.hot b { color: var(--primary); }

/* dark ground = signal: only for problems */
.signal { background: var(--ink); color: #F7F4EF; border-radius: var(--r); padding: 18px 20px; }
.signal h3 { color: #fff; margin-bottom: 10px; }
.signal ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.signal li { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  border-top: 1px solid #3A322A; padding-top: 8px; }
.signal li:first-child { border-top: 0; padding-top: 0; }
.signal .btn { background: #F7F4EF; color: var(--ink); border-color: #F7F4EF; }

/* ---- buttons, pills ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 0 14px; font-size: 14px; min-height: 40px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--sub); }
.btn.pri { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.pri:hover { filter: brightness(.94); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.pill { background: #EFE9DF; color: var(--sub); }
.pill.red { background: var(--primary-soft); color: var(--primary); }
.pill.ink { background: var(--ink); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; min-height: 0; font-size: 14px; color: var(--sub); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--primary); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 0 12px; min-height: 34px; font-size: 13px; color: var(--sub); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- tables ---- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FBF8F3; }
td { padding: 10px 12px; border-bottom: 1px solid #EEE8DE; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #FBF6EF; }
tfoot td { font-weight: 700; border-top: 1px solid var(--line); background: #FBF8F3; }

/* ---- schedule rows ---- */
.sched { display: grid; gap: 8px; }
.slot { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.slot .t { font-family: var(--serif); font-size: 20px; }
.slot .meta { font-size: 13px; color: var(--sub); }
.slot.warn { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }

/* ---- progress ---- */
.bar { height: 8px; border-radius: 99px; background: #EAE3D8; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--done); border-radius: 99px; }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(22px, 1fr)); gap: 4px; margin: 12px 0 4px; }
.lessons span { height: 22px; border-radius: 4px; background: #EAE3D8; font-size: 9px; display: grid; place-items: center; color: var(--muted); }
.lessons span.d { background: var(--done); color: #EAE3D8; }
.lessons span.t { box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); font-weight: 700; }
.lessons span.d.t { background: var(--primary); color: #fff; box-shadow: none; }
.lessons span.half { outline: 2px dashed var(--ink); outline-offset: 1px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; background: #EAE3D8; }
.legend i.d { background: var(--done); } .legend i.t { box-shadow: inset 0 0 0 2px var(--primary); } .legend i.h { outline: 2px dashed var(--ink); outline-offset: -1px; background: none; }

/* ---- library ---- */
.lib { display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
.filters { display: grid; gap: 16px; align-content: start; }
.filters h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.item .cov { aspect-ratio: 16/9; background: #EDE6DA center/cover; display: grid; place-items: center; font-family: var(--serif); font-size: 15px; color: var(--sub); text-align: center; padding: 10px; }
.item .cov.video { background: #E3DBCD; color: var(--ink); }
.item .cov.ai { background: var(--primary-soft); color: var(--primary); }
.item .body { padding: 12px; display: grid; gap: 6px; flex: 1; }
.item .body b { font-size: 15px; }
.item .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.callout { display: flex; gap: 16px; align-items: center; border: 1px dashed var(--primary); background: #FBF3EF; border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; }
.callout p { margin: 0; color: var(--sub); }
.callout .pill { flex: none; max-width: none; }
td:first-child { white-space: nowrap; }

/* ---- zalo ---- */
.zalo { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.queue { display: grid; gap: 8px; }
.msg { text-align: left; display: grid; gap: 4px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); min-height: 0; }
.msg.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.msg p { margin: 0; font-size: 13px; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.phone { border: 1px solid var(--line); border-radius: 26px; background: #E9EEF3; padding: 14px; position: sticky; top: 20px; }
.phone .top { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 14px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.phone .av { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.bubble { background: #fff; border-radius: 14px 14px 14px 4px; padding: 12px 14px; font-size: 14px; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.05); white-space: pre-line; }
.bubble small { display: block; margin-top: 6px; font-size: 11px; }
.phone textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 14px; min-height: 120px; background: #fff; margin-top: 12px; resize: vertical; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 0 12px; min-height: 36px; font-size: 13px; color: var(--sub); }
.seg button.on { background: var(--ink); color: #fff; }

/* ---- drawer (class opened from Today) ---- */
.drawer { position: fixed; inset: 0; z-index: var(--z-modal); }
.drawer-bg { position: absolute; inset: 0; background: rgba(36,30,23,.38); }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); overflow-y: auto; padding: 26px 24px 100px; box-shadow: -10px 0 40px rgba(0,0,0,.12); }
.drawer .x { position: absolute; right: 14px; top: 12px; border: 0; background: none; font-size: 28px; min-height: 44px; width: 44px; color: var(--sub); }
.att { display: grid; gap: 6px; margin: 10px 0; }
.att label { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
.att input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
.att input.score { width: 72px; min-height: 34px; margin-left: auto; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; text-align: right; background: #fff; }
.att label.off { opacity: .55; }
.field { display: grid; gap: 4px; margin: 12px 0; font-size: 13px; color: var(--sub); }
.field select, .field input { border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }
.sticky-save { position: fixed; bottom: 0; right: 0; width: min(560px, 100%); padding: 14px 24px; background: var(--bg); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.chain { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.chain li { display: flex; gap: 8px; } .chain li::before { content: '→'; color: var(--primary); font-weight: 700; }

/* ---- modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(36,30,23,.4); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg); border-radius: 14px; width: min(520px, 100%); padding: 22px; max-height: 90vh; overflow-y: auto; }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.share-row select { border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; min-height: 36px; background: #fff; }

.toast-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(520px, calc(100% - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transform: translateY(8px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.flash { animation: flash .9s ease 2; }
@keyframes flash { 50% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } .toast { transition: none; } }

.hero-photo { border-radius: var(--r); overflow: hidden; position: relative; min-height: 180px; background: center/cover; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--card); min-width: 220px; flex: 1; max-width: 320px; }
.mt { margin-top: 22px; }
.foot { margin-top: 40px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }

/* ---- phone width ---- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: var(--z-nav); height: auto; flex-direction: column; gap: 8px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav button { white-space: nowrap; }
  .nav button .n, .who { display: none; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3, .g2, .zalo, .lib { grid-template-columns: 1fr; }
  .phone { position: static; }
  .slot { grid-template-columns: 52px 1fr; }
  .slot > :last-child { grid-column: 1 / -1; justify-self: start; }
  .lessons { grid-template-columns: repeat(auto-fill, minmax(18px, 1fr)); }
}
