:root {
  --rdl-blue: #133c8b;
  --rdl-blue-dark: #0d2b68;
  --rdl-green: #6cc43f;
  --ink: #172033;
  --muted: #60708a;
  --surface: rgba(255,255,255,.94);
  --danger: #b42318;
  --success: #207a3c;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #eaf6fc; color: var(--ink); }
body { min-height: 100svh; overflow-x: hidden; }
button, input, textarea { font: inherit; }
button { touch-action: manipulation; }

.shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 15% 15%, rgba(108,196,63,.12), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(19,60,139,.16), transparent 32%),
    linear-gradient(150deg, #f8fcff, #e7f3fb);
}
.card {
  width: min(760px, 100%);
  background: var(--surface);
  border: 1px solid rgba(19,60,139,.12);
  border-radius: 28px;
  box-shadow: 0 22px 60px rgba(14,49,100,.16);
  padding: clamp(28px, 5vw, 56px);
  backdrop-filter: blur(16px);
}
.logo-text { color: var(--rdl-blue); font-weight: 800; letter-spacing: .04em; font-size: 1rem; }
h1 { margin: 12px 0 10px; font-size: clamp(2.1rem, 5vw, 3.7rem); line-height: 1.05; }
p { color: var(--muted); font-size: clamp(1rem, 2.3vw, 1.25rem); line-height: 1.55; }
.actions { display: grid; gap: 18px; margin-top: 34px; }
.btn {
  border: 0; border-radius: 18px; min-height: 72px; padding: 18px 28px;
  font-weight: 800; font-size: clamp(1.15rem, 3vw, 1.55rem); cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.985); }
.btn-primary { color: white; background: linear-gradient(135deg, var(--rdl-blue), #225bb5); box-shadow: 0 12px 26px rgba(19,60,139,.25); }
.btn-secondary { color: var(--rdl-blue); background: #edf3ff; border: 2px solid rgba(19,60,139,.18); }
.btn-danger { color: white; background: var(--danger); }
.btn-small { min-height: 44px; padding: 10px 16px; font-size: .95rem; border-radius: 12px; }
.back { margin-bottom: 22px; color: var(--rdl-blue); background: transparent; border: 0; font-weight: 750; font-size: 1.05rem; cursor: pointer; padding: 8px 0; }
.field { margin-top: 24px; }
label { display: block; font-size: 1.08rem; font-weight: 750; margin-bottom: 10px; }
input, textarea {
  width: 100%; border: 2px solid #d5dfef; background: white; border-radius: 16px;
  padding: 18px 18px; font-size: 1.2rem; color: var(--ink); outline: none;
}
input:focus, textarea:focus { border-color: var(--rdl-blue); box-shadow: 0 0 0 4px rgba(19,60,139,.1); }
textarea { min-height: 150px; resize: vertical; }
.help { margin-top: 8px; font-size: .94rem; }
.error { color: var(--danger); font-weight: 700; margin-top: 14px; }
.success-mark { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: #e5f7ea; color: var(--success); font-size: 3rem; font-weight: 900; margin-bottom: 22px; }

.home {
  min-height: 100svh; position: relative; display: grid; place-items: center; overflow: hidden;
  background: #eef9ff;
}
.home-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.home-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 68%, rgba(6,25,60,.2)); pointer-events: none; }
.tap-button {
  position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); bottom: max(5.5vh, calc(env(safe-area-inset-bottom) + 28px));
  width: min(440px, 72vw); min-height: 82px; border: 4px solid rgba(255,255,255,.95); border-radius: 999px;
  background: var(--rdl-blue); color: white; font-weight: 900; font-size: clamp(1.3rem, 3.4vw, 2rem); letter-spacing: .08em;
  box-shadow: 0 16px 38px rgba(10,37,84,.38); cursor: pointer;
}
.tap-button:active { transform: translateX(-50%) scale(.98); }

.guest-list { display: grid; gap: 12px; margin-top: 26px; max-height: 46svh; overflow: auto; padding-right: 4px; }
.guest-row { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: white; border: 2px solid #dce6f4; border-radius: 16px; padding: 18px; cursor: pointer; }
.guest-row strong { font-size: 1.2rem; }
.guest-row span { color: var(--muted); }
.empty { padding: 24px; background: #f4f7fb; border-radius: 16px; text-align: center; }

.admin-shell { min-height: 100svh; background: #f2f6fb; padding: 24px; }
.admin-wrap { width: min(1200px, 100%); margin: 0 auto; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.admin-head h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.table-wrap { overflow: auto; background: white; border-radius: 18px; box-shadow: 0 10px 32px rgba(17,48,92,.1); }
table { width: 100%; border-collapse: collapse; min-width: 950px; }
th, td { padding: 15px 16px; border-bottom: 1px solid #e4eaf3; text-align: left; vertical-align: top; }
th { background: var(--rdl-blue); color: white; position: sticky; top: 0; }
.status-in { color: #9a3412; font-weight: 800; }
.status-out { color: var(--success); font-weight: 800; }
.toolbar { display: flex; gap: 12px; align-items: center; margin: 0 0 18px; flex-wrap: wrap; }
.toolbar input { max-width: 380px; padding: 12px 14px; font-size: 1rem; }

@media (orientation: landscape) and (max-height: 900px) {
  .home-bg { object-fit: contain; background: #edf9ff; }
  .tap-button { bottom: 24px; min-height: 64px; }
  .card { padding: 30px 42px; }
}
@media (max-width: 600px) {
  .shell { padding: 16px; }
  .card { border-radius: 22px; padding: 26px 22px; }
  .btn { min-height: 64px; }
  .admin-shell { padding: 12px; }
  .admin-head { align-items: flex-start; flex-direction: column; }
}


/* Admin date filters and CSV export */
.date-control { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .9rem; color: var(--muted); font-weight: 750; }
.date-control input { width: 160px; padding: 10px 12px; font-size: .95rem; border-radius: 12px; }
.filter-summary { color: var(--muted); font-size: .92rem; margin: -6px 0 12px; }
@media (max-width: 900px) {
  .toolbar { align-items: stretch; }
  .toolbar > input[type="search"] { max-width: none; flex: 1 1 100%; }
  .date-control { flex: 1 1 220px; }
  .date-control input { flex: 1; width: auto; }
}
