/* showcase.css — แบบหน้าจอมือถือ วางบนโทน house-style (slate/ขาว)
   ไฟล์นี้ใช้เฉพาะ showcase ไม่ใช่โค้ดของแอปจริง */

body { background: rgb(var(--line)/.06); }

/* ---------- ป้ายบอกว่านี่คือแบบ ---------- */
.mock-banner {
  position: sticky; top: 0; z-index: 60;
  background: rgb(var(--ink)); color: #fff;
  font-size: 13px; text-align: center; padding: 9px 14px;
}
.mock-banner b { font-weight: 600; }

.stage {
  display: flex; flex-wrap: wrap; gap: 28px;
  justify-content: center; align-items: flex-start;
  padding: 28px 16px 60px;
}

/* ---------- กรอบมือถือ ---------- */
.device {
  width: 390px; max-width: 100%;
  height: 780px; max-height: 82vh;
  background: rgb(var(--card));
  border: 1px solid rgb(var(--line)/.16);
  border-radius: 26px;
  box-shadow: var(--sh-md);
  display: flex; flex-direction: column; overflow: hidden;
}
.device-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 13px 17px;
  border-bottom: 1px solid rgb(var(--line)/.09);
  background: rgb(var(--card));
}
.device-top h2 { font-family: "Bai Jamjuree", sans-serif; font-size: 17px; font-weight: 600; }
.device-top .when { font-size: 12px; color: rgb(var(--muted)); white-space: nowrap; }
.device-body { flex: 1; overflow-y: auto; padding: 15px 15px 22px; }

/* ---------- แถบล่าง ---------- */
.tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid rgb(var(--line)/.09);
  background: rgb(var(--card));
}
.tabbar button {
  min-height: 56px; border: none; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; color: rgb(var(--muted));
}
.tabbar button.on { color: rgb(var(--ink)); font-weight: 600; }
.tabbar svg { width: 20px; height: 20px; }

