* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #0d6efd; --primary-d: #0b5ed7;
  --bg: #f2f4f7; --card: #fff; --text: #1f2937; --muted: #6b7280;
  --ok: #16a34a; --warn: #f59e0b; --danger: #dc2626; --info: #0ea5e9;
}
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }

/* ---- Login ---- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0d6efd, #6610f2); padding: 20px;
}
.login-box { background: #fff; border-radius: 16px; padding: 28px 24px; width: 100%; max-width: 380px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.brand { font-size: 28px; font-weight: 800; text-align: center; color: var(--primary); }
.subtitle { text-align: center; color: var(--muted); margin: 4px 0 20px; }
.login-box label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.login-box input { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 16px; }
.login-box input:focus { outline: none; border-color: var(--primary); }
#login-btn { width: 100%; margin-top: 18px; padding: 13px; background: var(--primary); color: #fff; border: 0; border-radius: 10px; font-size: 16px; font-weight: 700; cursor: pointer; }
#login-btn:active { background: var(--primary-d); }
.error { color: var(--danger); font-size: 14px; margin-top: 10px; min-height: 18px; text-align: center; }
.demo-hint { margin-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.demo-hint code { background: #eef; padding: 1px 6px; border-radius: 5px; }
.chip { display: inline-block; background: #eef2ff; color: var(--primary); padding: 3px 8px; border-radius: 20px; margin: 2px; cursor: pointer; font-size: 11px; }

/* ---- App shell ---- */
.app-screen { min-height: 100vh; padding-bottom: 70px; }
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-sub { font-size: 12px; opacity: .85; margin-top: 2px; }
.logout { background: rgba(255,255,255,.2); border: 0; color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.content { padding: 16px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---- Cards / stats ---- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--card); border-radius: 14px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.stat .num { font-size: 30px; font-weight: 800; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stat.ok .num { color: var(--ok); } .stat.warn .num { color: var(--warn); }
.stat.info .num { color: var(--info); } .stat.danger .num { color: var(--danger); }
.section-title { font-weight: 700; margin: 18px 0 10px; font-size: 15px; }

.card { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.card .row { display: flex; justify-content: space-between; align-items: center; }
.card .room { font-weight: 700; font-size: 16px; }
.card .meta { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.6; }
.badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; color: #fff; white-space: nowrap; }
.b-checkin { background: var(--ok); } .b-checkout { background: var(--warn); }
.b-staying { background: var(--info); } .b-upcoming { background: #8b5cf6; } .b-past { background: #9ca3af; }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.empty .ic { font-size: 40px; }

/* ---- Bottom nav ---- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fff; display: flex;
  border-top: 1px solid #e5e7eb; box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.bottom-nav button {
  flex: 1; background: none; border: 0; padding: 8px 0 10px; color: var(--muted);
  font-size: 11px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.bottom-nav button .ic { font-size: 20px; }
.bottom-nav button.active { color: var(--primary); font-weight: 700; }
.banner-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
