/* Kiểu dáng riêng của phần mềm tiếp đón khách. Đầu trang, thanh chức năng, menu và chuông theo mẫu XDCB. */
.center { text-align: center; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
textarea { width: 100%; min-width: 0; border: 1px solid #bfd5cd; border-radius: 8px; padding: 11px 12px; font: inherit; color: var(--ink); resize: vertical; }
input[type='checkbox'], input[type='radio'] { width: auto; }
input[type='color'] { padding: 2px; height: 40px; min-width: 56px; }
label.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; line-height: 1.45; }
label.check input { margin-top: 3px; flex: 0 0 auto; }
.req::after { content: ' *'; color: #c0392b; }

/* ---------- Đầu trang ---------- */
#fixedHeader31 { position: sticky; top: 0; z-index: 75; background: #eef7f3; box-shadow: 0 4px 12px rgba(0, 57, 48, 0.13); }
#fixedHeader31 > .topbar { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 72px; margin: 0; padding: 5px clamp(12px, 2vw, 32px); background-color: #006766; }
#fixedHeader31 .admin-tools { grid-column: 1; grid-row: 1; justify-self: start; position: relative; }
#fixedHeader31 .brand-center { grid-column: 2; grid-row: 1; justify-self: center; display: block; text-decoration: none; }
.brand-logo-text { display: grid; place-items: center; min-width: 128px; min-height: 52px; padding: 4px 18px; border: 2px solid #ffc529; border-radius: 14px; background: #006766; color: #fff; font-size: 27px; font-weight: 850; letter-spacing: 0.14em; box-shadow: 0 2px 9px #003c3b55; }
.brand-logo-image { display: block; object-fit: contain; max-width: 46vw; border: 2px solid #ffc529; border-radius: 14px; }
.header-actions { grid-column: 3; grid-row: 1; justify-self: end; display: flex; align-items: center; gap: 9px; }
.header-button { background: #ffffff14; border: 1px solid #ffffff55; color: #fff; border-radius: 22px; padding: 8px 15px; font-size: 13px; }
.config-menu { position: absolute; left: 0; top: calc(100% + 8px); z-index: 1500; display: grid; gap: 6px; width: 230px; padding: 9px; background: #006766; border: 1px solid #d9b044; border-radius: 12px; box-shadow: 0 16px 38px #002b2b66; }
.config-menu .admin-button { text-align: left; min-height: 39px; font-size: 13px; }
.config-menu .admin-button span { display: inline; }

#fixedHeader31 > .module-grid { display: flex; flex-flow: row nowrap; align-items: stretch; justify-content: flex-start; gap: 6px; width: max-content; max-width: calc(100% - 12px); margin: 0 auto; padding: 5px 12px 6px; overflow-x: auto; scrollbar-width: thin; }
#fixedHeader31 > .module-grid > .module-button { flex: 0 0 auto; width: max-content; min-height: 39px; padding: 6px 14px; border-radius: 9px; white-space: nowrap; }
body > .welcome { max-width: 1516px; margin: 12px auto 4px; width: calc(100% - 36px); padding: 10px 14px 12px; }
body > .welcome h1 { font-size: clamp(22px, calc(2.4vw + 6px), 32px); line-height: 1.25; }
body > .welcome p { margin-top: 4px; }

html { scroll-padding-top: 138px; }
#fixedHeader31 .admin-button > span[aria-hidden] { display: inline; font-size: 17px; line-height: 1; }
#fixedHeader31 .admin-button { display: flex; align-items: center; gap: 7px; padding: 8px 11px; background: #ffffff12; border: 1px solid #ffffff55; color: #fff; border-radius: 8px; font-size: 13px; white-space: nowrap; }
:root body #fixedHeader31 > .module-grid > .module-button[aria-pressed='true'] .module-number { color: inherit; opacity: 0.85; }

/* ---------- Người dùng và chuông ---------- */
.user-box { position: relative; }
.user-trigger { display: flex; gap: 7px; align-items: center; padding: 4px 10px 4px 5px; background: transparent; color: #fff; border: 1px solid #ffffff50; border-radius: 27px; font-size: 12px; }
.avatar-letter { display: flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%; background: #d1a521; color: #07392f; font-size: 18px; font-weight: 800; text-transform: uppercase; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 1500; display: grid; gap: 6px; width: 220px; padding: 11px; background: #006766; color: #fff; border: 1px solid #d9b044; border-radius: 12px; box-shadow: 0 16px 38px #002b2b66; overflow-wrap: anywhere; }
.user-menu small { color: #dceee5; font-size: 11px; }
.user-menu button { width: 100%; min-height: 39px; text-align: left; padding: 8px 11px; font-size: 13px; }
.bell-box { position: relative; }
#bellButton { position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 6px; background: transparent; border: 1px solid #ffffff50; border-radius: 50%; color: #fff; }
#bellButton svg { width: 22px; height: 22px; display: block; }
#bellBadge { position: absolute; right: -5px; top: -5px; min-width: 19px; height: 19px; border-radius: 12px; padding: 1px 4px; display: grid; place-items: center; background: #df3d48; border: 1px solid #fff; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; }
#bellPanel { position: absolute; right: -60px; top: calc(100% + 8px); width: min(410px, calc(100vw - 20px)); max-height: min(70vh, 560px); overflow: auto; z-index: 1501; background: #fff; color: #153b35; border: 1px solid #bcd8ce; border-top: 3px solid #e5bd40; border-radius: 12px; box-shadow: 0 12px 32px #002b2b44; text-align: left; }
.bell-head { position: sticky; top: 0; z-index: 1; background: #fff; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid #d8e6e0; font-weight: 750; color: #005d49; }
.bell-head button, .bell-more { padding: 5px 10px; border-radius: 6px; background: #e7f4ef; color: #005d49; border: 1px solid #c1dcd2; font-size: 12px; }
#bellPanel .bell-message { width: 100%; display: block; text-align: left; background: #fff; color: #153b35; border: 0; border-bottom: 1px solid #e0ece7; border-radius: 0; padding: 11px 14px; font-weight: 400; white-space: normal; overflow-wrap: anywhere; }
#bellPanel .bell-message.unread { background: #edf8f3; border-left: 3px solid #008565; padding-left: 11px; }
.bell-title { display: block; font-weight: 750; font-size: 14px; color: #005d49; margin-bottom: 4px; }
.bell-body { display: block; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.bell-time { display: block; color: #637b74; font-size: 11px; margin-top: 6px; }
.bell-status { padding: 10px 14px; font-size: 12px; color: #547069; }
.bell-more { display: block; margin: 10px auto; }

/* ---------- Thông báo nổi và khung chức năng ---------- */
#notification:not(:empty) { position: fixed; right: 18px; top: auto; bottom: 18px; z-index: 2000; max-width: min(420px, 90vw); margin: 0; }
.panel-heading { display: flex; align-items: center; flex-wrap: wrap; column-gap: 14px; }
.panel-heading .panel-kicker { flex-basis: 100%; }
.panel-heading h2 { flex: 1; min-width: 0; }
.panel-heading .exit { padding: 8px 17px; font-size: 13px; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row > h2 { margin: 0; }
.card > .row { margin-bottom: 12px; }
#guestResult { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
#guestResult > h2, #guestResult .facts, #guestResult .stack:empty { margin: 0; }
#guestResult > .stack:empty { display: none; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }
button.small { padding: 6px 11px; font-size: 12px; }
button.danger { background: #fff0ed; color: #a43227; border: 1px solid #f0c0bb; }
button.warn { background: #fff2c6; color: #725200; border: 1px solid #f3d577; }
button:disabled { opacity: 0.55; }
.filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; margin-bottom: 8px; }
#panel-dashboard .metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #eef3f2; color: #40564f; border: 1px solid #d3dfdb; }
.badge.NEW { background: #fff5d6; color: #7a5500; border-color: #eed481; }
.badge.APPROVED { background: #e4f1ff; color: #17508c; border-color: #bcd8f5; }
.badge.CHECKED_IN { background: #def5e6; color: #11663a; border-color: #a9dfbd; }
.badge.REJECTED, .badge.CANCELLED { background: #fff0ed; color: #a43227; border-color: #f0c0bb; }
tr.clickable { cursor: pointer; }
td .sub { display: block; color: var(--muted); font-size: 12px; }
.nowrap { white-space: nowrap; }
.pager { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: 13px; margin-top: 10px; }
.pager-size { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; }
.pager-size select { width: auto; padding: 5px 8px; }
.pager-info { color: var(--muted); }
.walkin-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; margin-bottom: 14px; }
.walkin-top input#walkScan { font-size: 18px; border-width: 2px; }
.walkin-status { margin: 0; color: var(--dark); line-height: 1.5; font-size: 14px; }
.walkin-photo { display: flex; align-items: end; gap: 10px; min-height: 40px; }
.walkin-photo .guest-photo { width: 150px; }
.alert { padding: 11px 14px; border-radius: 9px; border: 1px solid #eed481; background: #fff8e0; color: #6d4e00; line-height: 1.5; }
.alert.bad { border-color: #f0c0bb; background: #fff0ed; color: #962b22; }
.alert.good { border-color: #a9dfbd; background: #e8f8ee; color: #11663a; }

/* ---------- Trang khách đăng ký và đăng nhập ---------- */
.register-card { max-width: 860px; margin: 8px auto 0; border-top: 4px solid var(--gold) !important; padding: 26px clamp(16px, 4vw, 38px); }
.register-card h2 { font-size: 22px; text-align: center; margin-bottom: 8px; }
.register-card .intro { text-align: center; color: var(--muted); line-height: 1.6; margin: 0 0 18px; white-space: pre-line; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; margin: 8px 0 0; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.submit-wide { padding: 14px; font-size: 16px; }
.success-card { text-align: center; }
.success-code { display: inline-block; margin: 8px auto 14px; padding: 12px 26px; border: 2px dashed var(--gold); border-radius: 12px; font-size: clamp(24px, 6vw, 34px); font-weight: 850; letter-spacing: 0.08em; color: var(--dark); background: #fffbee; }
#loginSection, #changeSection { max-width: 440px; margin: 20px auto; }

/* ---------- Tiếp đón ---------- */
.reception { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.scan-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.scan-form input { font-size: 18px; border-width: 2px; }
.camera-frame { position: relative; background: #08201b; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.camera-frame video { width: 100%; height: 100%; object-fit: contain; }
.camera-message { position: absolute; inset: auto 12px 12px 12px; padding: 8px 10px; border-radius: 8px; background: #000000a8; color: #fff; font-size: 13px; text-align: center; }
.camera-count { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 110px; font-weight: 850; text-shadow: 0 4px 24px #000; pointer-events: none; }
.camera-flash { position: absolute; inset: 0; background: #fff; animation: flash 0.45s ease-out forwards; pointer-events: none; }
@keyframes flash { from { opacity: 0.95; } to { opacity: 0; } }
.camera-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 10px 0 12px; align-items: end; }
.camera-options ~ label.check { margin-top: 6px; }
.guest-name { margin: 0; font-size: clamp(22px, 2.6vw, 30px); color: var(--dark); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 18px; margin: 14px 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 650; overflow-wrap: anywhere; white-space: pre-line; }
.facts .span-all { grid-column: 1 / -1; }
.guest-top { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.guest-photo { width: 220px; max-width: 100%; border-radius: 10px; border: 3px solid var(--gold); display: block; }
.card-assign { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: end; padding: 12px; border-radius: 10px; background: #f1f8f6; border: 1px solid var(--line); }
.primary-action { font-size: 17px; padding: 13px 24px; }
.choice-list { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.choice-list button[aria-pressed='true'] { background: var(--dark); color: #fff; border-color: var(--gold); }
.today-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }

/* ---------- Hộp thoại chi tiết, ảnh, trao đổi ---------- */
.account-dialog.wide-dialog { width: min(940px, calc(100vw - 28px)); }
.account-dialog form { display: grid; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 14px 0; padding-bottom: 8px; }
.tabs button { background: #eef6f4; color: var(--dark); border: 1px solid #cbdfda; padding: 7px 13px; font-size: 13px; }
.tabs button[aria-selected='true'] { background: var(--dark); color: #fff; border-color: var(--gold); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f7faf9; }
.gallery img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
.gallery figcaption { padding: 7px 9px; font-size: 12px; color: var(--muted); }
.full-image { width: 100%; height: auto; border-radius: 10px; }
.chat-list { display: grid; gap: 8px; max-height: min(46vh, 430px); overflow-y: auto; padding-right: 4px; }
.chat-item { border-left: 3px solid #008565; background: #edf6f2; border-radius: 7px; padding: 10px 12px; }
.chat-item.mine { background: #fff8e3; border-left-color: #d9a520; }
.chat-item p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; }
.chat-item.recalled p { font-style: italic; color: #84918b; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.chat-head time { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.chat-quote { border-left: 3px solid #7ba99a; background: #ffffffb0; border-radius: 5px; padding: 6px 9px; margin-top: 7px; font-size: 13px; color: #315d52; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chat-form { display: grid; gap: 10px; margin-top: 12px; }
.chat-form input[type='file'] { flex: 1 1 240px; width: auto; }
.reply-preview { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid #c4dfd4; background: #edf6f2; border-radius: 7px; padding: 7px 10px; font-size: 13px; }
.discussion-layout { display: grid; grid-template-columns: minmax(260px, 4fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.thread-list { display: grid; gap: 8px; max-height: 70vh; overflow-y: auto; }
.thread-list button { text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 400; display: grid; gap: 3px; }
.thread-list button[aria-pressed='true'] { border-color: var(--green); background: #eef8f4; }
.thread-list .unread-count { background: #df3d48; color: #fff; border-radius: 12px; padding: 1px 8px; font-size: 11px; font-weight: 700; }

/* ---------- Cấu hình ---------- */
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.check-set { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check-set label { display: flex; align-items: center; gap: 5px; font-weight: 500; font-size: 13px; }
h3.form-section { font-size: 13px !important; }
.role-card summary { cursor: pointer; }
.role-card .form-grid { margin-top: 12px; }
.nav-table input[type='number'] { width: 76px; }
.nav-table input[type='text'] { min-width: 170px; }
.branding-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.branding-preview .bar { display: grid; place-items: center; padding: 10px; }
.branding-preview .title { padding: 12px; }
.branding-preview .title h3, .branding-preview .title p { margin: 0; line-height: 1.25; }
.branding-preview .foot { padding: 10px 14px; }

@media (max-width: 1100px) {
  #panel-dashboard .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .reception, .today-grid, .discussion-layout, .walkin-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .form-grid, .filters, .camera-options { grid-template-columns: minmax(0, 1fr); }
  #fixedHeader31 .admin-button > span + span { display: none; }
  .config-menu .admin-button > span { display: inline !important; }
  .brand-logo-text { min-width: 0; font-size: 20px; padding: 4px 10px; }
  .user-name { display: none; }
  .card-assign { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  #panel-dashboard .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #fixedHeader31 > .topbar { gap: 6px; padding: 5px 8px; }
  .header-button { padding: 7px 9px; font-size: 12px; }
}
@media print {
  #fixedHeader31, #notification, .exit { display: none !important; }
}

.pickup-thumb { width: 72px; border-radius: 6px; border: 2px solid var(--gold); cursor: zoom-in; display: block; }
.pickup-big { max-width: 100%; border-radius: 10px; display: block; margin: 0 auto; }
.import-drop { display: grid; gap: 10px; padding: 14px; border: 2px dashed var(--line, #b7d3cb); border-radius: 12px; background: #f5fbf8; }
.import-result { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.import-result > div { background: #f5fbf8; border-radius: 10px; padding: 8px 10px; text-align: center; }
.import-result strong { display: block; font-size: 1.5rem; }
.import-errors { max-height: 220px; overflow: auto; }
@media (max-width: 640px) { .import-result { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bad-text { color: #962b22; }
.gate-banner { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 18px; border-radius: 12px; border: 2px solid; margin: 10px 0; }
.gate-banner strong { font-size: 1.6rem; letter-spacing: .04em; }
.gate-banner span { font-size: 1rem; opacity: .85; }
.gate-banner.in { background: #e4f6ec; border-color: #2e9d62; color: #0a6b3d; }
.gate-banner.out { background: #fde8e6; border-color: #d4473a; color: #b42318; }