/* ---------- ส่วนประกอบในจอ ---------- */
.sec { margin: 0 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec h3 { font-size: 12.5px; font-weight: 600; color: rgb(var(--muted)); }
.sec + .list { margin-bottom: 18px; }

.row {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  background: rgb(var(--card));
  border: 1px solid rgb(var(--line)/.12);
  border-radius: 12px; padding: 11px 13px; margin-bottom: 8px;
  cursor: pointer; box-shadow: var(--sh-sm);
}
.row:hover { border-color: rgb(var(--ink)/.28); }
.row .bar { width: 4px; align-self: stretch; border-radius: 4px; background: rgb(var(--line)/.2); flex: none; }
.row.late .bar { background: #dc2626; }
.row.soon .bar { background: #f59e0b; }
.row.done .bar { background: #16985f; }

/* สถานะต้องเด่นตั้งแต่ยังไม่ทันอ่านตัวหนังสือ */
.row.late { background: #fff5f4; border-color: rgb(220 38 38/.26); }
.row.late .t { font-weight: 600; }
.row.late .amt { color: #b3261e; }
.row.soon { background: #fffbf2; border-color: rgb(245 158 11/.28); }
.row.done { background: rgb(var(--card)); opacity: .72; }
.row.done .bar { opacity: .5; }
.row .mid { flex: 1; min-width: 0; }
.row .t { display: block; font-size: 14.5px; line-height: 1.35; }
.row .s { display: block; font-size: 12px; color: rgb(var(--muted)); margin-top: 2px; }
.row .amt { font-family: "Bai Jamjuree", sans-serif; font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 600; text-align: right; white-space: nowrap; }
.row .amt.in { color: #0f766e; }
.row .amt.out { color: rgb(var(--ink)); }
.row.done .t, .row.done .amt { color: rgb(var(--muted)); }

.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.p-late { color: #b3261e; border-color: rgb(220 38 38/.35); background: rgb(220 38 38/.06); }
.p-soon { color: #92660b; border-color: rgb(234 179 8/.38); background: rgb(234 179 8/.07); }
.p-done { color: #0f766e; border-color: rgb(16 185 129/.35); background: rgb(16 185 129/.06); }
.p-gray { color: rgb(var(--muted)); border-color: rgb(var(--line)/.18); background: rgb(var(--line)/.04); }

/* ---------- แถบเตือนใหญ่บนสุด ---------- */
.alert {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #dc2626, #b3261e);
  color: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 8px 20px -8px rgb(220 38 38/.55);
}
.alert .n { font-family: "Bai Jamjuree", sans-serif; font-size: 30px; font-weight: 700; line-height: 1; }
.alert .txt { flex: 1; font-size: 13.5px; line-height: 1.45; }
.alert .txt b { display: block; font-size: 15px; font-weight: 600; }
.alert.ok { background: linear-gradient(135deg, #0f766e, #0b5f59); box-shadow: 0 8px 20px -8px rgb(15 118 110/.5); }

/* ---------- แถบวันข้างหน้า 14 วัน ---------- */
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 6px; -webkit-overflow-scrolling: touch; }
.strip::-webkit-scrollbar { height: 0; }
.strip button {
  flex: none; width: 44px; border: 1px solid rgb(var(--line)/.14); background: rgb(var(--card));
  border-radius: 11px; padding: 7px 0 6px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 3px; box-shadow: var(--sh-sm);
}
.strip .dw { font-size: 10.5px; color: rgb(var(--faint)); }
.strip .dd { font-family: "Bai Jamjuree", sans-serif; font-size: 16px; font-weight: 600; line-height: 1; }
.dots { display: flex; gap: 2px; height: 6px; align-items: center; }
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 99px; flex: none; }
.legend .dot { width: 8px; height: 8px; }
.dot.late { background: #dc2626; } .dot.soon { background: #f59e0b; }
.dot.in { background: #0f766e; } .dot.stay { background: #2563eb; }
.strip button.today { border-color: rgb(var(--ink)); background: rgb(var(--ink)); }
.strip button.today .dw, .strip button.today .dd { color: #fff; }

/* ---------- ปฏิทินเดือน ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head .m { font-family: "Bai Jamjuree", sans-serif; font-size: 16px; font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 14px; }
.cal .dow { text-align: center; font-size: 10.5px; color: rgb(var(--faint)); padding-bottom: 2px; }
.cal .cell {
  aspect-ratio: 1; border: 1px solid rgb(var(--line)/.1); border-radius: 9px;
  background: rgb(var(--card)); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; cursor: pointer; padding: 0; font: inherit;
}
.cal .cell.blank { border: none; background: none; cursor: default; }
.cal .cell .d { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cal .cell .dots { display: flex; gap: 2px; height: 5px; }
.cal .cell.today { border-color: rgb(var(--ink)); border-width: 1.5px; }
.cal .cell.sel { background: rgb(var(--ink)); }
.cal .cell.sel .d { color: #fff; font-weight: 600; }
.cal .cell.hasLate { background: #fff1ef; border-color: rgb(220 38 38/.3); }
.cal .cell.stay { box-shadow: inset 0 -3px 0 rgb(37 99 235/.5); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: rgb(var(--muted)); margin-bottom: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.kpi-c { background: rgb(var(--card)); border: 1px solid rgb(var(--line)/.12); border-radius: 12px; padding: 12px 13px; box-shadow: var(--sh-sm); }
.kpi-c .l { font-size: 11.5px; color: rgb(var(--muted)); }
.kpi-c .v { font-family: "Bai Jamjuree", sans-serif; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi-c .v.neg { color: #b3261e; }
.kpi-c .v.pos { color: #0f766e; }

.panel { background: rgb(var(--card)); border: 1px solid rgb(var(--line)/.12); border-radius: 13px; padding: 14px; margin-bottom: 12px; box-shadow: var(--sh-sm); }
.panel h4 { font-size: 12.5px; color: rgb(var(--muted)); font-weight: 600; margin-bottom: 9px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13.5px; border-top: 1px solid rgb(var(--line)/.06); }
.kv:first-of-type { border-top: none; }
.kv b { font-family: "Bai Jamjuree", sans-serif; font-weight: 600; font-variant-numeric: tabular-nums; }

.back { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: rgb(var(--muted));
  background: none; border: none; cursor: pointer; padding: 0 0 10px; }

.act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.act .btn, .act .btn-primary { min-height: 44px; margin-top: 0; width: auto; flex: 1; }

.note-box { font-size: 12.5px; color: rgb(var(--muted)); background: rgb(var(--line)/.04);
  border: 1px solid rgb(var(--line)/.08); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }

.mini-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-tbl th { text-align: left; font-size: 11px; color: rgb(var(--muted)); font-weight: 600; padding: 7px 6px; border-bottom: 1px solid rgb(var(--line)/.12); }
.mini-tbl td { padding: 9px 6px; border-bottom: 1px solid rgb(var(--line)/.06); font-variant-numeric: tabular-nums; }
.mini-tbl td.n, .mini-tbl th.n { text-align: right; white-space: nowrap; }
.mini-tbl tr:last-child td { border-bottom: none; }
.mini-tbl tr.sum td { font-weight: 600; border-top: 1px solid rgb(var(--line)/.14); }

textarea.paste { min-height: 92px; font-size: 12.5px; font-family: ui-monospace, monospace; }

/* ---------- แผ่นเลื่อนขึ้น (bottom sheet) ---------- */
.sheet-wrap { position: absolute; inset: 0; display: none; }
.sheet-wrap.on { display: block; }
.sheet-bg { position: absolute; inset: 0; background: rgb(26 32 50/.34); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgb(var(--card)); border-radius: 18px 18px 0 0;
  padding: 16px 16px 20px; box-shadow: 0 -10px 30px rgb(26 32 50/.18);
}
.sheet h4 { font-family: "Bai Jamjuree", sans-serif; font-size: 15.5px; font-weight: 600; margin-bottom: 3px; }
.device { position: relative; }

/* ---------- คำอธิบายข้าง ๆ ---------- */
.aside { width: 330px; max-width: 100%; }
.aside h1 { font-family: "Bai Jamjuree", sans-serif; font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.aside > p { font-size: 13.5px; color: rgb(var(--muted)); margin-bottom: 14px; }
.aside .card { margin-bottom: 12px; }
.aside .card h3 { margin-bottom: 8px; }
.aside ol, .aside ul { padding-left: 18px; font-size: 13px; color: rgb(var(--muted)); }
.aside li { margin-bottom: 6px; }
.aside li b { color: rgb(var(--ink)); font-weight: 600; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; }
.jump button { font-size: 12.5px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgb(var(--line)/.16);
  background: #fff; cursor: pointer; color: rgb(var(--ink)); }
.jump button:hover { border-color: rgb(var(--ink)/.3); }

@media (max-width: 820px) {
  .stage { padding: 14px 10px 36px; gap: 18px; }
  .device { width: 100%; height: calc(100vh - 120px); max-height: none; border-radius: 18px; }
  .aside { width: 100%; order: 2; }
}

/* ---------- ทะเบียนลูกค้า ---------- */
.linkish {
  border: none; background: none; padding: 0; font: inherit; font-weight: 600;
  color: rgb(var(--accent)); cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: rgb(var(--accent)/.35);
}

/* ข้อตกลงกับลูกค้า — ต้องสะดุดตา ไม่ใช่หมายเหตุจาง ๆ */
.agree {
  background: #fffaf0; border: 1px solid rgb(245 158 11/.35); border-left: 4px solid #f59e0b;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; line-height: 1.55;
}
.agree b { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  color: #92660b; margin-bottom: 4px; }
.agree .small { display: block; margin-top: 7px; font-size: 11.5px; color: rgb(var(--muted)); }

.warn {
  margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: #92660b;
  background: rgb(234 179 8/.07); border: 1px solid rgb(234 179 8/.28);
  border-radius: 9px; padding: 8px 10px;
}

.docs { display: flex; flex-direction: column; gap: 7px; }
.doc {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1px solid rgb(var(--line)/.14); background: rgb(var(--card));
  border-radius: 10px; padding: 9px 11px; cursor: pointer; font: inherit; font-size: 13.5px;
}
.doc:hover { border-color: rgb(var(--ink)/.28); }
.doc .dico { display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 8px; background: rgb(var(--line)/.06); color: rgb(var(--muted)); }
.doc .dnm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .dact { flex: none; font-size: 11.5px; font-weight: 600; color: #b3261e;
  border: 1px solid rgb(220 38 38/.3); border-radius: 7px; padding: 4px 9px; background: #fff; }
