/* The hotel side (reception, manager, platform pages). Loaded after style.css; everything is scoped to body.s2.
   Look: a white top bar with underlined tabs, soft white cards on a pale blue page, navy primary buttons, soft status pills. */
body.s2 {
  --navy: #0b2a5b; --navy-dark: #081f46; --accent: #0a6b4a; --accent-dark: #085640; --accent-soft: #e7f4ee; --accent-line: #b8dccb; --ink: #162036; --muted: #66738a; --line: #e2e8f2; --page: #f3f6fb;
  --ok-bg: #dcf5e5; --ok: #166534; --info-bg: #e7ecf4; --info: #475569; --warn-bg: #fdecc8; --warn: #92580a; --bad-bg: #fde2e2; --bad: #b42318;
  background: var(--page); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
body.s2 main.wide { max-width: 1380px; padding: 20px 24px 32px; }
body.s2 h1 { font-size: 1.5rem; color: var(--navy); margin: 0; }
body.s2 h2 { font-size: 1.05rem; color: var(--ink); margin: 0; }
body.s2 .muted { color: var(--muted); font-size: .9rem; }
body.s2 .hidden { display: none !important; }

/* ---- top bar ---- */
#appbar { display: none; }
body.s2 #appbar { display: block; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.appbar-in { max-width: 1380px; margin: 0 auto; padding: 0 24px; min-height: 66px; display: flex; align-items: center; gap: 28px; }
.appmenu, .appsub, .navsignout { display: none; }
.appbrand { display: flex; align-items: center; gap: 14px; flex: none; }
.applogo { height: 32px; width: auto; display: block; }
.appdiv { width: 1px; height: 30px; background: var(--line); }
.apphotel { font-weight: 800; font-size: 1.1rem; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.hotellogo { max-height: 32px; max-width: 90px; object-fit: contain; border-radius: 6px; }
.appnav { display: flex; gap: 2px; flex: 1 1 auto; justify-content: center; flex-wrap: wrap; }
.appnav .tab { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--muted); font-weight: 600; padding: 0 14px; min-height: 66px; font-size: .95rem; margin-bottom: -1px; }
.appnav .tab:hover { color: var(--navy); }
.appnav .tab.on { color: var(--navy); border-bottom-color: var(--accent); }
.appuser { display: flex; align-items: center; gap: 10px; flex: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.appuser-name { display: flex; flex-direction: column; line-height: 1.2; }
.appuser-name small { color: var(--muted); }
.signout { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; font-size: .88rem; }

/* ---- buttons, fields, cards ---- */
body.s2 button, body.s2 .btn { border-radius: 10px; font-weight: 700; background: var(--accent); border: 1px solid var(--accent); color: #fff; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
body.s2 button:hover:not(:disabled) { background: var(--accent-dark); }
body.s2 button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent-line); }
body.s2 button.secondary:hover:not(:disabled) { background: var(--accent-soft); }
body.s2 button.danger { background: #fff; color: var(--bad); border: 1px solid #e9a9a2; }
body.s2 button.danger:hover:not(:disabled) { background: #fff4f3; }
body.s2 button.big { min-height: 52px; font-size: 1rem; border-radius: 12px; }
body.s2 button.linkbtn { background: none; border: 0; color: var(--accent); min-height: 0; padding: 2px 4px; font-weight: 600; font-size: .9rem; }
body.s2 button.linkbtn:hover { background: none; text-decoration: underline; }
body.s2 .tab { min-height: 0; }
body.s2 input, body.s2 select, body.s2 textarea { border: 1px solid #d3dbe8; border-radius: 10px; padding: 12px 12px; background: #fff; min-height: 48px; color: var(--ink); }
body.s2 input:focus, body.s2 select:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
body.s2 input[type=checkbox] { width: 18px; min-height: 0; height: 18px; accent-color: var(--accent); }
body.s2 label { font-weight: 600; font-size: .92rem; }
.fieldlabel { margin: 12px 0 4px; color: var(--muted); }
.field { position: relative; margin-top: 10px; }
.field > svg { position: absolute; left: 14px; top: 15px; color: #8a97ad; pointer-events: none; }
.field > input, .field > select { padding-left: 42px; width: 100%; }
body.s2 .card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 0 0 16px; box-shadow: 0 1px 3px rgba(15, 34, 80, .05); }
.cardhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cardhead h2 { flex: 1; }
.cardhead p { margin: 2px 0 0; }
.cardicon { width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.cardicon.sm { width: 32px; height: 32px; }
.actions { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.actions > * { flex: 1 1 0; }
.actions.two > .primary { flex: 1.5 1 0; }
.newform .actions { margin-top: 16px; }
body.s2 .msg { border-radius: 10px; }

/* ---- layout of the check-ins page ---- */
.ci-grid { display: grid; grid-template-columns: 400px minmax(0, 1fr); grid-template-areas: "new guest" "recent guest"; gap: 0 22px; align-items: start; }
.ci-new { grid-area: new; }
.ci-recent { grid-area: recent; }
.ci-guest { grid-area: guest; }
.subtabs { display: none; }
.backlink { display: none; }

/* ---- the Recent list ---- */
.recent .cardhead { margin-bottom: 4px; }
.recent-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 8px; border-bottom: 1px solid #eef1f6; cursor: pointer; border-left: 3px solid transparent; }
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover { background: #f4faf7; }
.recent-row.sel { background: #edf7f2; border-left-color: var(--accent); }
.rr-main { min-width: 0; }
.rr-main b { display: block; font-weight: 700; }
.rr-main .muted { font-size: .83rem; }
.rr-side { display: flex; align-items: center; gap: 6px; flex: none; color: #8a97ad; }

/* ---- status pills ---- */
body.s2 .badge { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--info-bg); color: var(--info); white-space: nowrap; }
body.s2 .badge.verified, body.s2 .badge.completed { background: var(--ok-bg); color: var(--ok); }
body.s2 .badge.fallback_required { background: var(--warn-bg); color: var(--warn); }
body.s2 .badge.cancelled, body.s2 .badge.expired { background: var(--bad-bg); color: var(--bad); }
body.s2 .badge.out { background: #e7ecf4; color: #475569; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 99px; font-size: .82rem; font-weight: 700; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

/* ---- the open check-in ---- */
.detail { min-width: 0; }
.dhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.dhead-main { flex: 1 1 260px; min-width: 0; }
.dtitle { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dhead .muted { margin: 2px 0 0; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
.cols2.cards { gap: 16px; align-items: stretch; }
.cols2.cards > .card { margin-bottom: 16px; }
.guestcol { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.guestcol .kv { flex: 1; min-width: 0; }
body.s2 .photo { width: 96px; height: 120px; flex: none; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: minmax(110px, 150px) 1fr; gap: 9px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.pics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 4px 0 8px; }
.pic { margin: 0; }
.pic.single { grid-column: 1 / -1; max-width: 520px; }
body.s2 .pic-thumb { width: 100%; max-width: none; display: block; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; }
.pic figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 6px; }
.alert { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 13px 16px; margin: 0 0 16px; font-size: .93rem; }
.alert > svg { flex: none; margin-top: 2px; }
.alert.bad { background: #fdeeee; border: 1px solid #f3c5c5; color: #7f1d1d; }
.alert.info { background: var(--accent-soft); border: 1px solid var(--accent-line); color: #085640; }
.declare { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; font-weight: 500; }
.declare input { margin-top: 3px; flex: none; }
.donebanner { display: flex; align-items: center; gap: 16px; background: var(--accent-soft); border: 1px solid #bfe6cd; border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; }
.donecheck { width: 52px; height: 52px; border-radius: 50%; background: #1a8a4a; color: #fff; display: grid; place-items: center; flex: none; }
.donebanner b { font-size: 1.1rem; color: #14532d; }
.donebanner p { margin: 2px 0 0; color: #166534; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.tick { width: 22px; height: 22px; flex: none; border-radius: 6px; display: grid; place-items: center; }
.tick.ok { background: var(--accent); color: #fff; }
.tick.bad { background: var(--bad-bg); color: var(--bad); }
table.audit { font-size: .85rem; }
table.audit th { background: #f3f6fb; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: none; padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.audit td { padding: 8px; border-bottom: 1px solid #eef1f6; }
.emptystate { text-align: center; color: var(--muted); padding: 48px 20px; display: grid; justify-items: center; gap: 8px; }
.emptystate svg { color: #a3b1c8; }

/* the QR card and the forms inside the details */
.qr svg { max-width: 260px; }
body.s2 .msg.good { background: var(--ok-bg); color: var(--ok); }
body.s2 .msg.bad { background: var(--bad-bg); color: var(--bad); }
body.s2 tr.pick:hover, body.s2 tr.sel { background: #f4faf7; }
body.s2 table th, body.s2 table td { border-bottom-color: #eef1f6; }
body.s2 .row > * { flex: 1 1 140px; }

/* ---- sign-in ---- */
body:not(.s2) main.wide { max-width: 460px; }

/* ---- phone: one pane at a time, a menu instead of the tab bar ---- */
@media (max-width: 900px) {
  body.s2 main.wide { padding: 14px 14px 28px; }
  .appbar-in { display: grid; grid-template-columns: 44px 1fr 44px; grid-template-areas: "menu brand user" "sub sub sub" "nav nav nav"; align-items: center; gap: 4px 8px; padding: 8px 14px 10px; min-height: 0; }
  .appmenu { display: inline-flex; grid-area: menu; background: none; border: 0; color: var(--ink); min-height: 40px; width: 40px; padding: 0; }
  .appmenu:hover:not(:disabled) { background: var(--accent-soft); }
  .appbrand { grid-area: brand; justify-content: center; }
  .appdiv, .apphotel { display: none; }
  .applogo { height: 30px; }
  .appuser { grid-area: user; justify-content: flex-end; }
  .appuser-name, .signout { display: none; }
  .appsub { display: block; grid-area: sub; text-align: center; line-height: 1.25; }
  .appsub b { display: block; font-size: 1rem; color: var(--ink); }
  .appsub small { color: var(--muted); }
  .appnav { grid-area: nav; display: none; flex-direction: column; gap: 0; border-top: 1px solid var(--line); margin-top: 6px; }
  #appbar.open .appnav { display: flex; }
  .appnav .tab { min-height: 46px; text-align: left; border-bottom: 1px solid #f0f3f8; margin: 0; padding: 0 6px; }
  .appnav .tab.on { border-bottom-color: #f0f3f8; color: var(--accent); }
  .appnav .navsignout { display: block; color: var(--bad); }

  .ci-grid { display: block; }
  .subtabs { display: flex; border-bottom: 1px solid var(--line); margin: -2px 0 14px; background: transparent; }
  .subtab { flex: 1; background: none !important; border: 0 !important; border-bottom: 3px solid transparent !important; border-radius: 0 !important; color: var(--muted) !important; min-height: 44px; font-weight: 700; margin-bottom: -1px; }
  .subtab.on { color: var(--navy) !important; border-bottom-color: var(--accent) !important; }
  .ci-new, .ci-recent, .ci-guest { display: none; }
  .ci-grid[data-pane=checkin] .ci-new, .ci-grid[data-pane=recent] .ci-recent, .ci-grid[data-pane=guest] .ci-guest { display: block; }
  .backlink { display: inline-flex; flex: 1 0 100%; background: none; border: 0; color: var(--accent); justify-content: flex-start; padding: 0; min-height: 28px; font-weight: 600; }
  .backlink:hover:not(:disabled) { background: none; }
  .dhead .secondary { flex: 1 1 100%; }
  .cols2 { grid-template-columns: 1fr; gap: 8px; }
  .kv { grid-template-columns: 120px 1fr; }
  .actions.two { flex-direction: column; }
  .pics { gap: 10px; }
}
@media (max-width: 520px) {
  body.s2 .card { padding: 14px; }
  .guestcol { flex-direction: column; }
}

/* ---- corrections: the rules above for plain `button` are more specific than the single-class ones ---- */
body.s2 button.appmenu, body.s2 button.navsignout, body.s2 button.backlink { display: none; }
body.s2 .appsub { display: none; }
body.s2 .subtabs { display: none; }
body.s2 .field > input, body.s2 .field > select { padding-left: 42px; }
body.s2 .ci-grid { grid-template-rows: auto 1fr; }
body.s2 .actions { margin-bottom: 16px; }
body.s2 .cardhead { margin-bottom: 14px; }
@media (max-width: 900px) {
  body.s2 button.appmenu { display: inline-flex; }
  body.s2 #appbar.open button.navsignout, body.s2 button.navsignout { display: block; }
  body.s2 #appbar:not(.open) button.navsignout { display: none; }
  body.s2 button.backlink { display: inline-flex; }
  body.s2 .appsub { display: block; }
  body.s2 .subtabs { display: flex; }
  body.s2 .ci-grid { display: block; }
}

@media (max-width: 900px) {
  body.s2 .appuser button.signout, body.s2 .appuser .appuser-name { display: none; }
  body.s2 button.appmenu { background: none; border: 0; color: var(--ink); width: 40px; padding: 0; min-height: 40px; }
  body.s2 button.appmenu:hover:not(:disabled) { background: var(--accent-soft); }
  body.s2 button.backlink { background: none; border: 0; color: var(--accent); justify-content: flex-start; padding: 0; min-height: 28px; flex: 1 0 100%; font-weight: 600; }
  body.s2 button.backlink:hover:not(:disabled) { background: none; }
  body.s2 .appnav button.tab { background: none; border: 0; border-bottom: 1px solid #f0f3f8; border-radius: 0; color: var(--ink); justify-content: flex-start; min-height: 46px; font-weight: 600; }
  body.s2 .appnav button.tab.on { color: var(--accent); }
  body.s2 .appnav button.navsignout { color: var(--bad); }
}

body.s2 #appbar:empty { display: none; }
.login { margin: 48px auto 0; }
.login-logo { display: block; height: 40px; width: auto; margin: 0 auto 18px; }
.login h1 { text-align: center; margin-bottom: 14px; }
.login .card { padding: 20px; }
.login .row { margin-top: 16px; }

/* narrower desktop windows: the same bar, a little tighter */
@media (max-width: 1280px) and (min-width: 901px) {
  .appbar-in { gap: 14px; padding: 0 16px; }
  .appnav { flex-wrap: nowrap; justify-content: flex-start; }
  .appnav .tab { padding: 0 9px; font-size: .88rem; white-space: nowrap; }
  .appuser-name, .signout span { display: none; }
  .signout { padding: 0 10px; }
  .apphotel { font-size: 1rem; }
}
@media (max-width: 1280px) and (min-width: 901px) {
  .appbrand { flex: none; }
  .appnav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .appnav::-webkit-scrollbar { display: none; }
  .apphotel { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .appuser { flex: none; }
}

/* ======== phone: an app, with a bottom bar (Check-In, Recent, Guest, Profile) ======== */
.bottomnav { display: none; }
.profile { display: grid; gap: 14px; }
.profilehead { display: flex; align-items: center; gap: 14px; margin: 0; }
.avatar.big { width: 56px; height: 56px; font-size: 1.1rem; }
.profilelist { padding: 6px 4px; margin: 0; }
body.s2 button.profile-row { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-bottom: 1px solid #f0f3f8; border-radius: 0; color: var(--ink); min-height: 56px; padding: 6px 12px; font-weight: 600; text-align: left; justify-content: flex-start; }
body.s2 button.profile-row:last-child { border-bottom: 0; }
body.s2 button.profile-row:hover:not(:disabled) { background: #f4faf7; }
body.s2 button.profile-row .pr-label { flex: 1; }
body.s2 button.profile-row > svg:last-child { color: #8a97ad; }
body.s2 button.profile-row.danger { color: var(--bad); }
body.s2 button.profile-row.danger .cardicon { background: var(--bad-bg); color: var(--bad); }

@media (max-width: 900px) {
  body.s2 { -webkit-tap-highlight-color: transparent; }
  /* a slim app header: logo, hotel name and role (the menu and the avatar are in the Profile tab now) */
  body.s2 #appbar { position: sticky; top: 0; }
  .appbar-in { grid-template-columns: 1fr; grid-template-areas: "brand" "sub"; padding: 10px 14px 8px; gap: 2px; justify-items: center; }
  body.s2 button.appmenu, .appuser, .appnav { display: none !important; }
  .appsub { grid-area: sub; }
  .appsub b { font-size: .95rem; }
  .appsub small { font-size: .78rem; }
  body.s2 main.wide { padding: 14px 14px calc(92px + env(safe-area-inset-bottom)); }
  body.s2 .subtabs { display: none; }
  body.s2 .card { border-radius: 16px; box-shadow: 0 2px 10px rgba(15, 34, 80, .06); }
  body.s2 button.big { min-height: 54px; border-radius: 14px; }

  body.s2 .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(15, 34, 80, .08); padding-bottom: env(safe-area-inset-bottom); }
  body.s2 .bottomnav:empty { display: none; }
  body.s2 .bottomnav button.bn-item { flex: 1 1 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 62px; padding: 8px 2px 7px; background: none; border: 0; border-radius: 0; color: var(--muted); font-size: .72rem; font-weight: 700; }
  body.s2 .bottomnav button.bn-item:hover:not(:disabled) { background: none; }
  body.s2 .bottomnav button.bn-item.on { color: var(--accent); }
  body.s2 .bottomnav button.bn-item.on::before { content: ""; position: absolute; top: 0; left: 50%; width: 30px; height: 3px; margin-left: -15px; border-radius: 0 0 4px 4px; background: var(--accent); }
  body.s2 .bottomnav button.bn-item svg { width: 24px; height: 24px; }
}

/* ======== manager and platform pages ======== */
.pagehead { display: flex; align-items: center; gap: 14px; margin: 2px 0 18px; }
.pagehead .cardicon { width: 46px; height: 46px; }
.pagehead h1 { font-size: 1.55rem; }
.pagehead p { margin: 2px 0 0; }
.twocol { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings, .sections { display: block; max-width: 860px; }
.sections > .card, .settings > .card { margin-bottom: 16px; }
.savebar { position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 8px 24px rgba(15, 34, 80, .14); }
.savebar .row { margin-top: 0; }
body.s2 .card > .row, body.s2 .dcard > .row { margin-top: 14px; }
.cols2 .kv, .sections .cols2 { align-items: start; }
.sections .cols2 { gap: 0 24px; }

body.s2 table { font-size: .92rem; }
body.s2 thead th { background: #f3f6fb; color: var(--muted); font-size: .78rem; font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line); }
body.s2 td { padding: 12px 10px; }
body.s2 td button { min-height: 38px; padding: 0 14px; font-size: .88rem; }
body.s2 td select { min-height: 40px; }
body.s2 .tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 16px; flex-wrap: wrap; }
body.s2 .tabs button.tab { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--muted); min-height: 44px; padding: 0 16px; margin-bottom: -1px; }
body.s2 .tabs button.tab:hover:not(:disabled) { background: none; color: var(--navy); }
body.s2 .tabs button.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
body.s2 .card .muted + input, body.s2 .card .muted + select { margin-top: 4px; }

@media (max-width: 900px) {
  .twocol { grid-template-columns: 1fr; }
  .pagehead { margin-bottom: 12px; }
  .pagehead h1 { font-size: 1.3rem; }
  .pagehead .cardicon { width: 40px; height: 40px; }
  .savebar { bottom: calc(76px + env(safe-area-inset-bottom)); }
}
/* on a phone a table becomes a list of small cards */
@media (max-width: 700px) {
  body.s2 .card table:not(.audit) { display: block; }
  body.s2 .card table:not(.audit) thead { display: none; }
  body.s2 .card table:not(.audit) tbody, body.s2 .card table:not(.audit) tr, body.s2 .card table:not(.audit) td { display: block; width: 100%; }
  body.s2 .card table:not(.audit) tr { padding: 10px 0; border-bottom: 1px solid #eef1f6; }
  body.s2 .card table:not(.audit) td { padding: 3px 2px; border: 0; }
  body.s2 .card table:not(.audit) td button, body.s2 .card table:not(.audit) td select { width: 100%; margin-top: 4px; }
  .sections .cols2 { grid-template-columns: 1fr; }
}

body.s2 .card > h2:first-child { margin: 0 0 12px; }
/* narrower desktop windows with a long list of tabs (a manager's): a tighter bar */
@media (max-width: 1280px) and (min-width: 901px) {
  .appbar-in { gap: 10px; padding: 0 12px; }
  .appnav .tab { padding: 0 7px; font-size: .84rem; }
  .appdiv { display: none; }
  .applogo { height: 28px; }
  .apphotel { font-size: .95rem; max-width: 120px; }
}
/* narrower desktop windows: brand and user on the first row, the tabs on a second row of their own, so nothing is squeezed */
@media (max-width: 1280px) and (min-width: 901px) {
  .appbar-in { flex-wrap: wrap; row-gap: 0; gap: 0 14px; padding: 0 18px; }
  .appbrand { min-height: 58px; margin-right: auto; }
  .appdiv { display: block; }
  .applogo { height: 30px; }
  .apphotel { max-width: none; font-size: 1.05rem; }
  .appuser { min-height: 58px; }
  .appuser-name { display: flex; }
  .signout span { display: inline; }
  .appnav { order: 3; flex: 1 0 100%; justify-content: flex-start; overflow: visible; border-top: 1px solid #eef1f6; }
  .appnav .tab { min-height: 46px; font-size: .9rem; padding: 0 12px; }
}

/* the page a new manager opens from the invite link */
body.setup main#app { max-width: 620px; margin: 0 auto; padding: 8px 16px 40px; }
body.setup h1 { text-align: center; }
.setuphead { text-align: center; padding: 22px 0 4px; }
.setuphead img { height: 38px; width: auto; }
body.setup .cols2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { body.setup .cols2 { grid-template-columns: 1fr; } }

/* ======== the open check-in: wide, short cards in one column ======== */
body.s2 button.small { min-height: 36px; padding: 0 14px; font-size: .86rem; border-radius: 9px; }
body.s2 button.mini { min-height: 36px; padding: 0 4px; margin-right: 18px; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--muted); font-size: .92rem; }
body.s2 button.mini:hover:not(:disabled) { background: none; color: var(--navy); }
body.s2 button.mini.on { color: var(--accent); border-bottom-color: var(--accent); }
.minitabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.dhead { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 12px; }
.dhead h1 { font-size: 1.25rem; margin: 0; }
.idtag { margin-left: auto; font-size: .82rem; }
.dactions { display: flex; gap: 8px; flex-wrap: wrap; }
.strip { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; }
.strip .avatar.big { width: 48px; height: 48px; font-size: 1rem; flex: none; }
.strip-name { display: flex; flex-direction: column; min-width: 150px; flex: 1 1 160px; }
.strip-name b { font-size: 1.1rem; color: var(--navy); }
.ifield small { display: block; color: var(--muted); font-size: .78rem; }
.ifield > div { font-weight: 600; }
.inline { display: flex; gap: 10px 34px; flex-wrap: wrap; align-items: flex-start; }
body.s2 .dcard { padding: 12px 16px; margin-bottom: 12px; }
body.s2 .dcard .cardhead { margin-bottom: 8px; }
body.s2 .dcard .cardhead h2 { font-size: .98rem; }
.cardicon.sm { width: 28px; height: 28px; }
.guestcol { display: flex; gap: 16px; align-items: flex-start; }
body.s2 .photo { width: 78px; height: 98px; }
.kv.two { grid-template-columns: repeat(2, minmax(100px, 150px) minmax(0, 1fr)); gap: 6px 14px; flex: 1; }
.kv { font-size: .9rem; }
.pics { gap: 12px; margin: 0 0 6px; }
body.s2 .pic-thumb { max-height: 190px; object-fit: contain; background: #f1f4f9; }
.pic figcaption { margin-top: 3px; font-size: .8rem; }
.pics + .muted { margin: 0 0 6px; font-size: .8rem; }
.pics ~ .row { margin-top: 6px; }
.pics ~ .row button { min-height: 36px; font-size: .86rem; padding: 0 10px; }
.confirmbar { display: flex; gap: 16px; align-items: center; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 14px; padding: 12px 16px; margin-bottom: 12px; }
.confirmbar .declares { flex: 1; min-width: 0; }
.confirmbar .declare { background: none; border: 0; padding: 0 0 4px; margin: 0; font-size: .92rem; }
.confirmbar button.big { flex: 0 0 auto; min-height: 48px; padding: 0 26px; }
.note { margin: 0 0 12px; }
.auditscroll { max-height: 160px; overflow: auto; border: 1px solid #eef1f6; border-radius: 10px; }
.auditscroll table.audit th { position: sticky; top: 0; }
table.audit td { padding: 6px 8px; font-size: .82rem; }
.ticks { gap: 6px; }
details.fallback > summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; list-style: none; padding: 2px 0; }
details.fallback > summary::-webkit-details-marker { display: none; }
details.fallback > summary::after { content: "+"; margin-left: auto; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details.fallback[open] > summary::after { content: "\2212"; }
details.fallback .fallbackbody { margin-top: 10px; }
@media (min-width: 1280px) { .ci-grid { grid-template-columns: 360px minmax(0, 1fr); gap: 0 18px; } }
@media (max-width: 900px) {
  .idtag { margin-left: 0; flex: 1 0 100%; }
  .dactions { flex: 1 0 100%; }
  .dactions .small { flex: 1; }
  .kv.two { grid-template-columns: minmax(100px, 130px) minmax(0, 1fr); }
  .confirmbar { flex-direction: column; align-items: stretch; }
  .guestcol { flex-direction: column; }
  .strip { gap: 10px 20px; }
}

/* ======== check-in details: header line, one details card with the pictures beside it ======== */
.dhead { margin-bottom: 10px; }
.idtag { margin-left: auto; font-size: .85rem; white-space: pre-wrap; }
.dsplit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.details .cardhead .pill { margin-left: 4px; }
.details .cardhead h2 { flex: 0 1 auto; }
.details .cardhead { justify-content: flex-start; }
.dsplit .guestcol { gap: 14px; }
.dsplit .kv { grid-template-columns: minmax(88px, 118px) 1fr; }
.dsplit .pics { grid-template-columns: 1fr 1fr; margin: 0 0 6px; }
body.s2 .dsplit .pic-thumb { max-height: 150px; }
.dsplit .picacts { display: flex; gap: 8px; }
.gp-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.gp-head b { font-size: .98rem; }
.guestsbar .gp .row { margin-top: 8px; }
.guestsbar .gp .row button { min-height: 40px; }
.guestsbar table { margin-bottom: 4px; }
.auditscroll { max-height: 140px; }
.recent-row { padding: 10px 8px; }
.rr-main .muted { font-size: .8rem; line-height: 1.35; }
.dsplit .pics + .muted { font-size: .76rem; margin: 0 0 4px; }
.dsplit .pics ~ .row { margin-top: 4px; gap: 8px; }
.dsplit .pics ~ .row button { min-height: 34px; font-size: .82rem; }
@media (max-width: 1279px) { .dsplit { grid-template-columns: 1fr; } }

/* the menu stays on one line */
@media (min-width: 1281px) {
  .appbar-in { gap: 16px; }
  .appnav { flex-wrap: nowrap; justify-content: center; min-width: 0; }
  .appnav .tab { white-space: nowrap; padding: 0 11px; font-size: .92rem; }
  .apphotel { white-space: nowrap; }
}
@media (min-width: 1281px) and (max-width: 1560px) {
  .appuser-name { display: none; }
  .appnav .tab { padding: 0 9px; font-size: .9rem; }
  .hotellogo { max-width: 70px; }
}
@media (min-width: 1281px) and (max-width: 1560px) {
  .apphotel { max-width: 190px; overflow: hidden; text-overflow: ellipsis; margin-right: 8px; }
  .appnav { margin-left: 6px; }
  .signout span { display: none; }
  .signout { padding: 0 11px; }
}

.enq-wrap{max-width:860px}
.enq{margin-bottom:14px}
.enq.new{border-left:4px solid #d99a1f}
.enq-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:10px}
.enq .kv{grid-template-columns:110px 1fr}
.enq .row{align-items:center;gap:10px}.enq .row select{max-width:200px}

/* wide tables scroll inside their own box instead of widening the whole page on a phone */
.xscroll { max-width: 100%; overflow-x: auto; }

/* ---- help assistant for signed-in staff ---- */
.hc { position: fixed; right: 18px; bottom: 18px; z-index: 35; font-family: inherit; }
body.s2 .hc .hc-launch { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px 0 12px; border: 0; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 600; font-size: .92rem; font-family: inherit; cursor: pointer; box-shadow: 0 8px 22px rgba(8, 31, 70, .28); }
body.s2 .hc .hc-launch:hover { background: var(--accent-dark); }
body.s2 .hc .hc-q { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .2); font-weight: 700; font-size: 1rem; }
body.s2 .hc.hc-open .hc-launch { display: none; }
body.s2 .hc .hc-launch:focus-visible, body.s2 .hc .hc-close:focus-visible, body.s2 .hc .hc-send:focus-visible, body.s2 .hc .hc-chip:focus-visible, body.s2 .hc .hc-ask:focus-visible, body.s2 .hc .hc-primary:focus-visible, body.s2 .hc .hc-link:focus-visible { outline: 3px solid #6ee7a8; outline-offset: 2px; }
body.s2 .hc .hc-panel { position: absolute; right: 0; bottom: 0; width: min(380px, calc(100vw - 24px)); height: min(540px, calc(100vh - 100px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 56px rgba(8, 31, 70, .3); overflow: hidden; }
body.s2 .hc .hc-panel[hidden] { display: none; }
body.s2 .hc .hc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--navy); color: #fff; }
body.s2 .hc .hc-head strong { display: block; font-size: .98rem; }
body.s2 .hc .hc-head small { display: block; color: #cfe0f5; font-size: .74rem; margin-top: 2px; }
body.s2 .hc .hc-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; }
body.s2 .hc .hc-close:hover { background: rgba(255, 255, 255, .14); }
body.s2 .hc .hc-body { flex: 1; overflow-y: auto; padding: 14px 14px 6px; background: var(--page); display: flex; flex-direction: column; gap: 10px; }
body.s2 .hc .hc-msg { max-width: 90%; padding: 9px 12px 10px; border-radius: 14px; font-size: .92rem; line-height: 1.5; word-wrap: break-word; }
body.s2 .hc .hc-msg p { margin: 0 0 6px; color: inherit; }
body.s2 .hc .hc-msg p:last-child { margin-bottom: 0; }
body.s2 .hc .hc-msg ul, body.s2 .hc .hc-msg ol { margin: 4px 0 6px; padding-left: 20px; }
body.s2 .hc .hc-msg li { margin-bottom: 3px; color: inherit; }
body.s2 .hc .hc-bot { align-self: flex-start; background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
body.s2 .hc .hc-me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
body.s2 .hc .hc-typing { color: var(--muted); }
body.s2 .hc .hc-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 14px 8px; background: var(--page); }
body.s2 .hc .hc-chips:empty { display: none; }
body.s2 .hc .hc-chip { border: 1px solid #c8d2e0; background: #fff; color: var(--navy); border-radius: 99px; padding: 7px 12px; font-weight: 600; font-size: .8rem; line-height: 1.2; font-family: inherit; cursor: pointer; text-align: left; min-height: 0; }
body.s2 .hc .hc-chip:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
body.s2 .hc .hc-askrow { padding: 4px 14px 8px; background: var(--page); text-align: center; }
body.s2 .hc .hc-ask { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: .84rem; font-family: inherit; text-decoration: underline; cursor: pointer; padding: 6px; min-height: 0; }
body.s2 .hc .hc-ask:hover { background: none; }
body.s2 .hc .hc-ask.hc-hot { background: var(--accent); color: #fff; text-decoration: none; border-radius: 99px; padding: 9px 16px; }
body.s2 .hc .hc-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); }
body.s2 .hc .hc-input { flex: 1; min-width: 0; resize: none; border: 1.5px solid #c8d2e0; border-radius: 12px; padding: 10px 12px; font: inherit; font-size: .95rem; line-height: 1.4; max-height: 110px; color: var(--ink); }
body.s2 .hc .hc-input:focus, body.s2 .hc .hc-support textarea:focus, body.s2 .hc .hc-support input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
body.s2 .hc .hc-send, body.s2 .hc .hc-primary { border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; font-size: .9rem; font-family: inherit; padding: 0 16px; min-height: 42px; cursor: pointer; }
body.s2 .hc .hc-send:disabled, body.s2 .hc .hc-primary:disabled { opacity: .55; cursor: default; }
body.s2 .hc .hc-primary { width: 100%; }
body.s2 .hc .hc-note { margin: 0; padding: 7px 14px 10px; font-size: .7rem; line-height: 1.35; color: var(--muted); background: #fff; }
body.s2 .hc .hc-support { display: flex; flex-direction: column; gap: 9px; }
body.s2 .hc .hc-support textarea, body.s2 .hc .hc-support input { width: 100%; border: 1.5px solid #c8d2e0; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: .93rem; background: #fff; color: var(--ink); }
body.s2 .hc .hc-support textarea { resize: vertical; }
body.s2 .hc .hc-lead { margin: 0; font-size: .9rem; color: var(--ink); }
body.s2 .hc .hc-err { margin: 0; font-size: .8rem; color: var(--bad); }
body.s2 .hc .hc-err:empty { display: none; }
body.s2 .hc .hc-muted { color: var(--muted); font-size: .8rem; }
body.s2 .hc .hc-link { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: .84rem; font-family: inherit; text-decoration: underline; cursor: pointer; padding: 6px; align-self: center; min-height: 0; }
body.s2 .hc .hc-link:hover { background: none; }
body.s2 .hc .hc-ok { text-align: center; padding: 26px 10px; }
body.s2 .hc .hc-ok p { margin: 0 0 8px; color: var(--ink); }
body.s2 .hc .hc-tick { width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.7rem; line-height: 60px; margin: 0 auto 14px; font-weight: 700; }
@media (max-width: 900px) {
  .hc { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.s2 .hc .hc-launchtext { display: none; }
  body.s2 .hc .hc-launch { padding: 0 12px; }
  body.s2 .hc .hc-panel { position: fixed; left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; height: min(70vh, 560px); }
}
@media print { .hc { display: none; } }

/* ======== platform admin redesign (Oct 2026): cards with icons, tables with thumbnails, stat rows, kebab menus, pagination ======== */
body.s2 .pcard .cardhead { align-items: flex-start; }
body.s2 .pcard .cardhead h2 { font-size: 1.02rem; }
body.s2 .pcard .cardhead p { font-size: .85rem; }
body.s2 .hint { font-size: .8rem; margin: 4px 0 0; }
body.s2 .req { color: var(--bad); }
body.s2 label + input, body.s2 label + select, body.s2 label + .field, body.s2 label + .phonefield, body.s2 label + .row.addrow { margin-top: 4px; }
body.s2 .card label { display: block; margin-top: 12px; }
body.s2 .card label:first-child, body.s2 .cardhead + label, body.s2 .cols2 label:first-child { margin-top: 0; }
body.s2 .card label.check, body.s2 .card label.checkrow, body.s2 .card label.switchrow { display: flex; }
.phonefield { display: flex; align-items: stretch; }
.phonefield .cc { display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid #d3dbe8; border-right: 0; border-radius: 10px 0 0 10px; background: #f6f8fb; color: var(--muted); font-weight: 600; }
.phonefield input { border-radius: 0 10px 10px 0; flex: 1; min-width: 0; }
.subrow { display: flex; align-items: center; gap: 6px; }
.logorow { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logobox { width: 96px; height: 96px; flex: none; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.logo-preview { max-width: 88px; max-height: 88px; object-fit: contain; }
.logo-empty { color: #a3b1c8; }
body.s2 button.small { min-height: 38px; padding: 0 14px; font-size: .86rem; }
body.s2 button.iconbtn { min-height: 38px; width: 38px; padding: 0; }
body.s2 .btn.secondary { text-decoration: none; min-height: 44px; padding: 0 16px; }
body.s2 .notice { border-color: #b45309; }
body.s2 .msg.notice { background: #fff8ec; border: 1px solid #f2d59a; color: var(--ink); }

/* two-column pages (a form beside a list) and the settings grid */
.ad-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
.settings-grid .scol > .card { margin-bottom: 16px; }
.acct-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; max-width: 1100px; }
.chats-wrap { max-width: 1100px; }
.card.listcard { padding: 14px 18px 18px; }

/* hotel header on the platform admin's hotel pages */
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; margin: 2px 0 10px; }
.crumbs .cur { color: var(--ink); font-weight: 600; }
.crumbs svg { color: #a3b1c8; }
body.s2 button.linkbtn { background: none; border: 0; color: var(--accent); padding: 0; min-height: 0; font-weight: 600; font-size: inherit; }
.hhead { display: flex; align-items: center; gap: 16px; margin: 0 0 6px; flex-wrap: wrap; }
.hhead-main { flex: 1 1 240px; min-width: 0; }
.hhead-main h1 { font-size: 1.45rem; margin: 0; }
.hhead-sub { display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.hhead-sub .muted { display: inline-flex; align-items: center; gap: 4px; }
.hhead-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.hhead-wrap .tabs { margin-top: 10px; }
.thumb { flex: none; border-radius: 12px; object-fit: cover; background: #fff; border: 1px solid var(--line); }
.thumb.md { width: 44px; height: 44px; }
.thumb.lg { width: 72px; height: 72px; border-radius: 14px; }
.thumb.ph { display: grid; place-items: center; background: linear-gradient(145deg, #e7f4ee, #dbeaf7); color: var(--accent-dark); border: 0; }

/* toolbars: search, filters, chips */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .grow, .grow { flex: 1 1 auto; }
.toolbar select { min-height: 44px; max-width: 200px; }
.searchbox { margin-top: 0; flex: 1 1 220px; max-width: 360px; }
.searchbox input { width: 100%; min-height: 44px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
body.s2 button.chip { background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 99px; min-height: 40px; padding: 0 14px; font-weight: 600; font-size: .9rem; gap: 8px; }
body.s2 button.chip .count { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 99px; background: #eef1f6; color: var(--muted); font-size: .78rem; }
body.s2 button.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
body.s2 button.chip.on .count { background: rgba(255, 255, 255, .22); color: #fff; }

/* tables */
body.s2 table.tbl { width: 100%; border-collapse: collapse; }
body.s2 table.tbl thead th { background: #f3f6fb; color: var(--muted); font-size: .78rem; font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
body.s2 table.tbl thead th:first-child { border-radius: 10px 0 0 10px; }
body.s2 table.tbl thead th:last-child { border-radius: 0 10px 10px 0; }
body.s2 table.tbl td { padding: 14px 12px; border-bottom: 1px solid #eef1f6; vertical-align: middle; font-size: .9rem; }
body.s2 table.tbl tr:last-child td { border-bottom: 0; }
body.s2 table.tbl tr.pick { cursor: pointer; }
body.s2 table.tbl tr.pick:hover td { background: #f8fafd; }
body.s2 table.tbl td.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
body.s2 table.tbl td.who b { display: block; color: var(--navy); }
body.s2 table.tbl td.who small { display: flex; align-items: center; gap: 3px; font-size: .8rem; }
body.s2 table.tbl td.who small.warn { color: var(--warn); }
body.s2 table.tbl td.who small.ref { color: #8a97ad; margin-top: 2px; }
body.s2 table.tbl td.acts { white-space: nowrap; }
body.s2 table.tbl td select { min-height: 40px; font-size: .9rem; }
body.s2 table.tbl.enq td { vertical-align: top; }
body.s2 table.tbl.enq td.contact div, body.s2 table.tbl.enq td.received div, body.s2 table.tbl.enq td.message div { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 5px; font-size: .86rem; }
body.s2 table.tbl.enq td svg { flex: none; margin-top: 3px; color: #8a97ad; }
body.s2 table.tbl.enq td.message { max-width: 280px; }
body.s2 table.tbl.enq td.received .ok { color: var(--ok); }
body.s2 table.tbl.enq tr.isnew td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
body.s2 table.tbl.enq select.statussel { border-radius: 99px; font-weight: 700; padding: 6px 30px 6px 14px; min-height: 36px; }
body.s2 table.tbl.enq select.statussel.new { background-color: var(--ok-bg); color: var(--ok); border-color: #bfe6cd; }
body.s2 table.tbl.enq select.statussel.contacted { background-color: var(--warn-bg); color: var(--warn); border-color: #f1dc9a; }
body.s2 table.tbl.enq select.statussel.closed { background-color: var(--info-bg); color: var(--info); }
body.s2 table.tbl.auditlog td { padding: 12px; font-size: .86rem; }
body.s2 table.tbl.auditlog td.when { white-space: nowrap; color: var(--muted); }
body.s2 table.tbl.auditlog td.who { display: flex; align-items: center; gap: 10px; }
body.s2 table.tbl.auditlog .what { display: flex; align-items: flex-start; gap: 10px; }
body.s2 table.tbl.auditlog .what b { display: block; color: var(--ink); }
body.s2 table.tbl.auditlog .what small { display: block; font-size: .78rem; }
body.s2 table.tbl.auditlog td.details { max-width: 320px; word-break: break-word; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 6px; background: #94a3b8; }
.dot.blue { background: #2563eb; } .dot.green { background: #16a34a; } .dot.amber { background: #d97706; } .dot.red { background: #dc2626; }
.avatar.sm { width: 34px; height: 34px; font-size: .8rem; flex: none; }
.list .listrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f6; }
.list .listrow b { flex: 1; }
.list .listrow:last-child { border-bottom: 0; }

/* pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pages { display: flex; gap: 6px; align-items: center; }
body.s2 button.pagenum { min-height: 36px; min-width: 36px; padding: 0 10px; font-size: .88rem; }
body.s2 button.pagenum.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* kebab menu */
.kebabwrap { position: relative; display: inline-block; }
.kmenu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15, 34, 80, .16); padding: 6px; z-index: 20; display: grid; }
.kmenu.hidden { display: none; }
body.s2 button.menuitem { background: none; border: 0; color: var(--ink); justify-content: flex-start; min-height: 38px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: .9rem; text-align: left; }
body.s2 button.menuitem:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-dark); }
body.s2 button.menuitem.danger { color: var(--bad); }
body.s2 button.menuitem.danger:hover:not(:disabled) { background: #fff4f3; }

/* stat cards */
.stats { display: grid; gap: 14px; margin-bottom: 16px; }
.stats:empty { display: none; }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0 16px; }
.stat { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stats.three .stat { background: #f3f6fb; border: 0; }
.stat.blue { background: #eef4fb; } .stat.green { background: #e8f6ee; } .stat.amber { background: #fff7e6; }
.stat.blue .cardicon { background: #dbe8f8; color: #1d4ed8; } .stat.green .cardicon { background: #d4eedd; } .stat.amber .cardicon { background: #fde9c2; color: #b45309; }
.statbody { min-width: 0; flex: 1; }
.statbody b { display: block; font-size: 1.35rem; color: var(--navy); line-height: 1.2; }
.statbody b small { font-size: .85rem; font-weight: 500; }
.statbody > .muted { display: block; font-size: .85rem; }
.bar { position: relative; height: 6px; background: #e2e8f2; border-radius: 99px; margin: 10px 0 4px; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 99px; }
.bar small { position: absolute; left: 0; top: 10px; font-size: .74rem; }
.stat .bar { margin-bottom: 22px; }

/* switches and check rows */
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch .slider { position: absolute; inset: 0; border-radius: 99px; background: #cbd5e1; transition: background .15s; pointer-events: none; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: .6; }
body.s2 label.switchrow, body.s2 label.checkrow { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #eef1f6; font-weight: 500; cursor: pointer; margin-top: 0; }
body.s2 label.switchrow:last-of-type, body.s2 label.checkrow:last-of-type { border-bottom: 0; }
body.s2 label.checkrow input { margin-top: 3px; width: 18px; height: 18px; }
body.s2 label.switchrow b, body.s2 label.checkrow b { display: block; font-size: .92rem; }
body.s2 label.switchrow small, body.s2 label.checkrow small { display: block; font-size: .8rem; }
body.s2 label.switchrow.status { padding: 0; border: 0; align-items: center; }
.statusline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.statusrow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.statusbox { flex: 1 1 220px; display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; }
.statusbox.ok { background: var(--ok-bg); color: var(--ok); }
.statusbox.bad { background: var(--bad-bg); color: var(--bad); }
.statusbox b { display: block; }
.statusbox small { display: block; font-size: .8rem; }
.infobox, .inforow { display: flex; gap: 10px; align-items: flex-start; background: #eef4fb; border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.infobox > svg, .inforow > svg { flex: none; color: #1d4ed8; margin-top: 2px; }
.infobox p, .inforow p { margin: 0; font-size: .86rem; }
.infobox b, .inforow b { display: block; font-size: .92rem; }
.inforow { background: #fff; border: 1px solid var(--line); align-items: center; }
.inforow > svg { color: var(--accent); }
.qrrow { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
.qrrow .qr { flex: none; }
.qrrow .qr svg { max-width: 150px; }
.linkbox { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.linkbox code { flex: 1; min-width: 0; word-break: break-all; font-size: .82rem; background: #f3f6fb; padding: 8px 10px; border-radius: 8px; }
.linkbox button { min-height: 38px; padding: 0 12px; }
.row.addrow { align-items: center; }
.row.addrow input { flex: 1 1 200px; }
.row.addrow button { flex: 0 0 auto; }

/* account page */
.field.pw input { padding-right: 44px; }
body.s2 button.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; min-height: 36px; padding: 0; background: none; border: 0; color: #8a97ad; }
body.s2 button.eye:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.rules li { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.tick.soft { background: #eef1f6; color: #a3b1c8; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; }
.rules li.ok { color: var(--ok); }
.rules li.ok .tick.soft { background: var(--accent); color: #fff; }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tips li { display: flex; gap: 12px; align-items: flex-start; }
.tips li b { display: block; font-size: .95rem; }
.tips li p { margin: 2px 0 0; font-size: .86rem; }
.tips .cardicon { width: 40px; height: 40px; }

/* empty states, modal, tips */
.empty { text-align: center; padding: 36px 16px; display: grid; justify-items: center; gap: 6px; }
.empty .emptyicon { width: 68px; height: 68px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; }
.empty b { font-size: 1.1rem; color: var(--navy); }
.empty p { max-width: 520px; margin: 0; }
.tipbox { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: #eef8f1; border-radius: 14px; padding: 16px 18px; margin-top: 6px; }
.tipbox b { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.tipbox .ticks { margin-top: 10px; gap: 6px; }
.tipbox .tick.ok { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; }
.tipacts { display: grid; gap: 8px; min-width: 220px; }
.modalwrap { position: fixed; inset: 0; background: rgba(8, 31, 70, .45); z-index: 60; display: grid; place-items: center; padding: 16px; }
body.s2 .card.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; margin: 0; }
body.s2 .card.modal .cardhead { justify-content: space-between; }
details.conv { border-bottom: 1px solid #eef1f6; padding: 8px 0; }
details.conv summary { cursor: pointer; font-weight: 600; }
details.conv p { margin: 8px 0 0; font-size: .9rem; }
details.conv p.visitor { color: var(--navy); }

/* phones and narrow windows */
@media (max-width: 1100px) { .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .ad-grid, .acct-grid { grid-template-columns: 1fr; }
  .stats.three { grid-template-columns: 1fr; }
  .hhead-acts { flex: 1 0 100%; }
  .hhead-acts > * { flex: 1; }
  .toolbar .searchbox { max-width: none; flex: 1 1 100%; }
  .toolbar select { max-width: none; flex: 1 1 100%; }
}
@media (max-width: 700px) {
  .stats.four { grid-template-columns: 1fr; }
  /* the list tables become cards: each row a card, the thumbnail row on top, labels hidden */
  body.s2 .card table.tbl:not(.auditlog) { display: block; }
  body.s2 .card table.tbl:not(.auditlog) thead { display: none; }
  body.s2 .card table.tbl:not(.auditlog) tbody { display: grid; gap: 12px; }
  body.s2 .card table.tbl:not(.auditlog) tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  body.s2 .card table.tbl:not(.auditlog) td { display: block; padding: 0; border: 0; }
  body.s2 .card table.tbl:not(.auditlog) td.who { grid-column: 1 / -1; display: flex; }
  body.s2 .card table.tbl:not(.auditlog) td.acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
  body.s2 .card table.tbl:not(.auditlog) td.acts .row { width: 100%; }
  body.s2 .card table.tbl:not(.auditlog) td.acts .row > button { flex: 1; }
  body.s2 .card table.tbl.enq td.contact, body.s2 .card table.tbl.enq td.message, body.s2 .card table.tbl.enq td.received { grid-column: 1 / -1; max-width: none; }
  body.s2 .card table.tbl:not(.auditlog) td select { width: 100%; }
  body.s2 .card table.tbl.auditlog { min-width: 720px; }
  .pager { justify-content: center; }
  .crumbs { font-size: .8rem; }
  .thumb.lg { width: 56px; height: 56px; }
  .hhead-main h1 { font-size: 1.2rem; }
  body.s2 .card.listcard { padding: 12px; }
}
body.s2 .kebabwrap { flex: 0 0 auto; }
body.s2 .kebabwrap > button.iconbtn { width: 38px; flex: 0 0 38px; }
@media (max-width: 700px) {
  body.s2 .card table.tbl:not(.auditlog) td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; margin-bottom: 3px; }
  body.s2 .card table.tbl:not(.auditlog) td.acts .row > .kebabwrap { flex: 0 0 auto; }
}
