/* ═══════════════════════════════════════════════════════════
   Workflow — shared styles (auth pages, dashboard, admin)
   ═══════════════════════════════════════════════════════════ */

:root {
  --brand: #00654b;
  --brand-2: #008060;
  --brand-soft: #e3f7ef;
  --brand-ink: #00513c;
  --text: #141c25;
  --muted: #56625c;
  --faint: #8a958f;
  --bg: #f7f9ff;
  --surface: #ffffff;
  --surface-2: #edf4ff;
  --border: #e2e8f0;
  --danger: #b42318;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;
  --warn: #92400e;
  --warn-soft: #fffbeb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(20,28,37,.04);
  --shadow-lg: 0 12px 32px rgba(20,28,37,.10);
  --sidebar-w: 240px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand { font-family: 'Manrope', 'Inter', sans-serif; letter-spacing: -.01em; }
h1, h2, h3 { margin: 0; }
a { color: var(--brand); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 9px; border: 1px solid transparent;
  font: 600 .875rem/1.2 'Inter', sans-serif; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .05s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 4px 14px rgba(0,101,75,.2); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(0,101,75,.3); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: none; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-sm { padding: 6px 10px; font-size: .8rem; }
.btn-block { width: 100%; padding: 13px 16px; font-size: .95rem; }

/* ─── Forms ───────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.field input {
  width: 100%; padding: 12px 14px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,101,75,.15); }
.field .hint { font-size: .78rem; color: var(--faint); margin-top: 6px; }
.code-input { text-align: center; font-family: ui-monospace, Menlo, monospace !important; font-size: 1.6rem !important; letter-spacing: .3em; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.alert { border-radius: 9px; padding: 11px 14px; font-size: .85rem; font-weight: 500; margin-bottom: 16px; }
.alert-error { background: var(--danger-soft); color: #991b1b; border: 1px solid var(--danger-line); }
.alert-success { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid #b7ead6; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #dbeafe; display: flex; gap: 10px; align-items: flex-start; }
.alert-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; }

/* ─── Auth screens ────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside {
  background: linear-gradient(150deg, var(--brand) 0%, #0b3b2e 60%, var(--text) 100%);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-aside::after {
  content: ''; position: absolute; width: 420px; height: 420px; right: -120px; top: -120px;
  border-radius: 50%; background: radial-gradient(circle, rgba(146,246,207,.25), transparent 70%);
}
.auth-aside .brand { font-size: 1.6rem; font-weight: 800; }
.auth-aside h2 { font-size: 2.1rem; font-weight: 800; line-height: 1.2; max-width: 440px; }
.auth-aside p { color: rgba(255,255,255,.75); max-width: 420px; }
.auth-aside ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.auth-aside li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.9); font-size: .92rem; }
.auth-aside li svg { width: 18px; height: 18px; stroke: #92f6cf; flex-shrink: 0; }
.auth-aside small { color: rgba(255,255,255,.45); font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: #fbfcff; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand-mobile { display: none; font-size: 1.4rem; font-weight: 800; color: var(--brand); margin-bottom: 28px; }
.auth-card h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.auth-card .lede { color: var(--muted); margin: 0 0 28px; }
.auth-card .switch { text-align: center; margin-top: 24px; color: var(--muted); }

/* Standalone centered card (admin auth) */
.center-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.panel-card { background: var(--surface); border-radius: 20px; padding: 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.panel-card h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.panel-card > p { color: var(--muted); font-size: .9rem; margin: 0 0 24px; }
.icon-badge {
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; align-items: center; justify-content: center;
}
.icon-badge svg { width: 26px; height: 26px; stroke: #fff; }

/* ─── App layout (dashboard + admin) ──────────────────────── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: #f8fafc;
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-head { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); }
.sidebar-head .brand { font-size: 1.1rem; font-weight: 800; color: #064e3b; }
.sidebar-head .brand span { color: var(--brand-2); }
.sidebar-head .who { font-size: .78rem; color: var(--faint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { flex: 1; padding: 10px 8px; display: grid; align-content: start; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 8px; background: none;
  color: #64748b; font: 600 .875rem 'Inter', sans-serif; cursor: pointer; text-align: left;
}
.nav button:hover { color: #065f46; background: rgba(0,101,75,.05); }
.nav .nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #64748b; font: 600 .875rem 'Inter', sans-serif; }
.nav .nav-link:hover { color: #065f46; background: rgba(0,101,75,.05); }
.nav button.active { background: #fff; color: #065f46; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.nav svg, .sidebar-foot svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-foot { padding: 12px 8px; border-top: 1px solid var(--border); }
.sidebar-foot button { width: 100%; justify-content: flex-start; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 28px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 1.1rem; font-weight: 800; color: #064e3b; }
.menu-btn { display: none; }
.content { padding: 28px; max-width: 1120px; width: 100%; }
.view { display: none; }
.view.active { display: block; }

/* ─── Cards / stats ───────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card h2 { font-size: 1.05rem; font-weight: 800; }
.card .sub { color: var(--muted); font-size: .86rem; margin: 4px 0 0; }
.card-narrow { max-width: 560px; }

.hero {
  background: linear-gradient(120deg, var(--brand) 0%, #0b4d3b 100%); color: #fff;
  border-radius: 16px; padding: 28px; margin-bottom: 20px;
}
.hero h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.hero p { margin: 0; color: rgba(255,255,255,.8); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.stat .label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.stat .value { font: 800 1.7rem 'Manrope', sans-serif; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge-on { background: var(--brand-soft); color: var(--brand-ink); }
.badge-off { background: #f1f5f9; color: #64748b; }
.badge-bad { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: #fef3c7; color: #92400e; }

/* ─── Tables ──────────────────────────────────────────────── */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 200px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; }
.toolbar input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,101,75,.15); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); background: #f8fafc; }
th, td { padding: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .name { font-weight: 600; }
td .email { color: var(--muted); font-size: .82rem; }
td.actions { text-align: right; }
td.actions .btn + .btn { margin-left: 4px; }
td .email { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 32px; text-align: center; color: var(--faint); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); font-size: .85rem; }
.pager .btn + .btn { margin-left: 6px; }

/* ─── TOTP setup ──────────────────────────────────────────── */
.totp-setup { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: start; margin-top: 8px; }
.totp-setup img { width: 180px; height: 180px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.totp-setup ol { margin: 0 0 14px; padding-left: 18px; color: var(--muted); font-size: .88rem; }
.secret { display: inline-block; background: var(--surface-2); padding: 4px 8px; border-radius: 6px; font-size: .8rem; word-break: break-all; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1; min-width: 160px; }

/* ─── Modal & toast ───────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20,28,37,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 16px; padding: 26px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: .875rem; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ─── Landing ─────────────────────────────────────────────── */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing header { display: flex; justify-content: space-between; align-items: center; padding: 20px 32px; }
.landing header .brand { font-size: 1.3rem; font-weight: 800; color: var(--brand); }
.landing header nav { display: flex; gap: 8px; }
.landing .hero-block { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 24px; }
.landing .hero-block h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; max-width: 720px; line-height: 1.1; margin-bottom: 16px; }
.landing .hero-block p { color: var(--muted); font-size: 1.1rem; max-width: 560px; margin: 0 0 28px; }
.landing .cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.landing footer { text-align: center; padding: 24px; color: var(--faint); font-size: .8rem; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card .brand-mobile { display: block; }

  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .totp-setup { grid-template-columns: 1fr; }
  .stats-3 { grid-template-columns: repeat(2, 1fr); }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .panel-card { padding: 28px 22px; }
}
.landing .cta .btn { padding: 13px 22px; font-size: .95rem; }

/* ═══ Workflow module ═══════════════════════════════════════ */
.content { max-width: none; }
.view:not(.view-wide) { max-width: 1120px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: .82rem; }
.nav-label { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 14px 12px 4px; }
.who-foot { font-size: .75rem; color: var(--faint); padding: 0 12px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar h1 { flex: 1; }
#soundBtn[aria-pressed="true"] { color: var(--brand); background: var(--brand-soft); }

.live { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--faint); }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.live[data-state="on"] { color: var(--brand); }
.live[data-state="on"]::before { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.live[data-state="connecting"]::before { background: #f59e0b; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; margin-right: 6px; vertical-align: middle; }
.dot.on { background: #10b981; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field select, .field textarea, .toolbar select {
  width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit;
}
.toolbar select, .toolbar-select { width: auto; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font: inherit; color: var(--text); }
.field textarea { min-height: 90px; resize: vertical; }
.field select:focus, .field textarea:focus, .toolbar select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,101,75,.15); }
.modal-wide { max-width: 640px; }
.modal { max-height: calc(100vh - 32px); overflow-y: auto; }

/* Queue */
.queue-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font: 600 .85rem 'Inter', sans-serif; color: var(--muted); cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--text); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: .75rem; text-align: center; }
.chip.active .count { background: rgba(255,255,255,.22); color: #fff; }
.chip .count.zero { background: #f1f5f9; color: var(--faint); }
.chip.active .count.zero { background: rgba(255,255,255,.15); color: rgba(255,255,255,.8); }

.queue-table td, .queue-table th { padding: 10px 10px; }
.queue-table.size-sm { font-size: .8rem; }
.queue-table.size-lg { font-size: 1rem; }
.queue-table tr.row-done td { opacity: .72; }
.queue-table tr.row-noshow .vname { text-decoration: line-through; }
.queue-table tr.flash td { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: #fef9c3; } to { background: transparent; } }
.queue-table td.comments { white-space: normal; min-width: 180px; max-width: 360px; }
.queue-table .vname { font-weight: 600; text-transform: capitalize; }
.wait { font-variant-numeric: tabular-nums; font-weight: 600; }
.wait.warn { color: #b45309; }
.wait.late { color: var(--danger); }
.acts { display: flex; gap: 4px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.icon-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.icon-btn.primary:hover { background: var(--brand-ink); }
.icon-btn svg { width: 16px; height: 16px; }
.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.status-waiting { background: #fef3c7; color: #92400e; }
.status-processed { background: var(--brand-soft); color: var(--brand-ink); }
.status-no_show { background: var(--danger-soft); color: var(--danger); }
.status-transferred { background: #e0e7ff; color: #3730a3; }

.columns-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* Kiosks */
.kiosk-list { display: grid; gap: 10px; }
.kiosk-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); flex-wrap: wrap; }
.kiosk-row .grow { flex: 1; min-width: 180px; }
.kiosk-row .name { font-weight: 700; }
.kiosk-row .btn + .btn { margin-left: 0; }
.facility-block + .facility-block { margin-top: 22px; }
.facility-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.facility-title h3 { font-size: 1rem; font-weight: 800; flex: 1; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 20px; align-items: start; }
.editor-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.editor-head .title { flex: 1; min-width: 200px; }
.editor-head .title input { font: 800 1.25rem 'Manrope', sans-serif; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin-left: -8px; width: 100%; background: none; color: var(--text); }
.editor-head .title input:hover, .editor-head .title input:focus { border-color: var(--border); background: var(--surface); outline: none; }
.save-state { font-size: .8rem; color: var(--faint); white-space: nowrap; }
.save-state.saving { color: #b45309; }
.save-state.saved { color: var(--brand); }
.save-state.error { color: var(--danger); }
.tabs { display: flex; gap: 4px; background: #eef2f7; padding: 4px; border-radius: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px 10px; border-radius: 7px; font: 600 .8rem 'Inter', sans-serif; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.preview-col { position: sticky; top: 76px; }
.preview-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.preview-bar .tabs { margin: 0; flex: 1; }
.preview-frame { width: 100%; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; border: 8px solid #1f2937; background: #111; box-shadow: var(--shadow-lg); }
.preview-frame.portrait { aspect-ratio: 10 / 16; max-height: 78vh; width: auto; margin: 0 auto; }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 9px; padding: 8px 10px; }
.link-box code { flex: 1; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 44px; height: 42px; padding: 2px; border: 1px solid var(--border); border-radius: 9px; background: #fff; cursor: pointer; flex-shrink: 0; }
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch-row:last-child { border-bottom: 0; }
.switch-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
.switch-row strong { display: block; font-size: .9rem; }
.switch-row span { font-size: .82rem; color: var(--muted); }
.reason-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.reason-item .swatch { width: 14px; height: 32px; border-radius: 4px; background: var(--brand); flex-shrink: 0; }
.reason-item .grow { flex: 1; min-width: 0; }
.reason-item .label { font-weight: 600; }
.hours-grid { display: grid; grid-template-columns: 70px 70px 1fr 1fr; gap: 8px 10px; align-items: center; font-size: .88rem; }
.hours-grid input[type=time] { padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; font: inherit; width: 100%; }
.hours-grid input:disabled { opacity: .4; }

@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .preview-col { position: static; order: -1; }
}
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .columns-menu { grid-template-columns: 1fr; }
  .topbar-actions #soundBtn { display: none; }
}

/* Kiosk editor image fields */
.image-drop {
  position: relative; height: 128px; border: 2px dashed var(--border); border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 10px; text-align: center;
  background-color: #fff;
  background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%), linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #f1f5f9 75%), linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  transition: border-color .15s;
}
.image-drop:hover, .image-drop:focus, .image-drop.dragover { border-color: var(--brand); outline: none; }
.image-drop.dragover { background-color: var(--brand-soft); }
.image-drop.busy { opacity: .55; pointer-events: none; }
.image-drop img { max-width: 100%; max-height: 100%; object-fit: contain; }
[data-image="backgroundImage"] .image-drop { padding: 0; }
[data-image="backgroundImage"] .image-drop img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.image-actions { display: flex; gap: 8px; margin-top: 8px; }
.url-alt { margin-top: 8px; font-size: .82rem; color: var(--muted); }
.url-alt summary { cursor: pointer; }
.url-alt input { margin-top: 8px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; }

/* Checking in now (live kiosk activity) */
.activity-pill {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: #fef3c7; color: #92400e; font: 700 .78rem 'Inter', sans-serif; padding: 6px 12px; border-radius: 999px;
}
.activity-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,.6); } 100% { box-shadow: 0 0 0 8px rgba(245,158,11,0); } }
.activity { margin-bottom: 16px; }
.activity-head { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #92400e; margin-bottom: 8px; }
.activity-head .pulse { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; animation: pulse 1.4s ease-out infinite; }
.activity-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.activity-card { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 12px 14px; }
.activity-card.stage-done { background: var(--brand-soft); border-color: #b7ead6; }
.activity-card.stage-cancelled { opacity: .55; background: #f8fafc; border-color: var(--border); }
.activity-card.stage-help { background: var(--danger-soft); border-color: var(--danger-line); }
.activity-name { font-weight: 700; text-transform: capitalize; }
.activity-where { font-size: .8rem; color: var(--muted); }
.activity-stage { font-size: .85rem; font-weight: 600; margin-top: 6px; }
.activity-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.activity-foot .steps { display: flex; gap: 4px; }
.activity-foot .steps i { width: 22px; height: 4px; border-radius: 2px; background: #fde68a; }
.activity-foot .steps i.on { background: #f59e0b; }
.stage-done .steps i.on { background: var(--brand); }

/* Kiosk editor: readability + per-element style rows */
.section-title { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.range { width: 100%; accent-color: var(--brand); margin-top: 10px; }
.style-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.style-row:last-child { border-bottom: 0; }
.style-label strong { display: block; font-size: .9rem; }
.style-label span { font-size: .78rem; color: var(--faint); }
.style-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch-input { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 9px; background: #fff; padding: 3px 6px 3px 3px; gap: 4px; }
.swatch-input input[type=color] { width: 30px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; }
.swatch-input input:not([type=color]) { width: 74px; border: 0; font: .8rem ui-monospace, Menlo, monospace; outline: none; }
.size-input { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 9px; background: #fff; padding: 0 8px 0 4px; }
.size-input input { width: 52px; border: 0; padding: 8px 4px; font: inherit; outline: none; text-align: right; }
.size-input span { font-size: .78rem; color: var(--faint); }

.placeholder-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.placeholder-chips button { border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 3px 9px; font: .76rem ui-monospace, Menlo, monospace; color: var(--brand-ink); cursor: pointer; }
.placeholder-chips button:hover { border-color: var(--brand); }

.field label.check { display: flex; text-transform: none; letter-spacing: 0; font-size: .82rem; font-weight: 500; color: var(--muted); margin-top: 8px; }

.link-btn { border: 0; background: none; padding: 0 0 0 8px; font: 600 .72rem 'Inter', sans-serif; color: var(--brand); cursor: pointer; text-transform: none; letter-spacing: 0; }
.link-btn:hover { text-decoration: underline; }

.modal .kv { grid-template-columns: 150px 1fr; margin: 4px 0 20px; }

.status-called { background: #dbeafe; color: #1d4ed8; }
.call-preview { display: grid; gap: 4px; background: #0f172a; color: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 4px; }
.call-preview strong { font-size: 1.1rem; }
.call-preview span { color: #86efac; }
.call-preview .faint { color: #94a3b8; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }

.facility-sub { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.facility-sub-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.facility-sub-title .faint { flex: 1; }

.preview-frame.tv { aspect-ratio: 16 / 9; }

/* Set up a device (QR + pairing) */
.device-setup { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: start; }
.device-qr { text-align: center; }
.device-qr img { width: 180px; height: 180px; border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 6px; }
.device-steps ol { padding-left: 18px; color: var(--muted); font-size: .88rem; margin: 8px 0 14px; display: grid; gap: 6px; }
.pair-input { font: 700 1.3rem ui-monospace, Menlo, monospace !important; letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 860px) { .device-setup { grid-template-columns: 1fr; } }
.screen-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0 0 14px; font-size: .9rem; }
.screen-choice > span { font-weight: 600; }
.screen-choice label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* Admin: sign-in tracking & IP details */
.ip-link { border: 0; background: none; padding: 0; font: .82rem ui-monospace, Menlo, monospace; color: var(--brand-ink); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ip-link:hover { color: var(--brand); }
.ip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; font-size: .9rem; margin-bottom: 12px; }
.ip-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 2px; }
.ip-map-links { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0 4px; }
.ip-usage { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: .86rem; margin-top: 12px; }
.ip-usage ul { margin: 8px 0 0; padding-left: 18px; }
.mono { font-family: ui-monospace, Menlo, monospace; }

/* Admin users table: let row actions wrap instead of overflowing */
#usersBody td.actions { white-space: normal; min-width: 170px; }
#usersBody td.actions .btn { margin: 2px 0 2px 4px; }

/* ─── Payments ─────────────────────────────────────────────────────────── */
.price-note { background: var(--brand-soft); color: var(--brand-ink); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: .9rem; }
.pay-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; padding: 14px 16px; margin: 6px 0 10px; }
.pay-price { font-size: 1.35rem; font-weight: 800; }
.pay-price .faint { font-size: .9rem; font-weight: 500; }
.pay-element { min-height: 120px; margin: 12px 0 4px; }
.pay-secure { text-align: center; font-size: .8rem; margin: 10px 0 0; }
.billing-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.billing-price { border: 1px solid var(--border, #e2e8f0); border-radius: 12px; padding: 14px 16px; }
.billing-price .value { font-size: 1.4rem; font-weight: 800; margin-top: 4px; }
.promo-code { font: 600 .9rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; background: none; border: 0; border-bottom: 1px dashed currentColor; padding: 0; cursor: pointer; color: inherit; }
.promo-list { width: 100%; font-size: 1rem; letter-spacing: .05em; padding: 10px 12px; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; resize: vertical; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand, #00654b); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.promo-toggle { background: none; border: 0; padding: 0; color: var(--brand, #00654b); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; margin: 2px 0 10px; }
.card-head > .btn { flex-shrink: 0; white-space: nowrap; }
.label-link { float: right; font-size: .82rem; font-weight: 600; text-transform: none; letter-spacing: 0; }
.auth-legal { margin: 32px 0 0; text-align: center; color: var(--faint, #94a3b8); font-size: .78rem; letter-spacing: .02em; }
.reset-problems { margin: 0 0 8px; padding-left: 20px; color: var(--danger); }
.reset-problems li { margin-bottom: 4px; }
.lang-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; margin-bottom: 8px; }
.lang-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.tr-lang { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin: 12px 0; }
.tr-lang > summary { cursor: pointer; padding: 4px 0; }
.tr-lang[open] > summary { margin-bottom: 10px; }
.tr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.tr-actions .hint { margin: 0; }
.preview-lang { width: auto; padding: 4px 8px; font-size: .82rem; }
