/* Staff app (hotel TV): a phone in one hand, large touch targets, readable outdoors and at night, right to left in Arabic. */
:root { --bg: #10202c; --panel: #182f40; --panel2: #213c50; --text: #fff; --muted: rgba(255, 255, 255, .72); --accent: #c8a45d; --ok: #2f9e6b; --warn: #d97706; --danger: #dc2626; --line: rgba(255, 255, 255, .16); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Arabic', Tahoma, sans-serif; font-size: 16px; }
body { min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); position: sticky; top: 0; background: var(--bg); z-index: 3; border-bottom: 1px solid var(--line); }
.top-r { display: flex; align-items: center; gap: 8px; }
.who b { font-size: 17px; }
.small { font-size: 13px; color: var(--muted); }
.net { font-size: 12px; background: var(--warn); color: #111; border-radius: 10px; padding: 3px 8px; font-weight: 700; }
select, input { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input { width: 100%; }
main { padding: 8px 16px 16px; }
h2 { font-size: 20px; margin: 14px 0 10px; }
label.f { display: block; margin: 12px 0; }
label.f span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--panel2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #111; }
.btn.ok { background: var(--ok); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.wide { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.row .btn { flex: 1 1 auto; }
.seg { display: flex; background: var(--panel); border-radius: 12px; padding: 4px; gap: 4px; margin: 8px 0 12px; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; }
.seg button[aria-pressed='true'] { background: var(--panel2); color: var(--text); }
.list { display: grid; gap: 10px; }
.card { background: var(--panel); border-radius: 14px; padding: 12px 14px; border-inline-start: 6px solid transparent; }
.card.new { border-inline-start-color: var(--accent); }
.card.ringing { border-inline-start-color: var(--danger); box-shadow: 0 0 0 2px var(--danger) inset; }
.card.sos { background: #7f1d1d; border-inline-start-color: #fff; }
.card .h { display: flex; align-items: baseline; gap: 10px; }
.card .room { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.card .t { font-weight: 700; font-size: 17px; flex: 1; }
.card .d { color: var(--muted); font-size: 14px; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; background: var(--panel2); color: var(--text); }
.chip.warn { background: var(--warn); color: #111; }
.chip.danger { background: var(--danger); }
.chip.ok { background: var(--ok); }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #0b1822; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); z-index: 3; }
.tabs button { flex: 1; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; padding: 8px 2px; min-height: 60px; position: relative; }
.tabs button b { display: block; font-size: 20px; line-height: 1.2; }
.tabs button[aria-current='page'] { color: var(--accent); font-weight: 700; }
.tabs .count { position: absolute; top: 4px; inset-inline-end: 22%; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; padding: 1px 5px; font-weight: 700; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); background: #000; padding: 12px 14px; border-radius: 12px; text-align: center; z-index: 6; }
.banner { margin: 8px 16px 0; padding: 10px 12px; border-radius: 12px; background: var(--warn); color: #111; font-weight: 600; font-size: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.banner .btn { min-height: 36px; background: #111; color: #fff; }
.credit { padding: 8px 16px 12px; font-size: 11px; color: var(--muted); text-align: center; }
.credit a { color: inherit; }

/* The ringing screen: full screen until Acknowledge. */
.ring { position: fixed; inset: 0; z-index: 10; background: #b45309; display: flex; flex-direction: column; justify-content: center; align-items: stretch; padding: 24px; padding-top: calc(24px + env(safe-area-inset-top)); text-align: center; animation: ring-pulse 1.1s infinite; }
.ring.sos { background: #b91c1c; }
@keyframes ring-pulse { 50% { filter: brightness(.8); } }
.ring .bell { font-size: 54px; line-height: 1; }
.ring .what { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-top: 12px; }
.ring .lbl { font-size: 20px; font-weight: 600; margin-top: 14px; opacity: .9; }
.ring .room { font-size: 76px; line-height: 1.05; font-weight: 800; margin: 0; font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.ring .t { font-size: 24px; font-weight: 700; margin: 6px 0 4px; }
.ring .d { font-size: 15px; opacity: .9; }
.ring .more { font-size: 14px; margin-top: 10px; opacity: .9; }
.ring .btn { margin-top: 26px; min-height: 72px; font-size: 22px; background: #fff; color: #111; }

/* Rooms: a grid of room tiles to tick. */
.codes { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.codes button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); color: var(--text); font: inherit; padding: 0 12px; }
.codes button[aria-pressed='true'] { border-color: var(--accent); background: var(--panel2); font-weight: 700; }
.codes button b { font-variant-numeric: tabular-nums; color: var(--accent); unicode-bidi: isolate; }
.codes button span { unicode-bidi: isolate; }
.floors { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; }
.floors button { flex: 0 0 auto; min-height: 36px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 0 12px; }
.floors button[aria-pressed='true'] { background: var(--panel2); border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.rt { position: relative; min-height: 72px; border-radius: 12px; border: 2px solid transparent; background: var(--panel); color: var(--text); font: inherit; padding: 8px 6px; text-align: center; }
.rt b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.rt small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.rt[aria-pressed='true'] { border-color: var(--accent); background: var(--panel2); }
.rt[aria-pressed='true']::after { content: '✓'; position: absolute; top: 4px; inset-inline-end: 6px; color: var(--accent); font-weight: 800; }
.rt .dnd { position: absolute; top: 4px; inset-inline-start: 6px; font-size: 11px; font-weight: 800; color: #fca5a5; }
.sendbar { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); margin-top: 14px; background: var(--bg); padding: 8px 0; }

/* To enter by hand. */
.entry .ref { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.entry .ref input { flex: 1 1 100%; }
.entry .ref .btn { flex: 1 1 100%; }
.entry.done { opacity: .6; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
