/* =========================================================
   MÀN HÌNH HIỂN THỊ TẠI QUẦY – QMS ĐA ĐIỂM · Bản demo
   Canvas thiết kế: 1920 × 1080 px (LCD 22" 16:9, 1 px ≈ 0,25 mm)
   Bố cục bất đối xứng: cột định danh 640 · khối số 1280 · dải dự báo 270
   ========================================================= */

:root {
  --cobalt: #0047AB;
  --cobalt-700: #003A8C;
  --cobalt-900: #002A66;
  --cobalt-50: #EAF1FB;
  --cobalt-100: #CFE0F7;
  --navy: #042C53;
  --gold: #FFCC00;
  --orange: #FF8800;
  --orange-50: #FFF4E5;
  --orange-ink: #7A3E00;
  --red: #DA251D;
  --green: #1B873F;
  --green-50: #E7F5EC;
  --green-ink: #0E5A28;
  --teal-50: #E1F5EE;
  --teal-ink: #085041;

  --bg: #F5F7FA;
  --line: #DCE3EC;
  --ink: #14213D;
  --ink-2: #4A5568;

  --font: "Be Vietnam Pro", "Roboto", "Inter", "Segoe UI", sans-serif;
  --num-font: "Roboto Condensed", "Arial Narrow", "Roboto", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.35, .5, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); background: radial-gradient(ellipse at 30% 20%, #16305E 0%, #0A1631 60%, #060D1F 100%); overflow: hidden; color: var(--ink); }
button, select { font: inherit; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-family: var(--num-font); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Sân khấu và khung màn hình ---------- */
.stage { height: 100vh; display: flex; align-items: center; justify-content: center; gap: 24px; padding: 16px; }
.frame { position: relative; flex: none; border-radius: 8px; box-shadow: 0 0 0 10px #11151F, 0 0 0 12px #2E3648, 0 40px 80px rgba(0, 0, 0, .6); }
body.is-full .stage { padding: 0; }
body.is-full .frame { border-radius: 0; box-shadow: none; }
body.is-full .sim { display: none; }
body.is-full { cursor: none; }
.scr { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; transform-origin: 0 0; background: var(--bg); overflow: hidden; border-radius: inherit; user-select: none; }

/* =========================================================
   CỘT TRÁI (640 × 810)
   ========================================================= */
.left { position: absolute; left: 0; top: 0; width: 640px; height: 810px; }
.cnt { position: relative; height: 430px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(160deg, #0A5BC9, var(--cobalt) 50%, var(--cobalt-900)); color: #fff; }
.cnt::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 2px, transparent 2px); background-size: 24px 24px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); mask-image: linear-gradient(180deg, #000, transparent 75%); }
.cnt-lbl { position: relative; font-size: 56px; font-weight: 800; letter-spacing: .22em; color: var(--gold); padding-left: .22em; }
.cnt-num { position: relative; font-size: 300px; line-height: .92; margin-top: 6px; }

.staff { height: 380px; display: flex; align-items: center; gap: 32px; padding: 0 36px; background: #fff; border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.avatar {
  position: relative; flex: none; width: 188px; height: 188px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #2F80ED, var(--cobalt) 60%, var(--cobalt-900));
  border: 6px solid #fff;
  box-shadow: 0 0 0 6px var(--gold), 0 18px 34px -16px rgba(0, 40, 100, .6);
}
.avatar span { font-size: 72px; font-weight: 800; color: #fff; letter-spacing: .02em; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.avatar.has-photo img { display: block; }
.avatar.has-photo span { display: none; }
.st-txt { min-width: 0; flex: 1; }
.st-name { font-size: 40px; font-weight: 800; line-height: 1.22; color: var(--cobalt-900); text-transform: uppercase; overflow-wrap: break-word; }
.st-role { margin-top: 10px; font-size: 28px; font-weight: 600; color: var(--ink-2); }
.st-field { display: inline-block; margin-top: 16px; padding: 8px 18px; border-radius: 14px; background: var(--cobalt-50); color: var(--cobalt-900); font-size: 24px; font-weight: 700; line-height: 1.3; }
.left.is-swap .staff > * { animation: rise .6s var(--ease) both; }
.left.is-swap .st-txt { animation-delay: .1s; }

/* =========================================================
   KHỐI SỐ (1280 × 810)
   ========================================================= */
.main { position: absolute; left: 640px; top: 0; width: 1280px; height: 810px; padding: 34px 48px 40px; display: flex; flex-direction: column; }
.m-top { height: 80px; display: flex; align-items: center; gap: 24px; }
.m-lbl { font-size: 56px; font-weight: 800; letter-spacing: .02em; color: var(--cobalt-900); }
.m-lbl.is-calling { color: var(--red); }
.m-off { display: none; align-items: center; gap: 12px; height: 56px; padding: 0 22px; border-radius: 28px; background: var(--gold); color: var(--cobalt-900); font-size: 24px; }
.m-off .ic { font-size: 30px; }
.m-off b { font-weight: 700; }
.scr.is-offline .m-off { display: inline-flex; animation: rise .4s var(--ease); }
.m-clock { margin-left: auto; font-size: 52px; color: var(--ink-2); }

.m-block { position: relative; flex: 1; margin-top: 18px; border-radius: 40px; overflow: hidden; background: var(--red); color: #fff; transition: background .45s ease, color .45s ease; box-shadow: 0 30px 60px -34px rgba(160, 20, 10, .8); }
.m-block::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .16), transparent 60%); pointer-events: none; }
.m-serve, .m-ready, .m-thanks { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s linear .4s; }
.m-block[data-state="serving"] .m-serve, .m-block[data-state="calling"] .m-serve,
.m-block[data-state="ready"] .m-ready, .m-block[data-state="thanks"] .m-thanks { opacity: 1; visibility: visible; transition-delay: 0s; }
.m-block[data-state="ready"] { background: var(--cobalt-50); color: var(--cobalt-900); box-shadow: none; }
.m-block[data-state="thanks"] { background: var(--green-50); color: var(--green-ink); box-shadow: none; }

.cur { font-size: 340px; line-height: 1; letter-spacing: .01em; }
.cur.is-hidden { opacity: 0; }
.m-block[data-state="calling"] .cur.is-pulse { animation: pulse 1s ease-in-out 3; }
@keyframes pulse { 0%, 100% { transform: scale(1); text-shadow: none; } 50% { transform: scale(1.05); text-shadow: 0 0 40px rgba(255, 255, 255, .55); } }
.m-svc { margin-top: 14px; font-size: 40px; font-weight: 600; opacity: .95; padding: 0 40px; }
.m-tags { display: flex; gap: 16px; margin-top: 22px; min-height: 0; }
.m-tags:empty { display: none; }
.m-tags .tag { height: 56px; font-size: 28px; padding: 0 22px; border-radius: 14px; }

.m-ready .ic, .m-thanks .ic { font-size: 120px; opacity: .9; }
.m-ready b, .m-thanks b { margin-top: 26px; font-size: 76px; font-weight: 800; letter-spacing: .02em; }
.m-ready span, .m-thanks span { margin-top: 16px; font-size: 40px; font-weight: 600; opacity: .9; }
.m-ready span .num { font-size: 56px; color: var(--cobalt); }
.m-block[data-state="thanks"] .ic { animation: pop .7s var(--spring) both; }

/* Số bay từ dải "Sắp gọi" lên khối đỏ */
.fly { position: absolute; z-index: 30; transform-origin: 0 0; font-family: var(--num-font); font-weight: 700; line-height: 1; white-space: nowrap; pointer-events: none; }

/* =========================================================
   DẢI DỰ BÁO (1920 × 270)
   ========================================================= */
.strip { position: absolute; left: 0; top: 810px; width: 1920px; height: 270px; display: flex; align-items: center; gap: 24px; padding: 0 40px; background: var(--navy); color: #fff; border-top: 6px solid var(--gold); }
.s-lbl { flex: none; width: 260px; display: flex; flex-direction: column; line-height: 1.35; }
.s-lbl b { font-size: 46px; font-weight: 800; color: var(--gold); letter-spacing: .03em; line-height: 1.2; }
.s-lbl span { font-size: 22px; font-weight: 600; color: #B5D4F4; }
.chips { flex: none; display: flex; gap: 24px; }
.chip { position: relative; width: 344px; height: 190px; border-radius: 24px; background: #fff; color: var(--cobalt-900); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: opacity .4s, transform .4s var(--ease); }
.chip .cap { font-size: 22px; font-weight: 800; letter-spacing: .05em; color: var(--ink-2); }
.chip .num { font-size: 104px; line-height: 1; }
.chip:first-child { box-shadow: 0 0 0 5px var(--gold); }
.chip.c-priority { background: var(--orange-50); color: var(--orange-ink); }
.chip.c-priority .cap { color: var(--orange-ink); }
.chip.c-transfer { background: var(--teal-50); color: var(--teal-ink); }
.chip.c-transfer .cap { color: var(--teal-ink); }
.chip.c-return { background: var(--cobalt-100); }
.chip.c-return .cap { color: var(--cobalt-900); }
.chip.is-gone { opacity: 0; transform: translateY(30px) scale(.92); }
.chips.is-shift .chip { animation: chipIn .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes chipIn { from { opacity: 0; transform: translateX(60px); } }
.chip.is-new { animation: chipNew .6s var(--spring) both !important; }
@keyframes chipNew { from { opacity: 0; transform: translateY(40px) scale(.9); } }

.s-empty { flex: 1; display: none; align-items: center; justify-content: center; gap: 22px; font-size: 40px; font-weight: 700; color: #fff; }
.s-empty .ic { font-size: 60px; color: var(--gold); }
.strip.is-empty .chips { display: none; }
.strip.is-empty .s-empty { display: flex; }
.strip.is-empty .stats { display: none; }
.strip.is-lost .chips, .strip.is-lost .stats { display: none; }
.strip.is-lost .s-empty { display: flex; }

.stats { margin-left: auto; display: flex; gap: 20px; }
.stat { width: 190px; display: flex; flex-direction: column; align-items: flex-start; padding-left: 22px; border-left: 3px solid rgba(181, 212, 244, .35); line-height: 1; }
.stat span { font-size: 22px; font-weight: 800; letter-spacing: .05em; color: #B5D4F4; }
.stat b { font-size: 104px; margin-top: 8px; }
.stat small { font-size: 24px; font-weight: 600; color: #B5D4F4; margin-top: 6px; }
.bump { animation: bump .6s var(--ease); }
@keyframes bump { from { transform: translateY(-14px); opacity: 0; color: var(--gold); } }

/* ---------- Nhãn phân loại ---------- */
.tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .03em; white-space: nowrap; }
.tag-priority { background: var(--orange); color: #3D1F00; }
.tag-transfer { background: #fff; color: var(--teal-ink); }
.tag-return { background: #fff; color: var(--cobalt-900); }

/* =========================================================
   TOÀN MÀN HÌNH: TẠM NGƯNG / CHƯA MỞ
   ========================================================= */
.full { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 160px; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s linear .5s; }
.full.is-on { opacity: 1; visibility: visible; transition-delay: 0s; }
.full--pause { background: linear-gradient(180deg, #DDE2E8, #C9D0D9); color: #2C3340; }
.full--closed { background: linear-gradient(180deg, #EEF1F5, #DFE5EC); color: var(--cobalt-900); }
.f-cnt { font-size: 56px; font-weight: 800; letter-spacing: .1em; color: #4A5568; }
.f-cnt b { font-size: 120px; margin-left: 12px; letter-spacing: 0; vertical-align: -10px; color: #2C3340; }
.full--closed .f-cnt b { color: var(--cobalt); }
.f-ic { margin-top: 26px; width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center; font-size: 84px; background: rgba(255, 255, 255, .7); box-shadow: 0 0 0 18px rgba(255, 255, 255, .3); }
.full.is-on .f-ic { animation: pop .7s var(--spring) both .1s; }
.full h2 { margin-top: 44px; font-size: 96px; font-weight: 800; line-height: 1.15; letter-spacing: .02em; }
.full p { margin-top: 18px; font-size: 48px; font-weight: 600; color: #4A5568; }
.full p .num { font-size: 60px; color: #2C3340; }
.f-redirect { margin-top: 34px; display: inline-flex; align-items: center; gap: 18px; padding: 18px 36px; border-radius: 24px; background: #fff; color: var(--cobalt-900); font-size: 44px; font-weight: 700; }
.f-redirect:empty { display: none; }
.f-redirect .ic { font-size: 50px; color: var(--cobalt); }
.f-redirect .num { font-size: 60px; color: var(--cobalt); }
.f-hours { margin-top: 36px; width: 900px; border-radius: 24px; background: #fff; border: 2px solid var(--line); overflow: hidden; }
.f-hours > div { display: flex; justify-content: space-between; align-items: center; padding: 20px 36px; font-size: 36px; }
.f-hours > div + div { border-top: 2px solid var(--line); }
.f-hours span { color: var(--ink-2); }
.f-hours b { font-size: 48px; }

@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }

/* =========================================================
   BẢNG MÔ PHỎNG
   ========================================================= */
.sim { position: relative; width: 300px; flex: none; max-height: calc(100vh - 32px); overflow-y: auto; padding: 20px; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); color: #DCE6F7; font-size: 14px; line-height: 1.45; }
.sim h4 { font-size: 17px; color: #fff; }
.sim .note { margin-top: 6px; color: #A9B7D0; font-size: 13px; }
.sim code { color: var(--gold); }
.grp { margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gold); }
.grp button { display: flex; justify-content: space-between; align-items: center; gap: 6px; text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; transition: background .2s; }
.grp button:hover { background: rgba(255, 255, 255, .16); }
.grp button.pri { background: var(--gold); color: var(--cobalt-900); font-weight: 700; border: 0; }
.grp .two { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.grp select { height: 38px; border-radius: 10px; padding: 0 8px; background: #fff; color: var(--cobalt-900); border: 0; }
.grp label { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 2px 0; }
.grp input { width: 17px; height: 17px; accent-color: var(--gold); flex: none; }
kbd { font-family: inherit; font-size: 11px; padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .14); color: inherit; }
.grp button.pri kbd { background: rgba(0, 42, 102, .15); }
.sim .toast { position: sticky; bottom: 0; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--gold); color: var(--cobalt-900); font-weight: 600; opacity: 0; transition: opacity .3s; pointer-events: none; }
.sim .toast.is-on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
