/* Be Vietnam Pro 5.3.0 (@fontsource), giấy phép SIL OFL 1.1 ở fonts/OFL.txt. Đặt cùng app, không tải từ mạng ngoài. */
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/be-vietnam-pro-vietnamese-400-normal.woff2?v=5.3.0") format("woff2");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/be-vietnam-pro-latin-ext-400-normal.woff2?v=5.3.0") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/be-vietnam-pro-latin-400-normal.woff2?v=5.3.0") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/be-vietnam-pro-vietnamese-600-normal.woff2?v=5.3.0") format("woff2");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/be-vietnam-pro-latin-ext-600-normal.woff2?v=5.3.0") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/be-vietnam-pro-latin-600-normal.woff2?v=5.3.0") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/be-vietnam-pro-vietnamese-700-normal.woff2?v=5.3.0") format("woff2");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/be-vietnam-pro-latin-ext-700-normal.woff2?v=5.3.0") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/be-vietnam-pro-latin-700-normal.woff2?v=5.3.0") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
:root {
  --green: #0E5C4D;
  --green-2: #E3F1EC;
  --gold: #D9B25C;
  --ink: #1d2b27;
  --muted: #5f6f6a;
  --line: #d6e1dd;
  --bg: #f5f8f7;
  --card: #ffffff;
  --red: #b42318;
  --red-bg: #fdecea;
  --warn-bg: #fff4d6;
  --ok-bg: #e5f4ea;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: 72px;
}
a { color: var(--green); }
h1 { font-size: 1.35rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 1rem 0 .5rem; }
.wrap { max-width: 760px; margin: 0 auto; padding: 12px 16px; }
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--green); color: #fff; padding: 10px 16px;
}
.top a, .top .link { color: #fff; }
.brand { font-weight: 700; text-decoration: none; }
.menu { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.menu form { margin: 0; }
.notice { background: var(--warn-bg); padding: 10px 16px; border-bottom: 1px solid var(--gold); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 12px 0; }
.login { max-width: 420px; margin: 40px auto; }
label { display: block; margin: 10px 0; }
input[type=text], input:not([type]), input[type=password] {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; min-height: 44px;
  font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; padding: 8px 12px; }
label.check { display: inline-flex; align-items: center; gap: 6px; margin: 6px 14px 6px 0; min-height: 44px; }
label.check input { width: 20px; height: 20px; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px;
  font: inherit; border: 1px solid var(--green); border-radius: 8px; background: #fff; color: var(--green);
  cursor: pointer; text-decoration: none;
}
button.primary, .button.primary { background: var(--green); color: #fff; }
button.danger { border-color: var(--red); color: var(--red); }
button.link { border: 0; background: none; padding: 0; min-height: 0; text-decoration: underline; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li.locked { opacity: .6; }
.list form { margin: 0; }
.name { font-weight: 600; }
.muted { color: var(--muted); font-size: .92rem; }
.error { background: var(--red-bg); color: var(--red); padding: 8px 12px; border-radius: 8px; }
.warn { background: var(--warn-bg); padding: 8px 12px; border-radius: 8px; }
.ok { background: var(--ok-bg); padding: 8px 12px; border-radius: 8px; }
.tag { display: inline-block; font-size: .8rem; padding: 1px 8px; border-radius: 10px; background: var(--green-2); margin-left: 4px; }
.warn-tag { background: var(--warn-bg); }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; overflow-x: auto;
  background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a { flex: 1 0 auto; min-height: 56px; display: flex; align-items: center; justify-content: center; padding: 0 12px; text-decoration: none; color: var(--muted); }
.tabs a[aria-current=page] { color: var(--green); font-weight: 700; box-shadow: inset 0 3px 0 var(--green); }

/* ---------- đợt 1: khách, Hôm nay ---------- */
[hidden] { display: none !important; }   /* để các khối display:flex vẫn ẩn được bằng thuộc tính hidden */
body { padding-bottom: 132px; }   /* chừa chỗ cho thanh tab và nút Khách mới */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button.sm, .button.sm { min-height: 40px; padding: 6px 12px; font-size: .95rem; }
.seg { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0 12px; padding-bottom: 2px; }
.seg.wrap-seg { flex-wrap: wrap; overflow: visible; }
.seg a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 20px; background: #fff; color: var(--ink); text-decoration: none; font-size: .95rem; }
.seg a[aria-current=page] { background: var(--green); border-color: var(--green); color: #fff; }
.search { display: flex; gap: 8px; align-items: center; }
.search input { flex: 1; margin-top: 0; }
.group { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 12px 0; }
.group h2 { display: flex; justify-content: space-between; margin: 4px 0; }
.group.red { border-left-color: var(--red); }
.group.green { border-left-color: var(--green); }
.group.amber { border-left-color: var(--gold); }
.group.grey { border-left-color: #9aa8a3; }
.item { padding: 10px 0; border-top: 1px solid var(--line); }
.group h2 + .item { border-top: 0; }
.item .t a { font-weight: 600; text-decoration: none; }
.item .d { color: var(--muted); font-size: .92rem; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: flex-start; }
.acts form { margin: 0; }
details.snooze > summary { list-style: none; }
details.snooze > summary::-webkit-details-marker { display: none; }
.lead-card { display: block; color: var(--ink); text-decoration: none; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { display: inline-block; font-size: .85rem; padding: 2px 10px; border-radius: 12px; background: var(--ok-bg); color: var(--green); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.grey { background: #eef1f0; color: var(--muted); }
.chip.dark { background: var(--green-2); color: var(--ink); }
.chips-in { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 10px 0; }
.chips-in legend { width: 100%; margin-bottom: 4px; padding: 0; }
.chips-in details { width: 100%; }
.chip-in { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 0; padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 22px; background: #fff; cursor: pointer; }
.chip-in input { width: 18px; height: 18px; margin: 0; }
.chip-in:has(input:checked) { background: var(--green-2); border-color: var(--green); font-weight: 600; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
select { display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 8px 10px; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input[type=tel], input[type=date], input[type=search], textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; min-height: 44px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; }
dl.info { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; }
.pre { white-space: pre-wrap; }
details.card > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.fab { position: fixed; right: 16px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 5; display: inline-flex; align-items: center;
  min-height: 48px; padding: 0 18px; border-radius: 24px; background: var(--gold); color: var(--ink); font-weight: 700;
  text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.fab .full { display: inline; }
.fab .plus { display: none; font-size: 1.6rem; line-height: 1; }
.fab.mini { width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; }
.fab.mini .full { display: none; }
.fab.mini .plus { display: inline; }
@media (max-width: 480px) {
  dl.info { grid-template-columns: 1fr; }
  dl.info dd { margin-bottom: 6px; }
}
