/* =========================================================
   MÀU THƯƠNG HIỆU NITE TEAM (lấy từ niteteam.agency)
   Chỉ cần đổi ở đây là toàn bộ giao diện đổi theo
   ========================================================= */
:root {
  --red: #e00000;          /* đỏ chính */
  --red-dark: #c10000;     /* đỏ đậm (hover) */
  --orange: #f79120;       /* cam */
  --accent: #ffc58a;       /* màu nhấn kem cam */
  --grad: linear-gradient(90deg, #ee312b, #f79120);          /* dải màu logo */
  --nite-gradient: linear-gradient(180deg, #090000 0%, #230000 18%, #4a0000 40%, #850000 62%, #ca0001 80%, #f62900 92%, #fe7001 100%);
  --ink: #111;

  --brand: var(--red);
  --brand-dark: var(--red-dark);
  --brand-soft: #fff0ea;
  --side: #0b0000;
  --side-text: rgba(255,255,255,.72);
  --head: #160303;
  --head-text: #ffffff;

  --bg: #f7f5f3; --card: #fff; --text: #111; --muted: #6e6762; --line: #ebe5e1; --grid: #efeae6;
  --ok: #18a058; --warn: #e07b00; --bad: #c10000; --info: #d4380d;
  --radius: 16px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 13.5px; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 4px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 15px; margin: 0; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- Bố cục ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 228px; background: linear-gradient(180deg, #090000 0%, #1c0000 55%, #3a0000 100%); color: var(--side-text); padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.logo { color: #fff; padding: 6px 8px 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.logo .nite-logo { height: 34px; width: auto; display: block; }
.logo small { color: var(--accent); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding-left: 2px; }
.logo.dark { color: var(--ink); padding: 0 0 6px; }
.logo.dark small { color: var(--red); }
.nav a { display: block; color: var(--side-text); padding: 10px 14px; border-radius: 999px; margin-bottom: 2px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a.active { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(238,49,43,.35); }
.side-foot { margin-top: auto; font-size: 12px; padding: 10px 8px; border-top: 1px solid rgba(255,255,255,.1); }
.side-foot b { color: #fff; display: block; margin-bottom: 2px; }
.role-tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; margin: 6px 0 8px; background: rgba(255,197,138,.15); color: var(--accent); }
.main { flex: 1; padding: 24px 28px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- Thẻ & KPI ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 10px 14px; }
.kpi span { display: block; font-size: 12px; color: var(--muted); }
.kpi b { display: block; font-size: 21px; margin-top: 2px; font-weight: 800; }
.kpi em { display: block; font-style: normal; font-size: 11px; color: var(--warn); margin-top: 2px; }
.kpi.ok { border-left-color: var(--ok); }
.kpi.bad { border-left-color: var(--bad); }
.kpi.private { border-left-color: var(--orange); background: #fffaf5; }
.pos { color: var(--ok); }
.warn-t { color: var(--warn); font-size: 12px; }

/* ---------- Bảng dạng Google Sheet ---------- */
.sheet-wrap { overflow: auto; max-height: 70vh; }
table.sheet { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.sheet th { box-shadow: inset 0 -2px 0 var(--red); position: sticky; top: 0; z-index: 2; background: var(--head); color: var(--head-text); font-weight: 600; text-align: left; padding: 8px 10px; white-space: nowrap; border-right: 1px solid rgba(255,255,255,.12); }
.sheet td { padding: 7px 10px; border-bottom: 1px solid var(--grid); border-right: 1px solid var(--grid); vertical-align: middle; background: #fff; }
.sheet tbody tr:nth-child(even) td { background: #fcfaf9; }
.sheet tbody tr:hover td { background: var(--brand-soft); }
.sheet tr.click { cursor: pointer; }
.sheet tr.picked td { background: #effaf3; }
.sheet tr.picked:hover td { background: #e2f5e9; }
.sheet tr.cancel td { color: #9aa0ad; }
.sheet tr.cancel td b { text-decoration: line-through; }
.sheet td.c, .sheet th.c { text-align: center; }
.sheet td.r, .sheet th.r { text-align: right; }
.sheet td.priv { background: #fff7ef !important; }
.sheet tfoot td { background: #fbf3ec; border-top: 2px solid var(--line); position: sticky; bottom: 0; }
.sheet td.empty { text-align: center; color: var(--muted); padding: 28px; }
.sheet input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.sheet textarea, .sheet select { font-size: 12px; padding: 4px 6px; min-height: 0; border-radius: 6px; }
.sheet textarea { min-width: 150px; resize: vertical; }
.sheet-note { padding: 8px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Nút & form ---------- */
.btn { font-family: inherit; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 15px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: #c4c9d6; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(238,49,43,.28); }
.btn.primary:hover { filter: brightness(.94); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: #fff; width: 100%; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { min-height: 64px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.field { margin-bottom: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-weight: 600; font-size: 13px; margin: 6px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); grid-column: 1 / -1; color: var(--text); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters > input, .filters > select { width: auto; min-width: 130px; padding: 6px 9px; font-size: 12.5px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); margin: 0; }
.check input { width: auto; accent-color: var(--brand); }

/* ---------- Nhãn ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; background: #eef0f5; color: #4a5266; }
.st-de_xuat { background: #eef0f5; color: #4a5266; }
.st-bao_gia { background: #fff4e0; color: #b26a00; }
.st-chot { background: #e5f0ff; color: #1f5fcc; }
.st-len_lich { background: #efe8ff; color: #6a3fd1; }
.st-cho_video { background: #fff1e3; color: #c25a00; }
.st-da_dang { background: #e4f7ec; color: #12804a; }
.st-huy { background: #f3f3f3; color: #9a9a9a; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #f1f3f8; font-size: 11px; margin: 0 4px 4px 0; color: #4a5266; }
.lock { font-size: 11px; }
.reason { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 6px; margin: 1px 3px 1px 0; }
.reason.ok { background: #e4f7ec; color: #12804a; }
.reason.bad { background: #fdecef; color: #c4244a; }
.reason.mid { background: #fff4e0; color: #b26a00; }
.stars { color: #e6a23c; }

/* Thanh tiến độ & điểm */
.bar { display: inline-block; vertical-align: middle; width: 70px; height: 7px; background: #eef0f5; border-radius: 99px; overflow: hidden; margin-right: 6px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.score { display: flex; align-items: center; gap: 6px; }
.score .bar { flex: 1; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; white-space: nowrap; }
.tabs a.active { color: var(--red); border-image: var(--grad) 1; text-decoration: none; }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* ---------- Lịch ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.cal .dow { background: var(--head); color: var(--head-text); padding: 7px; font-size: 12px; font-weight: 600; text-align: center; }
.cal .day { min-height: 100px; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: 5px; font-size: 11.5px; }
.cal .day:nth-child(7n) { border-right: none; }
.cal .day.other { background: #fafbfc; color: #b5bac6; }
.cal .day.today .num { background: var(--grad); color: #fff; border-radius: 99px; padding: 1px 7px; }
.cal .num { font-weight: 600; margin-bottom: 3px; display: inline-block; }
.ev { display: block; background: var(--brand-soft); color: var(--brand-dark); border-left: 3px solid var(--brand); border-radius: 4px; padding: 3px 5px; margin-bottom: 3px; cursor: pointer; line-height: 1.3; overflow: hidden; }
.ev.done { background: #e4f7ec; color: #12804a; border-color: var(--ok); }

/* ---------- Modal, toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 20, 35, .45); display: flex; align-items: flex-start; justify-content: center; padding: 36px 16px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: 22px; width: 100%; max-width: 760px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.x { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.info-row { display: flex; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.info-row .k { color: var(--muted); min-width: 90px; }
.brief-box { white-space: pre-wrap; background: #fbf6f2; padding: 14px; border-radius: 8px; line-height: 1.55; }
.priv-box { background: #fff8fa; border: 1px dashed #f1b7c4; margin-top: 10px; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; }
#toast div { background: #1d2433; color: #fff; padding: 10px 18px; border-radius: 8px; margin-top: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
#toast div.err { background: var(--bad); }

/* ---------- Đăng nhập ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--nite-gradient); padding: 24px 16px 40px; }
.login { background: #fff; border-radius: 28px; padding: 34px; box-shadow: 0 30px 80px rgba(0,0,0,.35); width: 100%; max-width: 380px; }
.demo { background: #fbf6f2; border-radius: 10px; padding: 12px; margin-top: 16px; font-size: 12px; }
.demo button { margin: 6px 4px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 30px; }

/* Điện thoại: menu trái chuyển thành thanh trên cùng, kéo ngang được */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { position: sticky; top: 0; z-index: 30; width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px 8px; gap: 8px; }
  .logo { padding: 0; flex-direction: row; align-items: center; gap: 8px; }
  .logo .nite-logo { height: 24px; }
  .logo small { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .side-foot b, .side-foot .role-tag, .side-foot br { display: none; }
  .nav { order: 3; width: 100%; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 7px 13px; margin: 0; font-size: 13px; }
  .main { padding: 14px 12px; }
  h1 { font-size: 20px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 18px; }
  .funnel .step b { font-size: 24px; }
  .banner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-bg { padding: 10px; }
  .modal { padding: 16px; border-radius: 18px; }
  .card-head { padding: 10px 12px; }
  .filters > input, .filters > select { min-width: 0; flex: 1 1 45%; }
  .sheet-wrap { max-height: none; }
  .cal .day { min-height: 70px; padding: 3px; font-size: 10px; }
  .ev { font-size: 10px; padding: 2px 3px; }
}

/* In lịch cửa hàng: chỉ in bảng */
@media print {
  .sidebar, .page-head .btn-row, .tabs, .kpis, .filters, .card-head .btn { display: none !important; }
  .main { padding: 0; }
  .sheet-wrap { max-height: none; overflow: visible; }
  .sheet th { background: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Việc cần làm (nội bộ) ---------- */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.todo-chip { font-family: inherit; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; border-top: 4px solid var(--muted); }
.todo-chip b { font-size: 24px; font-weight: 800; }
.todo-chip span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.todo-chip.bad { border-top-color: var(--bad); } .todo-chip.bad b { color: var(--bad); }
.todo-chip.warn { border-top-color: var(--orange); } .todo-chip.warn b { color: #c25a00; }
.todo-chip.info { border-top-color: var(--red); }
.todo-chip.done { border-top-color: var(--ok); opacity: .75; } .todo-chip.done b { color: var(--ok); }
.todo-chip:hover { box-shadow: 0 6px 18px rgba(0,0,0,.07); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--muted); vertical-align: middle; }
.dot.bad { background: var(--bad); } .dot.warn { background: var(--orange); } .dot.info { background: var(--red); }
.count { display: inline-block; background: var(--brand-soft); color: var(--red); border-radius: 99px; padding: 1px 9px; font-size: 12px; margin-left: 6px; }
.st-noshow { background: #fde8e8; color: var(--bad); }

/* ---------- Khách hàng ---------- */
.eyebrow { font-size: 12px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--grad); color: #fff; border-radius: 16px; padding: 14px 18px; margin-bottom: 16px; box-shadow: 0 8px 22px rgba(238,49,43,.25); }
.banner:hover { text-decoration: none; filter: brightness(.97); }
.banner b { font-size: 15px; }
.funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.funnel .step { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; position: relative; }
.funnel .step b { display: block; font-size: 30px; font-weight: 800; margin: 2px 0; }
.step-n { position: absolute; top: 12px; right: 14px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--red); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.step-t { font-weight: 600; color: var(--muted); font-size: 13px; }
.bar.wide { width: 100%; margin: 8px 0 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .funnel, .grid2 { grid-template-columns: 1fr 1fr; } .grid2 { grid-template-columns: 1fr; } }

/* ---------- Cửa hàng (điện thoại) ---------- */
body.store-mode { background: #f4efeb; }
.store { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: 30px; }
.store-head { background: var(--nite-gradient); color: #fff; padding: 22px 20px 26px; border-radius: 0 0 26px 26px; }
.store-head .nite-logo { height: 28px; width: auto; display: block; margin-bottom: 14px; }
.store-head h1 { font-size: 26px; margin: 0 0 2px; }
.store-head div { font-size: 13px; opacity: .85; }
.store-head .store-sub { margin-top: 10px; color: var(--accent); opacity: 1; font-weight: 600; }
.seg { display: flex; gap: 6px; margin: 14px 14px 10px; background: #fff; padding: 5px; border-radius: 999px; border: 1px solid var(--line); position: sticky; top: 8px; z-index: 5; }
.seg button { flex: 1; font-family: inherit; border: none; background: none; padding: 10px 6px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg button b { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: #f1ece8; color: var(--text); font-size: 12px; margin-left: 4px; }
.seg button.on { background: var(--grad); color: #fff; }
.seg button.on b { background: rgba(255,255,255,.25); color: #fff; }
.visits { padding: 0 14px; }
.visit { display: flex; gap: 14px; background: #fff; border-radius: 18px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); border-left: 5px solid var(--red); }
.visit.arrived { border-left-color: var(--ok); }
.visit.no_show { border-left-color: #999; opacity: .8; }
.visit-time { min-width: 62px; }
.visit-time b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.visit-time span { font-size: 12px; color: var(--muted); }
.visit-time em { display: block; font-style: normal; font-size: 12px; color: var(--red); font-weight: 600; margin-top: 4px; }
.visit-body { flex: 1; min-width: 0; }
.visit-name { font-size: 17px; font-weight: 700; }
.visit-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.visit-tags span { background: #fbf3ec; border-radius: 99px; padding: 4px 10px; font-size: 13px; }
.visit-prep { font-size: 13px; background: #fff8e8; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.visit-actions { display: flex; gap: 8px; margin-top: 12px; }
.visit-actions .btn { flex: 1; justify-content: center; padding: 11px; font-size: 15px; }
.visit-done { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ok); }
.visit.no_show .visit-done { color: var(--bad); }
.link-btn { border: none; background: none; color: var(--info); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.store-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* =================== BẢN GỌN: danh sách dự án, bảng cột, khung chi tiết =================== */
.side-link { color: var(--accent); font-size: 12px; display: inline-block; margin: 0 0 8px; }
.side-link.active { color: #fff; text-decoration: underline; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pcard { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--text); }
.pcard:hover { text-decoration: none; border-color: #d8cfc9; box-shadow: 0 8px 22px rgba(0,0,0,.06); }
.pcard-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pcard-top b { font-size: 15px; }
.stack { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: #f1ece8; margin: 14px 0 8px; gap: 2px; }
.stack i, .stack-legend i { display: block; }
.s0 { background: #c9c2bd; } .s1 { background: #f79120; } .s2 { background: #8b5cf6; } .s3 { background: #ee312b; } .s4 { background: var(--ok); }
.stack-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); }
.stack-legend span { display: inline-flex; align-items: center; gap: 5px; }
.stack-legend i { width: 8px; height: 8px; border-radius: 50%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-family: inherit; font-size: 12px; font-weight: 600; border: 1px solid transparent; border-radius: 99px; padding: 4px 11px; background: #f1ece8; color: var(--muted); cursor: pointer; }
.chip.bad { background: #fde8e8; color: var(--bad); }
.chip.warn { background: #fff1e3; color: #b85600; }
.chip.on { border-color: currentColor; box-shadow: 0 0 0 1px currentColor inset; }
.chip.clear { background: #fff; border-color: var(--line); }
.viewbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.viewbar input, .viewbar select { width: auto; min-width: 160px; padding: 6px 10px; font-size: 13px; }
.seg-sm { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.seg-sm a { padding: 6px 16px; border-radius: 99px; color: var(--muted); font-weight: 600; }
.seg-sm a:hover { text-decoration: none; color: var(--text); }
.seg-sm a.on { background: var(--head); color: #fff; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.bcol { background: #efe9e5; border-radius: 14px; padding: 8px; min-height: 120px; transition: background .15s; }
.bcol.over { background: #ffe3d6; }
.bcol-h { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 8px; font-weight: 700; font-size: 13px; }
.bcol-h b { background: #fff; border-radius: 99px; padding: 1px 9px; font-size: 12px; }
.bcol[data-col="huy"] { opacity: .75; }
.bcol-list { display: flex; flex-direction: column; gap: 7px; max-height: 68vh; overflow-y: auto; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 9px 10px; cursor: pointer; line-height: 1.4; }
.kcard:hover { border-color: #cfc5bf; }
.kcard.sel { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.kcard.drag { opacity: .4; }
.kcard-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kcard-top b { font-size: 13.5px; }
.kcard-line { margin-top: 5px; }
.kcard-line .badge { margin-top: 4px; }
.bempty { border: 1.5px dashed #d6ccc6; border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); font-size: 12px; }
.pill { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: #f1ece8; color: #5c534e; margin-top: 2px; }
.pill.ok { background: #e4f7ec; color: #12804a; }
.pill.bad { background: #fde8e8; color: var(--bad); }
.pill.warn { background: #fff1e3; color: #b85600; }
.paydot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--bad); }
.paydot.coc { background: var(--orange); } .paydot.da_tt { background: var(--ok); }

.agenda-day { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.agenda-date { width: 46px; text-align: center; flex-shrink: 0; color: var(--muted); font-size: 11px; display: flex; flex-direction: column; }
.agenda-date b { font-size: 22px; color: var(--text); line-height: 1.1; }
.agenda-date.today b { color: var(--red); }
.agenda-items { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.agenda-item { display: flex; gap: 12px; padding: 8px 10px; border-radius: 10px; background: #faf7f5; cursor: pointer; }
.agenda-item:hover { background: var(--brand-soft); }
.agenda-item > b { min-width: 44px; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100%; background: #fff; border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(0,0,0,.12); z-index: 40; display: flex; flex-direction: column; animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: .4; } }
.drawer-head { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head b { font-size: 16px; }
.drawer-head .x { margin-left: auto; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 18px 18px; }
.dsec { padding: 12px 0; border-bottom: 1px solid var(--grid); }
.dsec h3 { font-size: 13px; margin: 0 0 6px; }
.dsec.priv { background: #fffaf5; margin: 0 -18px; padding: 12px 18px; }
.drow { display: flex; gap: 10px; font-size: 13px; padding: 4px 0; }
.drow > span { color: var(--muted); width: 120px; flex-shrink: 0; }
.drow > div { flex: 1; min-width: 0; word-break: break-word; }
.drow select, .dsec > select { padding: 5px 8px; font-size: 13px; }
.drawer-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.drawer-foot .btn { flex: 1; justify-content: center; }

/* =================== TRANG KHÁCH (một trang, điện thoại + máy tính) =================== */
body.client-mode { background: #f7f3f0; }
.ctop { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: #0b0000; }
.ctop .nite-logo { height: 26px; width: auto; display: block; }
.ctop select { margin-left: auto; width: auto; max-width: 55%; padding: 6px 10px; font-size: 13px; border-radius: 99px; }
.ctop .btn.ghost { margin-left: auto; }
.ctop select + .btn.ghost { margin-left: 0; }
.cwrap { max-width: 980px; margin: 0 auto; padding: 0 16px 30px; }
.chero { background: var(--nite-gradient); color: #fff; border-radius: 0 0 26px 26px; padding: 22px 22px 18px; margin: 0 -16px; }
.chero h1 { font-size: 26px; margin: 4px 0; }
.ckpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.ckpis div { background: rgba(255,255,255,.1); border-radius: 14px; padding: 10px 12px; }
.ckpis span { display: block; font-size: 12px; opacity: .8; }
.ckpis b { font-size: 22px; font-weight: 800; }
.cnav { position: sticky; top: 0; z-index: 10; display: flex; gap: 6px; background: #f7f3f0; padding: 12px 0 8px; overflow-x: auto; }
.cnav a { white-space: nowrap; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 8px 16px; font-weight: 600; color: var(--text); }
.cnav a:hover { text-decoration: none; border-color: var(--red); }
.cnav a b { background: var(--red); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.csec { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-top: 12px; scroll-margin-top: 100px; }
.csec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.csec-h h2 { font-size: 18px; }
.cnote { background: #fff4ec; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 12px; line-height: 1.5; }
.cnote.ok { background: #e9f8ef; color: #0f6b3d; }
.cfilter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.cfilter button { font-family: inherit; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 13px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.cfilter button b { color: var(--text); margin-left: 3px; }
.cfilter button.on { background: var(--head); color: #fff; border-color: var(--head); }
.cfilter button.on b { color: var(--accent); }
.cfilter select { width: auto; margin-left: auto; padding: 7px 10px; font-size: 13px; border-radius: 99px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 10px; }
.ccard { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; }
.ccard.picked { border-color: #9ad8b4; background: #f5fcf8; }
.ccard.skipped { opacity: .65; }
.ccard-top { display: flex; gap: 10px; align-items: center; }
.ccard-name { flex: 1; min-width: 0; }
.ccard-name b { font-size: 15px; }
.ccard-price { font-weight: 700; white-space: nowrap; }
.ccard-meta { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 6px; }
.ccard-meta span { background: #f6f1ee; border-radius: 99px; padding: 3px 9px; font-size: 12px; }
.ccard-act { display: flex; gap: 6px; margin-top: 12px; }
.cbtn { flex: 1; font-family: inherit; font-size: 14px; font-weight: 600; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--text); }
.cbtn.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.cbtn.no.on { background: #6e6762; border-color: #6e6762; color: #fff; }
.cbtn.fbk { flex: 0 0 auto; padding: 10px 12px; }
.cbtn.fbk.has { border-color: var(--orange); color: #b85600; }
.ccard-fb { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.ccard-fb[hidden] { display: none; }
.ccard-fb textarea { width: 100%; font-size: 13px; }
.cday { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.cday-date { width: 46px; flex-shrink: 0; text-align: center; color: var(--muted); font-size: 11px; display: flex; flex-direction: column; background: #faf5f2; border-radius: 12px; padding: 6px 0; }
.cday-date b { font-size: 20px; color: var(--text); line-height: 1.1; }
.cday-body { flex: 1; min-width: 0; line-height: 1.5; }
.csec details summary { cursor: pointer; color: var(--info); margin-top: 10px; }
.cvid { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--grid); }

@media (max-width: 760px) {
  .side-link { display: none; }
  .pgrid { grid-template-columns: 1fr; }
  .viewbar input { flex: 1; min-width: 0; }
  .viewbar .btn { margin-left: 0 !important; }
  .board { grid-auto-columns: 82%; scroll-snap-type: x mandatory; }
  .bcol { scroll-snap-align: start; }
  .bcol-list { max-height: none; }
  .drawer { width: 100%; top: auto; height: 86vh; border-radius: 22px 22px 0 0; border-left: 0; animation: slideup .2s ease-out; }
  @keyframes slideup { from { transform: translateY(40px); opacity: .4; } }
  .chero { padding: 18px 16px 14px; }
  .chero h1 { font-size: 21px; }
  .ckpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ckpis b { font-size: 19px; }
  .csec { padding: 14px; border-radius: 16px; }
  .cgrid { grid-template-columns: minmax(0, 1fr); }
  .cfilter select { margin-left: 0; flex: 1; }
}
.viewbar input[type=checkbox] { min-width: 0; width: auto; }
.count { white-space: nowrap; }

/* Logo chuyển động lớn trên trang đăng nhập */
.login-brand { width: min(620px, 92vw); aspect-ratio: 440 / 200; display: grid; place-items: center; }
.nite-motion { display: block; width: 100%; height: auto; }
.nite-motion.big { filter: drop-shadow(0 10px 40px rgba(247,145,32,.25)); }
.login-title { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); margin-bottom: 4px; }
.login p.muted { margin-top: 4px; }
@media (max-width: 760px) {
  .login-wrap { justify-content: flex-start; padding-top: 28px; }
  .login { padding: 24px; }
}

/* =================== Quy trình 7 bước, brief, logo khách, báo cáo nghiệm thu =================== */
.s0 { background: #c9c2bd; } .s1 { background: #ffc58a; } .s2 { background: #f79120; } .s3 { background: #3b82f6; } .s4 { background: #8b5cf6; } .s5 { background: #ee312b; } .s6 { background: var(--ok); }
.chip.info { background: #e8f0ff; color: #1f5fcc; }
.bcol-h span small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.board { grid-auto-columns: minmax(210px, 1fr); }
.fbq { font-size: 12px; font-style: italic; color: #5c534e; margin: 4px 0 2px; overflow-wrap: anywhere; }
a.logo { text-decoration: none; }
.logo .nite-motion { width: 190px; margin: -18px 0 -14px -12px; }
.ptitle { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.ptitle h1 { margin: 0; }
.clogo { height: 44px; width: auto; max-width: 120px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; }
.clogo-sm { height: 28px; max-width: 80px; object-fit: contain; }
.logo-pick { display: flex; gap: 14px; align-items: center; }
.logo-prev { width: 110px; height: 70px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: #fff; flex-shrink: 0; }
.logo-prev img { max-width: 96px; max-height: 56px; object-fit: contain; }
.brief-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; margin-bottom: 12px; }
.brief-card summary { cursor: pointer; }
.empty-brief { color: var(--muted); font-size: 13px; }
.brief-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.brief-facts div { background: #faf6f3; border-radius: 10px; padding: 8px 10px; }
.brief-facts span { display: block; font-size: 11.5px; color: var(--muted); }
.brief-facts b { font-size: 13.5px; }
.brief-text { white-space: pre-wrap; line-height: 1.6; margin-top: 10px; font-size: 13.5px; max-height: 360px; overflow: auto; background: #fbf8f6; border-radius: 10px; padding: 12px; }
.csec .brief-card { border: 0; padding: 0; margin: 0; }
.csec .brief-card summary { font-size: 18px; }
.csec .brief-text { max-height: none; }
.cbrand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cbrand .nite-motion { width: 170px; margin: -16px -10px -14px -14px; }
.cbrand > span { font-size: 20px; opacity: .7; }
.clogo-box { background: #fff; border-radius: 12px; padding: 6px 10px; height: 52px; display: grid; place-items: center; }
.clogo-box img { max-height: 40px; max-width: 120px; object-fit: contain; }
.fb-quick { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.fb-quick button { font-family: inherit; font-size: 12.5px; border: 1px solid var(--line); background: #faf6f3; border-radius: 99px; padding: 6px 11px; cursor: pointer; }
.fb-quick button:hover { border-color: var(--orange); }
.report-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.report { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px; margin-bottom: 20px; }
.report-head { text-align: center; border-bottom: 2px solid var(--red); padding-bottom: 16px; margin-bottom: 16px; }
.report-logos { display: flex; justify-content: center; align-items: center; gap: 14px; margin-bottom: 12px; }
.report-logos .nite-logo { height: 40px; width: auto; }
.report-logos .clogo { height: 46px; border: 0; padding: 0; }
.report-logos .x { font-size: 20px; color: var(--muted); }
.report-title { font-size: 24px; font-weight: 800; letter-spacing: .04em; color: var(--red); }
.report-sub { font-size: 17px; font-weight: 700; margin: 4px 0; }
.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.report-kpis div { background: #faf6f3; border-radius: 12px; padding: 10px 12px; }
.report-kpis span { display: block; font-size: 12px; color: var(--muted); }
.report-kpis b { font-size: 20px; font-weight: 800; }
.report-kpis em { display: block; font-style: normal; font-size: 11.5px; color: var(--ok); }
.report-table .sheet-wrap { max-height: none; }
.rin { width: 90px; padding: 4px 6px; font-size: 12.5px; text-align: right; }
.report-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; text-align: center; }
.report-sign div { min-height: 110px; }
.report-sign span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 760px) {
  .report { padding: 14px; border-radius: 14px; }
  .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-title { font-size: 19px; }
  .logo .nite-motion { width: 120px; margin: -12px 0 -10px -8px; }
  .cbrand .nite-motion { width: 130px; }
}
@media print {
  body.printing-report .sidebar, body.printing-report .page-head, body.printing-report .chips, body.printing-report .viewbar,
  body.printing-report .brief-card, body.printing-report .no-print, body.printing-report .ctop, body.printing-report #drawer { display: none !important; }
  body.printing-report .main { padding: 0; }
  body.printing-report .report { border: 0; padding: 0; }
  body.printing-report .sheet th { background: #222 !important; color: #fff !important; }
  body.printing-report * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rin { border: 0; width: auto; }
}

.ctop { justify-content: flex-end; padding: 8px 14px; }
.ctop select { margin-left: 0; margin-right: auto; }
.chero { border-radius: 0 0 26px 26px; }
@media (max-width: 760px) {
  .brief-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .csec .brief-text { max-height: 260px; }
  .cnav { top: 0; }
}
.ctop { position: static; }

/* Báo cáo nghiệm thu: video nổi bật + nhận xét */
.report-h { font-size: 15px; margin: 18px 0 10px; padding-left: 10px; border-left: 4px solid var(--red); border-radius: 0; }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tv { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: #fff; break-inside: avoid; }
.tv-thumb { position: relative; width: 96px; flex-shrink: 0; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: var(--nite-gradient); display: block; }
.tv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tv-rank { position: absolute; top: 6px; left: 6px; background: var(--red); color: #fff; font-weight: 800; font-size: 12px; border-radius: 8px; padding: 1px 7px; }
.tv-play { position: absolute; bottom: 6px; left: 6px; right: 6px; text-align: center; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; border-radius: 8px; padding: 3px; }
.tv-thumb:hover { text-decoration: none; }
.tv-body { flex: 1; min-width: 0; }
.tv-body > b { font-size: 14.5px; }
.tv-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 8px 0; }
.tv-stats div { background: #faf6f3; border-radius: 8px; padding: 4px 6px; text-align: center; }
.tv-stats b { display: block; font-size: 14px; }
.tv-stats span { font-size: 10.5px; color: var(--muted); }
.tv-review { font-size: 12.5px; background: #fff4ec; border-radius: 10px; padding: 7px 9px; line-height: 1.45; }
.tv-review span { display: block; font-size: 11px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .04em; }
.rrev { width: 100%; min-width: 200px; font-size: 12.5px; padding: 5px 7px; }
.star { border: 0; background: none; font-size: 18px; cursor: pointer; color: #c9c2bd; }
.star.on { color: #f5a300; }
@media print { .report-table td.no-print, .report-table th.no-print { display: none; } .rrev { border: 0; resize: none; } .tv { border-color: #ddd; } }

/* Bước khách duyệt demo + hình thức thanh toán */
.st-duyet_demo { background: #fdf0ff; color: #9b2fb5; }
.s7 { background: var(--ok); } .s6 { background: #c25ad6; }
.dcard { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.dcard.ok { border-color: #9ad8b4; background: #f5fcf8; }
.dcard.sua { border-color: #f3b4b4; background: #fff7f7; }
.dcard-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.dcard .btn { justify-content: center; }
.dcap { background: #faf6f3; border-radius: 10px; padding: 9px 11px; font-size: 13px; white-space: pre-wrap; line-height: 1.5; }
.dcap span { display: block; font-size: 11px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.csec-h { flex-wrap: wrap; } .csec-h h2 { margin-right: auto; }

/* Logo khách to hơn (logo dọc như Gong Cha vẫn rõ) */
.clogo { height: 64px; max-width: 140px; padding: 4px 8px; }
.report-logos .clogo { height: 72px; max-width: 160px; }
.clogo-box { height: 72px; padding: 6px 10px; }
.clogo-box img { max-height: 60px; max-width: 140px; }
.pcard-logo { width: 46px; height: 56px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; flex-shrink: 0; }
.pcard-top { align-items: center; }

/* Soạn tin hỏi cast */
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#m-body { width: 100%; font-family: inherit; font-size: 14px; line-height: 1.5; }

/* Trang khách: lọc khu vực + tìm kiếm */
.creg-row { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; align-items: center; }
.creg-row::-webkit-scrollbar { display: none; }
.creg-l { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: 2px; flex-shrink: 0; }
.creg-row button { flex-shrink: 0; font-family: inherit; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font-weight: 600; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; }
.creg-row button b { color: var(--muted); margin-left: 3px; font-weight: 700; }
.creg-row button.on { background: var(--red); border-color: var(--red); color: #fff; }
.creg-row button.on b { color: #fff; }
.ctools { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.ctools input { flex: 1; min-width: 180px; border-radius: 99px; padding: 8px 14px; font-size: 14px; }
.ctools select { width: auto; border-radius: 99px; padding: 8px 12px; font-size: 13px; }
@media (max-width: 640px) { .ctools select { flex: 1; } }

/* ===== Bộ xem lịch quay dùng chung (khách + cửa hàng) ===== */
.sb-views { display: inline-flex; flex-wrap: wrap; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 4px; margin-bottom: 10px; max-width: 100%; }
.sb-views button { font-family: inherit; border: 0; background: none; border-radius: 99px; padding: 7px 14px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.sb-views button.on { background: var(--head); color: #fff; }
.sb-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.sb-filters select, .sb-filters input[type=date] { width: auto; border-radius: 99px; padding: 7px 12px; font-size: 13px; }
.sb-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.sb-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.sb-cal .dow { background: var(--head); color: #fff; padding: 7px 2px; font-size: 12px; font-weight: 700; text-align: center; }
.sb-day { min-height: 104px; border-right: 1px solid #f0e9e4; border-bottom: 1px solid #f0e9e4; padding: 5px; font-size: 11.5px; cursor: pointer; position: relative; min-width: 0; }
.sb-day:nth-child(7n) { border-right: 0; }
.sb-day.other { background: #fbf9f7; color: #c3bbb5; }
.sb-day:hover { background: #fff8f3; }
.sb-day.sel { box-shadow: inset 0 0 0 2px var(--red); }
.sb-day .num { font-weight: 700; display: inline-block; margin-bottom: 3px; }
.sb-day.today .num { background: var(--grad); color: #fff; border-radius: 99px; padding: 0 7px; }
.sb-cnt { display: none; }
.sb-ev { background: #fff1e8; border-left: 3px solid var(--red); border-radius: 6px; padding: 3px 6px; margin-bottom: 3px; line-height: 1.3; cursor: pointer; overflow: hidden; font-size: 11.5px; }
.sb-ev span { display: block; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-ev.done, .sb-ev.arrived { background: #e8f7ee; border-color: #1f9d55; }
.sb-ev.no_show { background: #fdecec; border-color: #d33; }
.sb-more { font-size: 10.5px; color: var(--muted); font-weight: 600; padding-left: 4px; }
.sb-hint { margin-top: 6px; }
.sb-ck { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.sb-ck.ok { background: #e8f7ee; color: #12804a; }
.sb-ck.bad { background: #fdecec; color: #c22; }
.sb-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.sb-cols.week { grid-auto-columns: minmax(150px, 1fr); }
.sb-col { background: #faf6f3; border: 1px solid var(--line); border-radius: 14px; padding: 8px; min-width: 0; }
.sb-col.today { border-color: var(--red); background: #fff6f0; }
.sb-col-h { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; font-size: 13px; }
.sb-col-h span { background: var(--head); color: #fff; border-radius: 99px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.sb-col .sb-ev { background: #fff; font-size: 12.5px; padding: 7px 9px; margin-bottom: 6px; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.sb-col .sb-ev span { font-size: 11.5px; white-space: normal; }
.sb-empty { color: #c3bbb5; text-align: center; padding: 10px 0; font-size: 13px; }
.sb-sheet-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.sb-sheet { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.sb-sheet th { background: var(--head); color: #fff; text-align: left; padding: 8px 10px; font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
.sb-sheet td { padding: 8px 10px; border-bottom: 1px solid #f0e9e4; vertical-align: top; }
.sb-sheet tr.today td { background: #fff6f0; }
.sb-sheet tr.arrived td:first-child { box-shadow: inset 3px 0 0 #1f9d55; }
.sb-sheet tr.no_show td:first-child { box-shadow: inset 3px 0 0 #d33; }
.sb-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.sb-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sb-detail > div { background: #faf6f3; border-radius: 10px; padding: 8px 10px; }
.sb-detail .full { grid-column: 1 / -1; }
.sb-detail span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.sb-store { padding: 0 14px; }
.sb-store .seg { margin: 4px 0 10px; position: static; }
.sb-store .visits { padding: 0; }
@media (max-width: 640px) {
  .sb-views { display: flex; width: 100%; }
  .sb-views button { flex: 1; padding: 7px 6px; font-size: 12.5px; }
  .sb-day { min-height: 54px; padding: 3px; text-align: center; }
  .sb-day .sb-evs { display: none; }
  .sb-cnt { display: block; margin: 2px auto 0; width: 20px; height: 20px; line-height: 20px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; }
  .sb-cal .dow { font-size: 11px; }
  .sb-filters input[type=date] { flex: 1; }
  .sb-filters select { width: 100%; }
}
.sb-day .sb-ev { white-space: nowrap; text-overflow: ellipsis; }
.sb-day .sb-ev b { margin-right: 2px; }

/* ---- Các bước bổ sung: hỏi giá, huỷ có lý do, dời lịch, giá giữ, nghiệm thu, hoàn tất ---- */
.s8 { background: #0b5d3b; }
.cancel-box { background: #fff7f7; border-radius: 10px; padding: 10px 12px; }
.alt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, #eee); }
.alt-row:first-child { border-top: 0; }
.rate-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rate { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: #d6d3d1; padding: 2px; }
.rate.on { color: #f5a524; }
.rate:hover { transform: scale(1.15); }
.pc-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fff1e3; color: #7a3d00; font-size: 14px; }
.pc-box .ccard-act { margin-top: 8px; }
.cnote.warn { background: #fff1e3; color: #7a3d00; }
.accept-box { margin: 22px 0 6px; padding: 14px 16px; border-radius: 12px; background: #f6f5f4; }
.accept-box.ok { background: #e4f7ec; color: #12804a; }
.accept-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.accept-form input { flex: 1 1 200px; }
