/* Staff PWA. Look follows Guestify's web app (D:\guestify\website): white surfaces, coral accent,
   soft borders, a fixed bottom tab bar. Mobile first; on a wide screen the app stays phone-width. */
:root {
	--coral: #FF5A5F;
	--coral-dark: #E04E53;
	--coral-light: #FFF0F0;
	--text: #222222;
	--text-2: #717171;
	--border: #EBEBEB;
	--smoke: #F7F7F7;
	--ok: #2E7D32;
	--err: #DC3545;
	--warn: #B45309;
	--radius: 14px;
	--tabs-h: 64px;
	--safe-b: env(safe-area-inset-bottom, 0px);
	--safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #fff; color: var(--text); }
body {
	font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Cairo', 'Noto Sans Arabic', Tahoma, sans-serif;
	font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[dir="rtl"] svg.flip { transform: scaleX(-1); }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-top: var(--safe-t); }
#app.has-tabs { padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 8px); }
.splash { display: flex; align-items: center; justify-content: center; height: 100vh; height: 100dvh; }
.spin { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--coral); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- page chrome ---- */
.page { padding: 20px 20px 28px; }
.h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 4px; }
.sub { color: var(--text-2); margin: 0 0 20px; }
.bar { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); min-height: 56px; }
.bar .ttl { font-weight: 600; font-size: 17px; flex: 1; text-align: center; margin-inline-end: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:active { background: var(--smoke); }
.sec { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 24px 0 10px; }
[dir="rtl"] .sec { letter-spacing: 0; }

/* ---- bottom tab bar (Guestify MobileNav) ---- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--border); padding-bottom: var(--safe-b); display: flex; justify-content: center; }
#tabs[hidden], #toast[hidden] { display: none; }
#tabs > div { display: flex; width: 100%; max-width: 560px; }
#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; color: var(--text-2); text-decoration: none; font-size: 11.5px; font-weight: 500; }
#tabs a svg.i { width: 24px; height: 24px; }
#tabs a.on { color: var(--coral); }

/* ---- cards, tiles, lists ---- */
.card { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 16px 14px; text-align: start; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-height: 132px; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: transform .08s; }
.tile:active { transform: scale(.98); background: var(--smoke); }
.tile .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--coral-light); color: var(--coral); display: flex; align-items: center; justify-content: center; }
.tile .nm { font-weight: 600; font-size: 15.5px; }
.tile .ds { color: var(--text-2); font-size: 13px; line-height: 1.35; }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; cursor: pointer; text-align: start; margin-bottom: 12px; }
.choice:active { background: var(--smoke); }
.choice .ic { width: 48px; height: 48px; border-radius: 12px; background: var(--coral-light); color: var(--coral); display: flex; align-items: center; justify-content: center; }
.choice .tx { flex: 1; }
.choice .nm { font-weight: 600; }
.choice .ds { color: var(--text-2); font-size: 13.5px; }
.list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 16px; border: 0; border-bottom: 1px solid var(--border); background: #fff; text-align: start; cursor: pointer; text-decoration: none; color: inherit; }
.row:last-child { border-bottom: 0; }
.row:active { background: var(--smoke); }
.row .tx { flex: 1; }
.row .vl { color: var(--text-2); font-size: 14px; }
.row.danger { color: var(--err); }
.profile { display: flex; align-items: center; gap: 14px; padding: 18px 16px; margin-bottom: 8px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--text); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 20px; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--smoke); color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.empty { text-align: center; color: var(--text-2); padding: 40px 16px; }
.empty svg.i { width: 40px; height: 40px; color: #c4c4c4; margin-bottom: 8px; }

/* ---- forms ---- */
.fld { margin-bottom: 14px; }
.fld label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--text); }
.fld label .opt { font-weight: 400; color: var(--text-2); }
.in { width: 100%; height: 50px; padding: 0 14px; border: 1px solid #B0B0B0; border-radius: 10px; background: #fff; outline: none; font-size: 16px; }
.in:focus { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.in.read { background: var(--coral-light); border-color: #f3c4c6; }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #717171 50%), linear-gradient(135deg, #717171 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 15px) 22px; background-size: 5px 5px; background-repeat: no-repeat; }
[dir="rtl"] select.in { background-position: 20px 22px, 15px 22px; }
.pw { position: relative; }
.pw .icon-btn { position: absolute; inset-inline-end: 3px; top: 3px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; border: 0; border-radius: 10px; background: var(--coral); color: #fff; font-weight: 600; font-size: 16px; cursor: pointer; }
.btn:active { background: var(--coral-dark); }
.btn[disabled] { background: #DDDDDD; color: #fff; cursor: default; }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--text); }
.btn.ghost:active { background: var(--smoke); }
.btn + .btn { margin-top: 10px; }
.btn .spin { width: 20px; height: 20px; border-width: 2.5px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }
.msg { border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.msg svg.i { width: 18px; height: 18px; margin-top: 1px; }
.msg.err { background: #FDECEE; color: #A3262F; }
.msg.warn { background: #FFF7E6; color: #8A4A07; }
.msg.info { background: var(--smoke); color: var(--text-2); }
.msg.ok { background: #EAF5EB; color: #1E5E22; }

/* ---- sign in ---- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px 24px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand img { width: 52px; height: 52px; border-radius: 14px; }
.brand .bn { font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.brand .co { color: var(--text-2); font-size: 14px; }

/* ---- scan ---- */
.shot { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--smoke); margin-bottom: 16px; }
.shot img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.shot .ovl { position: absolute; inset: 0; background: rgba(255,255,255,.75); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-weight: 600; }
.frame { border: 2px dashed #D0D0D0; border-radius: var(--radius); aspect-ratio: 1.586; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); margin-bottom: 18px; text-align: center; padding: 16px; }
.frame svg.i { width: 44px; height: 44px; color: var(--coral); }
.frame.pass { aspect-ratio: 1.42; }
.done { text-align: center; padding: 28px 8px 8px; }
.done .ok { width: 72px; height: 72px; border-radius: 50%; background: #EAF5EB; color: var(--ok); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.done .ok svg.i { width: 36px; height: 36px; stroke-width: 2.4; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text-2); }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + var(--safe-b) + 16px); z-index: 50; background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
@media (min-width: 600px) { #app { border-inline: 1px solid var(--border); } }
