:root {
  color-scheme: light;
  --navy: #11182d;
  --navy-soft: #1c2744;
  --violet: #5b42ef;
  --violet-dark: #4933d5;
  --ink: #182036;
  --muted: #667085;
  --line: #dfe3eb;
  --surface: #fff;
  --background: #f3f5f9;
  --success: #176b43;
  --danger: #a61b34;
  --warning: #a35d05;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--ink); }
body.modal-open {
  overflow: hidden;
  width: 100%;
  touch-action: none;
}
body.modal-open .modal-backdrop { touch-action: pan-y; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
[hidden] { display: none !important; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2 { margin-top: 0; line-height: 1.12; }
h1 { margin-bottom: 12px; font-size: clamp(2rem, 4vw, 3rem); }
h2 { margin-bottom: 14px; font-size: 1.35rem; }
h3 { margin: 0; font-size: 1rem; }

.centered-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 520px); padding: 38px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 24px 70px rgba(17,24,45,.14); }
.brand-mark { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 24px; color: #fff; background: var(--violet); border-radius: 18px; font-weight: 900; font-size: 1.15rem; }
.mfa-setup-card { width: min(100%, 760px); }
.mfa-setup-grid { display: grid; grid-template-columns: 230px 1fr; align-items: center; gap: 28px; margin-top: 24px; }
.mfa-qr { width: 230px; height: 230px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.mfa-secret { display: block; padding: 12px; overflow-wrap: anywhere; color: var(--violet-dark); background: #f1efff; border-radius: 10px; font-size: .88rem; }

.eyebrow { margin: 0 0 7px; color: var(--violet-dark); font-size: .76rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow.light { color: #b8afff; }
.muted, .help-text, .form-note, .password-rule { color: var(--muted); line-height: 1.55; }
.help-text, .form-note, .password-rule { font-size: .88rem; }
.form-stack { display: grid; gap: 16px; margin-top: 26px; }
.password-form { margin-top: 0; }
.password-form .modal-footer { margin: 4px -24px -22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.four-columns { grid-template-columns: repeat(4, 1fr); }
.wide-field { grid-column: 1 / -1; }
.wide-panel { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #344054; font-size: .86rem; font-weight: 800; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd1dc; border-radius: 11px; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(91,66,239,.16); border-color: var(--violet); }
.input-with-button { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.check-label { display: flex; align-items: flex-start; gap: 9px; line-height: 1.45; }
.check-label input { width: 18px; min-height: 18px; margin-top: 1px; accent-color: var(--violet); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.primary-button, .secondary-button, .small-button, .text-button, .danger-button, .upload-button { border: 0; border-radius: 11px; font-weight: 850; transition: .18s ease; }
.primary-button { min-height: 44px; padding: 10px 17px; color: #fff; background: var(--violet); box-shadow: 0 7px 16px rgba(91,66,239,.2); }
.primary-button:hover { background: var(--violet-dark); transform: translateY(-1px); }
.secondary-button, .small-button, .upload-button { padding: 10px 14px; color: #344054; background: #eef1f6; border: 1px solid #dfe3eb; }
.small-button, .upload-button { min-height: 36px; padding: 7px 11px; font-size: .78rem; }
.secondary-button:hover, .small-button:hover, .upload-button:hover { background: #e3e7ef; }
.text-button { padding: 8px; color: var(--violet-dark); background: transparent; }
.danger-button { padding: 9px 12px; color: var(--danger); background: #fff1f3; border: 1px solid #ffc9d2; }
.danger-button:hover { background: #ffe3e8; }
.icon-button { min-width: 38px; min-height: 38px; padding: 4px; color: #d2d7e3; background: transparent; border: 0; border-radius: 9px; font-size: 1.8rem; line-height: 1; }
.icon-button:hover { background: rgba(255,255,255,.09); color: #fff; }

.notice { position: fixed; z-index: 100; top: 16px; left: 50%; width: min(calc(100% - 32px), 900px); transform: translateX(-50%); padding: 15px 18px; color: var(--success); background: #edfff6; border: 1px solid #b9ebd1; border-radius: 13px; box-shadow: 0 12px 36px rgba(17,24,45,.16); font-weight: 700; }
.notice.error { color: var(--danger); background: #fff1f3; border-color: #ffc9d2; }

.app-header { position: sticky; z-index: 30; top: 0; color: #fff; background: var(--navy); box-shadow: 0 4px 18px rgba(17,24,45,.16); }
.header-main { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; width: min(calc(100% - 32px), 1320px); margin: auto; }
.header-brand { display: flex; align-items: center; gap: 13px; flex: 0 0 auto; }
.header-logo { width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: var(--violet); border-radius: 13px; box-shadow: 0 8px 20px rgba(91,66,239,.32); font-size: 1.5rem; font-weight: 900; }
.brand-line { display: flex; align-items: center; gap: 9px; }
.brand-line strong { font-size: 1.15rem; }
.brand-line span { padding: 4px 9px; color: #c8c1ff; background: rgba(91,66,239,.22); border: 1px solid rgba(137,121,255,.3); border-radius: 999px; font-size: .75rem; font-weight: 800; }
.header-brand small { display: block; margin-top: 3px; color: #9fa9c0; }
.header-search { position: relative; flex: 1 1 420px; max-width: 440px; }
.header-search span { position: absolute; left: 13px; top: 7px; color: #98a2b3; font-size: 1.4rem; }
.header-search input { padding-left: 38px; color: #eef1f7; background: #1c253c; border-color: #35405b; }
.header-search input::placeholder { color: #98a2b3; }
.account-area { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.role-badge { padding: 8px 12px; color: #c8c1ff; background: rgba(91,66,239,.22); border: 1px solid rgba(137,121,255,.34); border-radius: 999px; font-size: .82rem; font-weight: 850; white-space: nowrap; }
.header-exit { padding: 9px 13px; color: #e8ebf2; background: var(--navy-soft); border: 1px solid #33405d; border-radius: 10px; font-weight: 750; }
.header-link { text-decoration: none; font-size: .82rem; }
.session-strip { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 8px max(16px, calc((100vw - 1320px)/2)); color: #9fa9c0; border-top: 1px solid #202a44; font-size: .82rem; }
.session-strip > span { color: #43c788; }
.session-strip strong { color: #fff; }
.test-access-controls { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.test-access-controls[hidden] { display: none; }
.test-access-controls > span { color: #f0d58d; font-weight: 800; }
.test-access-controls select { width: auto; min-width: 150px; height: 28px; padding: 3px 28px 3px 9px; color: #fff; background: #242e49; border: 1px solid #465372; border-radius: 7px; font-size: .73rem; }

.page-shell { width: min(calc(100% - 32px), 1320px); margin: 32px auto 70px; }
.hero-panel { padding: clamp(30px,5vw,52px); color: #fff; background: var(--navy); border-radius: 27px; box-shadow: 0 16px 40px rgba(17,24,45,.14); }
.hero-chip { display: inline-flex; margin: 0 0 18px; padding: 7px 14px; color: #b7aeff; background: rgba(91,66,239,.2); border: 1px solid rgba(137,121,255,.34); border-radius: 999px; font-size: .78rem; font-weight: 850; }
.hero-panel h1 { margin-bottom: 12px; }
.hero-panel > p:last-child { max-width: 760px; margin-bottom: 0; color: #dce1ee; line-height: 1.5; }
.role-panel { margin-top: 26px; }
.section-space { margin-top: 22px; }
.grid-two { display: grid; grid-template-columns: minmax(0,.9fr) minmax(360px,1.1fr); gap: 22px; }
.panel-card { min-width: 0; padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 8px 25px rgba(17,24,45,.06); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.tabs { display: flex; gap: 6px; padding: 10px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 24px rgba(17,24,45,.06); }
.tab { flex: 0 0 auto; padding: 11px 14px; color: #45506a; background: transparent; border: 0; border-radius: 11px; font-size: .8rem; font-weight: 850; white-space: nowrap; }
.tab:hover { background: #f0f2f7; }
.tab.active { color: #fff; background: var(--violet); box-shadow: 0 5px 12px rgba(91,66,239,.22); }
.tab-panel { margin-top: 22px; }

.metrics-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; }
.metric-card { position: relative; min-height: 142px; padding: 21px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 5px 18px rgba(17,24,45,.05); }
.metric-card::after { content: ""; position: absolute; right: -20px; bottom: -24px; width: 90px; height: 90px; border-radius: 50%; opacity: .07; background: currentColor; }
.metric-card span, .metric-card small { display: block; color: var(--muted); font-weight: 700; }
.metric-card span { min-height: 36px; font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; }
.metric-card strong { display: block; margin: 5px 0; color: currentColor; font-size: 2rem; line-height: 1; }
.metric-card small { font-size: .72rem; }
.metric-card.amber { color: #b56708; }
.metric-card.indigo { color: #5141d8; }
.metric-card.emerald { color: #188253; }
.metric-card.slate { color: #344054; }
.guest-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 7px 20px rgba(17,24,45,.05); }
.filter-pills, .toolbar-actions { display: flex; align-items: center; gap: 7px; overflow-x: auto; }
.filter-pill { padding: 9px 12px; color: #59647a; background: #f0f2f7; border: 1px solid transparent; border-radius: 11px; font-size: .76rem; font-weight: 850; white-space: nowrap; }
.filter-pill.active { color: #fff; background: var(--navy); }
.toolbar select { min-width: 150px; min-height: 40px; font-size: .8rem; }

.card-list, .registration-list { display: grid; gap: 13px; }
.list-item { display: flex; justify-content: space-between; gap: 18px; padding: 15px; background: #f7f8fb; border: 1px solid #e5e8ef; border-radius: 13px; }
.list-item strong, .list-item span, .list-item small { display: block; }
.list-item span { margin-top: 4px; color: var(--muted); font-size: .84rem; }
.list-item small { margin-top: 5px; color: #98a2b3; }
.item-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.status-pill, .access-pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; font-size: .72rem; font-weight: 850; white-space: nowrap; }
.status-pending { color: #92550b; background: #fff2d8; border: 1px solid #f1cd83; }
.status-approved { color: #176b43; background: #e5faef; border: 1px solid #aee1c7; }
.status-checked_in { color: #4338ca; background: #ecebff; border: 1px solid #c7c2ff; }
.status-checked_out { color: #475467; background: #eef1f5; border: 1px solid #d5dae3; }
.status-rejected { color: #a61b34; background: #fff0f3; border: 1px solid #ffc4cf; }
.access-pill { color: #4933d5; background: #eeeaff; }
#admin-units-list { min-width: 0; }
#admin-units-list .list-item { min-width: 0; align-items: flex-start; flex-direction: column; overflow: hidden; }
#admin-units-list .list-item > div:first-child { min-width: 0; width: 100%; }
#admin-units-list .list-item > div:first-child span,
#admin-units-list .list-item > div:first-child small { max-width: 100%; overflow-wrap: anywhere; }
#admin-units-list .item-actions { width: 100%; min-width: 0; justify-content: flex-start; }
#admin-units-list .list-item .access-pill { flex: 1 1 100%; width: 100%; max-width: 100%; margin: 0; color: #fff; white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }

.registration-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 20px rgba(17,24,45,.055); }
.consent-view { min-height: 100vh; padding: 36px 18px; background: #f3f5f8; }
.system-consent-card { width: min(920px,100%); margin: 0 auto; padding: 30px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 20px 55px rgba(17,24,45,.13); }
.system-consent-card > header { display: flex; gap: 18px; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.system-consent-card h1 { margin: 3px 0 8px; font-size: clamp(1.8rem,4vw,2.7rem); }
.system-consent-card header p:last-child { margin: 0; color: var(--muted); }
.system-consent-documents { display: grid; gap: 14px; margin: 22px 0; }
.system-consent-documents details { border: 1px solid var(--line); border-radius: 14px; background: #fafbfc; overflow: hidden; }
.system-consent-documents summary { padding: 16px 18px; cursor: pointer; font-weight: 900; }
.system-consent-documents summary span { float: right; color: var(--muted); font-size: .72rem; }
.system-legal-text { max-height: 280px; overflow: auto; padding: 0 18px 18px; color: #4b5568; white-space: pre-wrap; font-size: .88rem; line-height: 1.65; }
.system-consent-check { display: flex; gap: 12px; align-items: flex-start; padding: 15px; background: #f0f3ec; border-radius: 12px; }
.system-consent-check input { flex: 0 0 20px; width: 20px; height: 20px; margin: 2px 0 0; }
.system-consent-audit { padding: 15px 18px; color: #4d5a40; background: #f7f5ec; border-left: 4px solid #788565; }
.system-consent-audit p { margin: 4px 0 0; font-size: .82rem; }
.system-consent-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 22px; }
@media (max-width:640px){.system-consent-card{padding:20px;border-radius:18px}.system-consent-card>header{flex-direction:column}.system-consent-actions{align-items:stretch;flex-direction:column-reverse}.system-consent-actions button{width:100%}.system-consent-documents summary span{float:none;display:block;margin-top:4px}}
.registration-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid #edf0f4; }
.registration-title { display: flex; align-items: center; gap: 11px; }
.unit-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--navy); border-radius: 12px; font-weight: 900; }
.registration-title h3 { margin-bottom: 4px; font-size: 1.05rem; }
.protocol { padding: 3px 7px; color: #667085; background: #f0f2f7; border-radius: 6px; font: 700 .7rem ui-monospace,monospace; }
.registration-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; margin: 14px 0; }
.info-box { min-height: 92px; padding: 13px; background: #f8f9fb; border: 1px solid #e7e9ef; border-radius: 12px; }
.info-box > small { display: block; margin-bottom: 7px; color: #7b8497; font-size: .66rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.info-box strong, .info-box span { display: block; }
.info-box span { margin-top: 4px; color: #59647a; font-size: .78rem; }
.registration-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 13px; border-top: 1px solid #edf0f4; }
.guest-acceptance-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0; padding: 12px 14px; border-radius: 11px; font-size: .78rem; }
.guest-acceptance-box strong,.guest-acceptance-box span { display: block; }
.guest-acceptance-box.accepted { color: #286147; background: #edf8f1; border: 1px solid #bfe2cb; }
.guest-acceptance-box.pending { color: #8a5a12; background: #fff8e8; border: 1px solid #efd493; }
@media(max-width:640px){.guest-acceptance-box{align-items:flex-start;flex-direction:column}}
.empty-state, .empty-hint { padding: 38px 20px; color: #98a2b3; text-align: center; background: #fff; border: 1px dashed #ccd2dc; border-radius: 16px; }
.empty-hint { margin: 0; padding: 18px; background: #fafbfc; font-size: .82rem; }

.host-actions-banner { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 24px; color: #e9ebf3; background: #1b253e; border: 1px solid #2b3754; border-radius: 20px; }
.host-actions-banner h2 { margin-bottom: 8px; color: #fff; }
.host-actions-banner p:last-child { margin-bottom: 0; color: #abb4c8; font-size: .85rem; }
.unit-summary { padding: 17px 20px; background: #eeeaff; border: 1px solid #cfc8ff; border-radius: 16px; }
.unit-summary strong { color: #3327a8; }
.host-complaints-panel { border-color: #d9ddce; background: linear-gradient(145deg,#fff,#fafbf5); }
.host-complaints-list { display: grid; gap: 10px; margin-top: 17px; }
.host-complaint-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 18px; padding: 15px 17px; border: 1px solid #e0e3d7; border-left: 4px solid #8c9765; border-radius: 13px; background: #fff; }
.host-complaint-card strong,.host-complaint-card span,.host-complaint-card small { display: block; }
.host-complaint-card strong { color: var(--navy); }
.host-complaint-card span { margin-top: 4px; color: #606b61; font-size: .82rem; }
.host-complaint-card small { color: #8a938b; font-size: .71rem; }
.host-complaint-card .status-pill { align-self: start; grid-column: 2; grid-row: 1 / span 2; }
.host-complaint-card .complaint-response { grid-column: 1 / -1; margin-top: 5px; padding: 10px 12px; color: #46534b; background: #f1f5ed; border-radius: 9px; font-size: .78rem; line-height: 1.5; }
.complaint-unit-summary { padding: 12px 14px; color: #39412f; background: #f2f4e9; border: 1px solid #dfe4ce; border-radius: 11px; font-weight: 800; }
.complaint-form textarea { min-height: 130px; resize: vertical; }
.complaint-confidential { padding: 11px 13px; background: #f7f8f3; border-radius: 10px; }
.complaint-notice { margin: -4px 0 0; font-size: .75rem; }

.message-form { display: grid; grid-template-columns: minmax(220px,.55fr) minmax(280px,1.45fr) auto; align-items: end; gap: 12px; margin: 20px 0; }
.host-message-form { grid-template-columns: 1fr auto; }
.host-unit-switcher { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, #f8f7f0, #eef1e8); }
.host-unit-switcher label { display: grid; gap: 7px; min-width: min(100%, 420px); color: var(--ink); font-weight: 800; }
.host-unit-switcher label span { color: var(--navy); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.host-unit-switcher select { min-height: 44px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); padding: 0 12px; font: inherit; }
.host-unit-switcher p { margin: 0; max-width: 390px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.host-conversation-area { min-height: 240px; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfe; }
.messages-area { display: grid; gap: 9px; max-height: 430px; overflow: auto; padding: 3px; }
.message-bubble { width: min(86%,700px); padding: 12px 14px; background: #f0f2f7; border-radius: 14px 14px 14px 4px; }
.message-bubble.mine { justify-self: end; color: #fff; background: var(--violet); border-radius: 14px 14px 4px 14px; }
.message-bubble strong, .message-bubble span, .message-bubble time { display: block; }
.message-bubble span { margin: 5px 0; white-space: pre-wrap; }
.message-bubble time { font-size: .7rem; opacity: .72; }
.unread-badge { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: 5px; padding: 0 6px; color: #fff; background: #d83f5b; border-radius: 20px; font-size: .68rem; line-height: 1; vertical-align: middle; }
.unread-badge[hidden] { display: none; }
.tab.active .unread-badge { color: #d83f5b; background: #fff; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; color: #25865f; font-size: .75rem; font-weight: 850; white-space: nowrap; }
.live-indicator i { width: 8px; height: 8px; background: #2fc17f; border-radius: 50%; box-shadow: 0 0 0 4px rgba(47,193,127,.13); animation: livePulse 1.8s ease infinite; }
.conversation-shell { display: grid; grid-template-columns: minmax(220px,310px) 1fr; min-height: 520px; margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #f8f9fc; }
.conversation-list { max-height: 620px; overflow-y: auto; padding: 9px; border-right: 1px solid var(--line); background: #fff; }
.conversation-unit { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding: 13px; color: #34405a; background: transparent; border: 0; border-bottom: 1px solid #edf0f5; border-radius: 10px; text-align: left; }
.conversation-unit:hover { background: #f4f2ff; }
.conversation-unit.active { color: #3023ac; background: #eeebff; }
.conversation-unit strong,.conversation-unit span,.conversation-unit small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-unit strong { font-size: .82rem; }
.conversation-unit span { grid-column: 1; color: #687189; font-size: .73rem; }
.conversation-unit small { grid-column: 1; color: #98a0b2; font-size: .67rem; }
.conversation-unit .unread-badge { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.conversation-main { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; background: #fff; }
.conversation-header { min-height: 66px; display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.conversation-header small,.conversation-header strong { display: block; }
.conversation-header small { margin-bottom: 4px; color: #8b94a6; font-size: .66rem; font-weight: 850; letter-spacing: .08em; }
.conversation-header strong { color: var(--navy); }
.conversation-main .messages-area { max-height: none; min-height: 320px; padding: 18px; }
.conversation-compose { grid-template-columns: 1fr auto; margin: 0; padding: 14px 18px; border-top: 1px solid var(--line); background: #fafbfe; }
@keyframes livePulse { 50% { opacity: .55; box-shadow: 0 0 0 7px rgba(47,193,127,.04); } }
.report-panel { text-align: center; padding: 50px; }
.report-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 16px; color: #fff; background: var(--violet); border-radius: 16px; font-size: 1.8rem; }
.report-panel .form-actions { justify-content: center; }

.modal-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(9,15,30,.82);
  backdrop-filter: blur(5px);
}
.modal {
  width: min(100%,680px);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #cfd5df;
  border-radius: 20px;
  box-shadow: 0 28px 85px rgba(4,10,23,.38);
}
.modal-wide { width: min(100%,1040px); }
.modal-header { min-height: 76px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; color: #fff; background: var(--navy); }
.modal-header h2 { margin: 0; }
.modal-header small { color: #adb6ca; }
.modal-header > div:last-child { display: flex; align-items: center; gap: 8px; }
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 22px 24px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.form-sections { display: grid; gap: 15px; }
.form-section { padding: 19px; background: #fff; border: 1px solid #e2e6ed; border-radius: 15px; }
.form-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.form-section h3 > span { width: 25px; height: 25px; display: grid; place-items: center; color: #fff; background: var(--violet); border-radius: 8px; font-size: .74rem; }
.form-section .section-heading h3 { margin-bottom: 16px; }
.form-section .section-heading small { color: #7b8497; }
.rules-accept { color: #e4e7ef; background: var(--navy); border-color: #2a3551; }
.rules-accept label { color: #e4e7ef; }
.rules-summary { margin: 0 0 16px; padding: 15px; color: #c5ccda; background: #1b2540; border-radius: 11px; font-size: .8rem; line-height: 1.55; }
.rules-summary p { margin: 4px 0; }
.rules-editor-form { display: grid; gap: 14px; margin-top: 20px; }
.rules-editor-form label { display: grid; gap: 8px; font-weight: 800; }
.rules-editor-form textarea { min-height: 300px; resize: vertical; line-height: 1.65; }
.rules-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rules-editor-footer small { color: var(--muted); }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 15px 24px; background: #f6f7fa; border-top: 1px solid #dfe3eb; }
.form-sections > .modal-footer { margin: 0 -24px -22px; }

.upload-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.upload-card { padding: 13px; background: #f8f9fb; border: 1px solid #e0e4eb; border-radius: 13px; text-align: center; }
.upload-card.featured { background: #f3f1ff; border-color: #d3ceff; }
.upload-card > strong { display: block; margin-bottom: 9px; font-size: .78rem; }
.upload-preview { height: 130px; display: grid; place-items: center; overflow: hidden; color: #98a2b3; background: #fff; border: 1px dashed #c8ced8; border-radius: 9px; font-size: .76rem; }
.upload-preview img { width: 100%; height: 100%; object-fit: contain; }
.upload-preview .pdf-preview { font-weight: 900; color: #a61b34; }
.upload-actions { display: flex; justify-content: center; gap: 6px; margin-top: 9px; }
.companions-list { display: grid; gap: 9px; }
.companion-row { display: grid; gap: 12px; padding: 13px; background: #f8f9fb; border: 1px solid #e3e6ec; border-radius: 11px; }
.companion-fields { display: grid; grid-template-columns: 1.4fr .7fr 1fr .7fr auto; align-items: end; gap: 8px; }
.companion-documents { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding-top: 11px; border-top: 1px solid #e0e4eb; }
.companion-documents label { padding: 9px; background: #fff; border: 1px solid #d9dee8; border-radius: 9px; }
.companion-row label { font-size: .72rem; }
.companion-row input, .companion-row select { min-height: 40px; padding: 7px 9px; font-size: .78rem; }
.companion-documents input[type="file"] { width: 100%; margin-top: 6px; padding: 6px; color: #667085; background: #f8f9fb; }

.details-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; padding: 13px 24px; background: #f5f7fa; border-bottom: 1px solid var(--line); }
.details-summary div { font-size: .75rem; }
.details-summary span, .details-summary strong { display: block; }
.details-summary span { margin-bottom: 4px; color: #7b8497; }
.modal-tabs { display: flex; gap: 4px; padding: 9px 24px 0; overflow-x: auto; border-bottom: 1px solid var(--line); }
.modal-tabs button { padding: 10px 13px; color: #667085; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: .78rem; font-weight: 850; white-space: nowrap; }
.modal-tabs button.active { color: var(--violet-dark); border-color: var(--violet); }
.identity-title { margin-bottom: 14px; padding: 13px; background: #f7f8fb; border: 1px solid #e2e5ec; border-radius: 12px; }
.identity-title strong, .identity-title span { display: block; }
.identity-title span { margin-top: 5px; color: #667085; font-size: .78rem; }
.documents-grid { display: grid; gap: 18px; }
.document-person { display: grid; gap: 9px; }
.document-person + .document-person { padding-top: 18px; border-top: 1px solid var(--line); }
.document-person h4 { margin: 0; font-size: .86rem; }
.identity-documents-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.document-card { padding: 12px; background: #f8f9fb; border: 1px solid #dde2e9; border-radius: 12px; }
.document-card strong { display: block; margin-bottom: 8px; font-size: .76rem; }
.document-view { height: 190px; display: grid; place-items: center; overflow: hidden; color: #98a2b3; background: #101728; border-radius: 9px; font-size: .76rem; text-align: center; }
.document-view img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.document-view a { color: #fff; }
.vehicle-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px; color: #fff; background: var(--navy); border-radius: 15px; }
.vehicle-card strong, .vehicle-card span { display: block; }
.vehicle-plate { margin: 7px 0; padding: 7px 11px; background: #202a43; border: 1px solid #3d4863; border-radius: 8px; font: 900 1.4rem ui-monospace,monospace; letter-spacing: .08em; }
.comment-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.rejection-box, .error-box { margin-top: 12px; padding: 14px; color: var(--danger); background: #fff1f3; border: 1px solid #ffc9d2; border-radius: 11px; }
.rejection-box { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; }

.pass-modal { width: min(100%,780px); }
.printable-pass { padding: 34px; color: #172033; background: #fff; }
.pass-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 15px; border-bottom: 2px solid #172033; }
.pass-heading h1 { margin: 0; font-size: 1.25rem; }
.pass-protocol { padding: 7px 10px; color: #3327a8; background: #eeeaff; border: 1px solid #cac3ff; border-radius: 8px; font: 900 .9rem ui-monospace,monospace; }
.pass-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 14px 18px; background: #f5f7fa; border: 1px solid #dfe3eb; border-radius: 13px; }
.pass-summary h2 { margin: 4px 0; font-size: 1.5rem; }
.pass-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-top: 14px; }
.pass-box { padding: 13px; background: #f8f9fb; border: 1px solid #dfe3eb; border-radius: 10px; font-size: .78rem; }
.pass-box strong, .pass-box span { display: block; }
.pass-rules { margin-top: 14px; padding: 14px; color: #6f4a12; background: #fff8e6; border: 1px solid #ebd49d; border-radius: 11px; font-size: .75rem; }
.pass-signatures { display: grid; grid-template-columns: repeat(2,1fr); gap: 38px; margin-top: 36px; text-align: center; font-size: .74rem; }
.signature-line { height: 1px; margin-bottom: 7px; background: #7b8497; }

.camera-modal video, .camera-modal canvas, .camera-modal img { width: 100%; max-height: 55vh; object-fit: contain; background: #080d18; border-radius: 12px; }

@media (max-width: 980px) {
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .grid-two { grid-template-columns: 1fr; }
  .registration-grid { grid-template-columns: 1fr 1fr; }
  .header-search { display: none !important; }
  .four-columns { grid-template-columns: 1fr 1fr; }
  .companion-fields { grid-template-columns: 1fr 1fr; }
  .companion-fields button { justify-self: start; }
}

@media (max-width: 720px) {
  .session-strip { flex-wrap: wrap; }
  .test-access-controls { width: 100%; margin: 5px 0 0; flex-wrap: wrap; }
  .test-access-controls select { flex: 1; min-width: 125px; }
  .page-shell { width: min(calc(100% - 22px),1320px); margin-top: 18px; }
  .header-main { width: min(calc(100% - 22px),1320px); padding: 11px 0; }
  #account-name, .header-brand small { display: none; }
  .account-area { gap: 6px; }
  .hero-panel { border-radius: 20px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: space-between; }
  .form-grid, .four-columns { grid-template-columns: 1fr; }
  .wide-field { grid-column: auto; }
  .upload-grid, .identity-documents-grid, .companion-documents { grid-template-columns: 1fr; }
  .registration-top, .section-heading, .host-actions-banner { align-items: stretch; flex-direction: column; }
  .host-complaint-card { grid-template-columns: 1fr; }
  .host-complaint-card .status-pill { grid-column: 1; grid-row: auto; justify-self: start; }
  .registration-grid { grid-template-columns: 1fr; }
  .message-form, .host-message-form, .comment-form, .rejection-box { grid-template-columns: 1fr; }
  .host-unit-switcher { align-items: stretch; flex-direction: column; }
  .conversation-shell { grid-template-columns: 1fr; }
  .conversation-list { max-height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }
  .conversation-compose { grid-template-columns: 1fr; }
  .details-summary { grid-template-columns: 1fr 1fr; }
  .modal-backdrop {
    padding: 0;
    align-items: stretch;
    height: 100vh;
    height: 100dvh;
  }
  .modal {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .modal-header {
    padding-top: max(18px, env(safe-area-inset-top));
  }
  .modal-body {
    max-height: none;
    padding: 18px 18px max(18px, env(safe-area-inset-bottom));
  }
  .form-sections > .modal-footer { margin: 0 -18px -18px; }
  .pass-grid, .pass-summary { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .centered-view { padding: 13px; }
  .login-card, .panel-card { padding: 21px; }
  .brand-line span, .role-badge { display: none; }
  .metrics-grid, .guest-metrics { grid-template-columns: 1fr; }
  .metric-card { min-height: 125px; }
  .toolbar-actions { align-items: stretch; flex-direction: column; }
  .registration-actions .primary-button, .registration-actions .secondary-button { width: 100%; }
  .mfa-setup-grid { grid-template-columns: 1fr; }
  .mfa-qr { width: min(100%,230px); height: auto; margin: auto; }
  .details-summary { grid-template-columns: 1fr; }
  .printable-pass { padding: 20px; }
}

@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    background: #fff !important;
    overflow: hidden !important;
  }
  body * { visibility: hidden !important; }
  #pass-modal, #pass-modal * { visibility: visible !important; }
  #pass-modal {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
  }
  #printable-pass, #printable-pass * { visibility: visible !important; }
  #printable-pass {
    position: relative !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8mm 10mm !important;
    font-size: .74rem !important;
    line-height: 1.3 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .no-print { display: none !important; }
  .pass-heading { padding-bottom: 10px !important; border-bottom-width: 2px !important; }
  .pass-heading h1 { font-size: 1.15rem !important; }
  .pass-summary { margin-top: 10px !important; padding: 10px 14px !important; }
  .pass-summary h2 { margin: 2px 0 !important; font-size: 1.35rem !important; }
  .pass-grid { gap: 8px !important; margin-top: 10px !important; }
  .pass-box { padding: 9px 11px !important; font-size: .72rem !important; }
  .pass-rules { margin-top: 10px !important; padding: 10px 12px !important; font-size: .7rem !important; }
  .pass-rules p { margin-top: 3px !important; }
  .pass-signatures { margin-top: 25px !important; gap: 24px !important; font-size: .7rem !important; page-break-inside: avoid !important; break-inside: avoid !important; }
  .signature-line { margin-bottom: 5px !important; }
  @page { size: A4 portrait; margin: 0; }
}
