@font-face { font-family: "PadaukLocal"; src: url("../fonts/Padauk-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PadaukLocal"; src: url("../fonts/Padauk-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
:root {
  --teal-950: #062a2e; --teal-900: #0a3d42; --teal-800: #0f5258; --teal-700: #14666e; --teal-600: #1a7f88;
  --teal-100: #e6f4f5; --teal-50: #f2fafb;
  --gold-500: #c9a227; --gold-400: #dbb84a; --gold-300: #e8d08a; --gold-100: #faf4e1;
  --ink: #1a2426; --muted: #5a6b6e; --line: #d5e3e5; --white: #fff;
  --danger: #c23b3b; --success: #1f8a5b;
  --shadow: 0 12px 40px rgba(6, 42, 46, .12); --radius: 16px;
  --font: "Padauk", "PadaukLocal", "Noto Sans Myanmar", "Myanmar Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); line-height: 1.6;
  background: linear-gradient(165deg, var(--teal-50) 0%, #fff 45%, var(--gold-100) 100%); min-height: 100vh; }
a { color: var(--teal-700); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: var(--teal-950); font-weight: 700; font-size: 18px; }

/* ---------- Chat ---------- */
.chat-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 760px; margin: 0 auto;
  background: #fff; box-shadow: var(--shadow); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #fff;
  background: linear-gradient(135deg, var(--teal-900), var(--teal-700)); border-bottom: 3px solid var(--gold-500); }
.chat-head .meta { flex: 1; min-width: 0; }
.chat-head .title { font-weight: 700; font-size: 17px; }
.chat-head .sub { font-size: 13px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; display: inline-block; }
.dot.off { background: var(--gold-400); }
.head-btn { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.head-btn:hover { background: rgba(255,255,255,.22); }
.banner { padding: 10px 16px; font-size: 14px; background: var(--gold-100); border-bottom: 1px solid var(--gold-300); color: #6b5310; }
.banner.err { background: #fdecec; border-color: #f3c4c4; color: var(--danger); }
.banner code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
.messages { flex: 1; overflow-y: auto; padding: 18px 14px; display: flex; flex-direction: column; gap: 10px;
  background: var(--teal-50); }
.msg { display: flex; gap: 8px; max-width: 86%; align-items: flex-end; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px;
  background: var(--gold-400); color: var(--teal-950); font-weight: 700; }
.bubble { padding: 9px 13px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; font-size: 15.5px;
  background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.user .bubble { background: var(--teal-700); color: #fff; border-color: var(--teal-700);
  border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.msg.error .bubble { background: #fdecec; border-color: #f3c4c4; color: var(--danger); }
.bubble code { background: rgba(0,0,0,.07); padding: 0 4px; border-radius: 4px; font-size: 13px; }
.typing .bubble { display: flex; gap: 4px; padding: 13px 14px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--teal-600); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.confirm-card { align-self: flex-start; margin-left: 36px; max-width: 86%; background: #fff; border: 2px solid var(--gold-400);
  border-radius: 14px; padding: 12px 14px; font-size: 14.5px; box-shadow: 0 4px 14px rgba(201,162,39,.15); }
.confirm-card h4 { margin: 0 0 6px; color: var(--teal-800); font-size: 15px; }
.confirm-card .row { display: flex; justify-content: space-between; gap: 12px; border-top: 1px dashed var(--line); padding: 4px 0; }
.confirm-card .row span:first-child { color: var(--muted); }
.chips { display: flex; gap: 8px; padding: 8px 12px 0; overflow-x: auto; background: #fff; }
.chip { flex: none; border: 1px solid var(--teal-600); color: var(--teal-700); background: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 14px; }
.chip:hover { background: var(--teal-100); }
.composer { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px;
  font: inherit; font-size: 16px; max-height: 120px; outline: none; line-height: 1.5; }
.composer textarea:focus { border-color: var(--teal-600); box-shadow: 0 0 0 3px var(--teal-100); }
.send { border: 0; border-radius: 20px; padding: 0 18px; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: var(--teal-950); }
.send:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Dashboard ---------- */
.dash-head { background: linear-gradient(135deg, var(--teal-950), var(--teal-800)); color: #fff; border-bottom: 3px solid var(--gold-500); }
.dash-head .inner { max-width: 1180px; margin: 0 auto; padding: 14px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dash-head .title { font-weight: 700; font-size: 18px; flex: 1; min-width: 180px; }
.dash-head .title small { display: block; font-weight: 400; font-size: 13px; opacity: .8; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; background: rgba(255,255,255,.1);
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .sw { width: 38px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.3); position: relative; transition: .2s; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle input:checked + .sw { background: var(--gold-500); }
.toggle input:checked + .sw::after { left: 19px; }
.tabs { max-width: 1180px; margin: 0 auto; padding: 0 12px; display: flex; gap: 4px; overflow-x: auto; }
.tab { border: 0; background: transparent; color: rgba(255,255,255,.75); padding: 10px 14px; font-size: 15px; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.active { color: #fff; border-color: var(--gold-400); font-weight: 700; }
.tab .badge { background: var(--gold-500); color: var(--teal-950); border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
main.dash { max-width: 1180px; margin: 0 auto; padding: 18px; }
.view { display: none; } .view.active { display: block; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 2px 10px rgba(6,42,46,.05); }
.stat .n { font-size: 28px; font-weight: 700; color: var(--teal-800); }
.stat .l { color: var(--muted); font-size: 14px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 10px; color: var(--teal-800); font-size: 17px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.empty { color: var(--muted); font-size: 14px; padding: 10px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 400; font-size: 13px; }
.tbl-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; background: var(--teal-100); color: var(--teal-800); }
.pill.gold { background: var(--gold-100); color: #7a5d0a; } .pill.red { background: #fdecec; color: var(--danger); }
.btn { border: 1px solid var(--teal-600); background: #fff; color: var(--teal-700); border-radius: 10px; padding: 5px 12px; font-size: 14px; }
.btn.primary { background: var(--teal-700); color: #fff; border-color: var(--teal-700); }
.btn.gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: var(--teal-950); border: 0; font-weight: 700; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.task.done { opacity: .5; } .task.done .t-title { text-decoration: line-through; }
.task .t-body { flex: 1; } .t-title { font-weight: 700; } .t-detail { color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.inbox { display: grid; grid-template-columns: 300px 1fr; gap: 14px; }
.thread-list { max-height: 70vh; overflow-y: auto; }
.thread-item { padding: 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.thread-item:hover { background: var(--teal-50); } .thread-item.active { background: var(--teal-100); border-color: var(--teal-600); }
.thread-item .p { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transcript { max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; background: var(--teal-50); border-radius: 12px; padding: 12px; }
.transcript .msg { max-width: 92%; }
.transcript .sys { align-self: center; font-size: 12.5px; color: var(--muted); }
.day-group { margin-bottom: 14px; }
.day-group h4 { margin: 0 0 6px; color: var(--teal-700); font-size: 15px; }
.appt { display: flex; gap: 12px; padding: 8px 10px; border-left: 4px solid var(--gold-500); background: var(--gold-100); border-radius: 8px; margin-bottom: 6px; font-size: 14.5px; }
.appt .tm { font-weight: 700; min-width: 52px; color: var(--teal-800); }
@media (max-width: 760px) {
  .inbox { grid-template-columns: 1fr; }
  .thread-list { max-height: 34vh; }
  .chat-app { box-shadow: none; }
  .msg { max-width: 92%; }
}

/* chat channel pills (web / Messenger / Viber) */
.pill.ch-web { background: #ede9fe; color: #5b21b6; }
.pill.ch-messenger { background: #dbeafe; color: #1d4ed8; }
.pill.ch-viber { background: #ede9fe; color: #6d28d9; border: 1px solid #c4b5fd; }
.pill.ch-pms { background: #f1f5f9; color: #475569; }

.powered { text-align: center; font-size: 11px; color: #94a3b8; padding: 2px 0 6px; background: #fff; }
