:root {
  --pink: #d6336c;
  --pink-dark: #a61e4d;
  --green: #2b8a3e;
  --red: #e03131;
  --bg: #fff5f8;
  --card: #ffffff;
  --text: #212529;
  --muted: #868e96;
  --line: #f1d4de;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
button { font: inherit; cursor: pointer; border: 0; }
.hidden { display: none !important; }

/* ---------- Trang khách ---------- */
.guest { max-width: 480px; margin: 0 auto; padding: 16px 16px 40px; }
.g-head { text-align: center; padding: 8px 0 16px; }
.g-brand { color: var(--pink); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }
.g-room { font-size: 26px; font-weight: 800; margin-top: 4px; }
.g-branch { color: var(--muted); font-size: 14px; }
.big-call { width: 100%; background: var(--green); color: #fff; font-size: 22px; font-weight: 700; padding: 20px; border-radius: 18px; box-shadow: 0 6px 18px rgba(43,138,62,.3); display: flex; align-items: center; justify-content: center; gap: 10px; }
.big-call:active { transform: scale(.98); }
.g-note { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 20px; }
.section-title { font-weight: 700; margin: 18px 0 10px; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-btn { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 10px; text-align: center; font-size: 14px; font-weight: 600; color: var(--text); min-height: 86px; }
.type-btn .ic { font-size: 28px; display: block; margin-bottom: 4px; }
.type-btn:active { background: #ffe3ec; }
.msg-box { display: flex; gap: 8px; margin-top: 10px; }
.msg-box textarea { flex: 1; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; font: inherit; resize: none; height: 48px; }
.msg-box button { background: var(--pink); color: #fff; border-radius: 12px; padding: 0 16px; font-weight: 700; }
.my-req { background: var(--card); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); }
.my-req .ic { font-size: 22px; }
.my-req .txt { flex: 1; font-size: 14px; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge.new { background: #fff3bf; color: #e67700; }
.badge.ack { background: #d0ebff; color: #1864ab; }
.badge.done { background: #d3f9d8; color: var(--green); }
.hotline { display: block; text-align: center; margin-top: 24px; color: var(--muted); font-size: 13px; }
.hotline a { color: var(--pink); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #212529; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; z-index: 50; text-align: center; }
.error-page { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---------- Màn hình cuộc gọi (dùng chung) ---------- */
.call-overlay { position: fixed; inset: 0; background: linear-gradient(160deg, #a61e4d, #3b0a1e); color: #fff; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.call-overlay .avatar { width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 52px; }
.call-overlay.ringing .avatar { animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.5); } 100% { box-shadow: 0 0 0 30px rgba(255,255,255,0); } }
.call-overlay .who { font-size: 26px; font-weight: 800; }
.call-overlay .status { font-size: 16px; opacity: .85; min-height: 22px; }
.call-actions { display: flex; gap: 28px; margin-top: 30px; }
.round { width: 72px; height: 72px; border-radius: 50%; font-size: 30px; color: #fff; display: flex; align-items: center; justify-content: center; }
.round.end { background: var(--red); }
.round.accept { background: #40c057; }
.round.mute { background: rgba(255,255,255,.2); }
.round.mute.on { background: #fff; color: #a61e4d; }
.round-label { font-size: 12px; margin-top: 6px; opacity: .85; }
.call-actions > div { display: flex; flex-direction: column; align-items: center; }

/* ---------- Màn hình lễ tân ---------- */
.rc { max-width: 1100px; margin: 0 auto; padding: 16px; }
.login { max-width: 380px; margin: 60px auto; background: var(--card); border-radius: 18px; padding: 24px; box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.login h1 { font-size: 22px; margin: 0 0 4px; }
.login p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.login label { font-size: 13px; font-weight: 600; display: block; margin: 12px 0 6px; }
.login select, .login input { width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; }
.login button { width: 100%; margin-top: 18px; background: var(--pink); color: #fff; padding: 14px; border-radius: 12px; font-weight: 700; font-size: 16px; }
.login .err { color: var(--red); font-size: 14px; margin-top: 10px; min-height: 18px; }
.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rc-head h1 { font-size: 20px; margin: 0; }
.rc-head .meta { color: var(--muted); font-size: 13px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #40c057; margin-right: 5px; }
.dot.off { background: var(--red); }
.rc-head .tools button { background: #fff; border: 1.5px solid var(--line); padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.rc-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 800px) { .rc-grid { grid-template-columns: 1fr; } }
.panel { background: var(--card); border-radius: 16px; padding: 14px; border: 1px solid var(--line); }
.panel h2 { font-size: 16px; margin: 0 0 12px; display: flex; justify-content: space-between; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; font-size: 14px; }
.req { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); margin-bottom: 10px; background: #fff; }
.req.new { border-color: #ffa94d; background: #fff9db; animation: flash 1.5s 3; }
.req.missed_call.new { border-color: var(--red); background: #fff5f5; }
@keyframes flash { 50% { background: #ffe8cc; } }
.req .ic { font-size: 28px; }
.req .body { flex: 1; min-width: 0; }
.req .room { font-weight: 800; font-size: 18px; }
.req .label { font-weight: 600; }
.req .note { font-size: 14px; color: #495057; margin-top: 2px; word-break: break-word; }
.req .time { font-size: 12px; color: var(--muted); margin-top: 4px; }
.req .acts { display: flex; flex-direction: column; gap: 6px; }
.req .acts button { padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.btn-ack { background: #d0ebff; color: #1864ab; }
.btn-done { background: #d3f9d8; color: var(--green); }
.btn-call { background: var(--pink); color: #fff; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.room-grid button { background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 4px; font-weight: 700; }
.room-grid button .s { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.banner-off { background: #fff5f5; color: var(--red); border: 1px solid #ffc9c9; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; }
