/* SwiftIn design system — warm, colorful, monday.com-inspired.
   One stylesheet shared by every page (host dashboard + guest check-in). */

:root {
  /* Canvas & surfaces — soft off-white, cards pop clean white */
  --bg: #f5f5f3;
  --bg-tint: #eeeeea;
  --card: #ffffff;
  --panel: #f7f7f4;

  /* Ink */
  --text: #1e2334;
  --muted: #6b7488;
  --border: #e9e3d6;
  --border-strong: #ddd5c4;

  /* Brand — vivid monday blue, with a purple friend */
  --primary: #0073ea;
  --primary-600: #0060c4;
  --primary-050: #e7f1fd;
  --primary-text: #ffffff;
  --iris: #6c6cff;

  /* Status palette (monday-ish) */
  --green: #00c875;  --green-bg: #e2f8ef;  --green-ink: #067a4c;
  --amber: #fdab3d;  --amber-bg: #fff2df;  --amber-ink: #9a6400;
  --red: #e44258;    --red-bg: #fde8ec;    --red-ink: #b02338;
  --purple: #a25ddc; --purple-bg: #f3e9fb; --purple-ink: #7a3fb0;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24, 24, 48, .05), 0 6px 20px rgba(24, 24, 48, .06);
  --shadow-sm: 0 1px 2px rgba(24, 24, 48, .06);
  --shadow-pop: 0 10px 28px rgba(0, 115, 234, .22);

  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  letter-spacing: .1px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.4px; margin: 0 0 .3rem; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.2px; margin: 1.75rem 0 .6rem; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .25rem; }
p.lead { color: var(--muted); margin-top: 0; font-size: 1.02rem; }

/* ---------- Top bar (host pages) ---------- */
header.topbar {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  padding: .8rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
header.topbar .brand {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.3px;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
header.topbar .brand a { color: var(--text); text-decoration: none; }
header.topbar .brand::before {
  content: "";
  width: 14px; height: 14px; border-radius: 5px;
  background: linear-gradient(135deg, var(--iris), var(--primary));
  box-shadow: 0 2px 8px rgba(0, 115, 234, .35);
}
header.topbar a { color: var(--muted); font-weight: 600; }
header.topbar a:hover { color: var(--text); text-decoration: none; }

main.page { max-width: 62rem; margin: 2rem auto; padding: 0 1.25rem; }

/* ---------- Centered card (auth + guest pages) ---------- */
main.card {
  width: 92%;
  max-width: 30rem;
  margin: 3.5rem auto;
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 1.08rem; }
.card .meta, .meta { color: var(--muted); font-size: .88rem; }

.row { display: flex; align-items: center; justify-content: space-between; gap: .85rem; flex-wrap: wrap; }
.actions { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }

/* ---------- Buttons ---------- */
a.button, button {
  font: inherit;
  font-weight: 700;
  color: var(--primary-text);
  background: linear-gradient(180deg, #1a83f0, var(--primary));
  border: none;
  border-radius: var(--radius-sm);
  padding: .62rem .95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 1px 2px rgba(0, 115, 234, .25);
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
a.button:hover, button:hover { box-shadow: var(--shadow-pop); text-decoration: none; }
a.button:active, button:active { transform: translateY(1px); }

button.secondary, a.button.secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
button.secondary:hover, a.button.secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

a.button.danger, button.danger {
  background: linear-gradient(180deg, #ec5468, var(--red));
  color: #fff;
  box-shadow: 0 1px 2px rgba(228, 66, 88, .3);
}
a.button.danger:hover, button.danger:hover { box-shadow: 0 10px 24px rgba(228, 66, 88, .28); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; margin: 1.1rem 0 .4rem; font-size: .95rem; }
input, select, textarea {
  width: 100%;
  padding: .72rem .8rem;
  font: inherit;
  font-size: 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-050);
}
textarea { resize: vertical; }
.field-error { color: var(--red-ink); font-size: .85rem; margin: .35rem 0 0; font-weight: 600; }
.hint, .muted-note { color: var(--muted); font-size: .82rem; margin: .35rem 0 0; }
.form-errors {
  background: var(--red-bg);
  color: var(--red-ink);
  border: 1px solid #f6cdd4;
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .92rem;
  font-weight: 600;
}
.notice {
  background: var(--amber-bg);
  color: var(--amber-ink);
  border: 1px solid #f7ddb0;
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  margin-bottom: 1.1rem;
  font-size: .92rem;
  font-weight: 600;
}
.notice a { color: var(--amber-ink); text-decoration: underline; }
.alt { color: var(--muted); font-size: .95rem; margin-top: 1.4rem; text-align: center; }
.empty { color: var(--muted); }

/* Auth / guest pages give the main button full width */
main.card button[type="submit"], main.card > .card button[type="submit"] {
  width: 100%; margin-top: 1.5rem; padding: .85rem;
}

/* ---------- Status badges (the monday-style pills) ---------- */
.badge {
  display: inline-block;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .2px;
  padding: .28rem .66rem;
  border-radius: 999px;
  line-height: 1.3;
}
.badge.confirmed, .badge.active { background: var(--green-bg); color: var(--green-ink); }
.badge.pending_registration, .badge.awaiting, .badge.paused { background: var(--amber-bg); color: var(--amber-ink); }
.badge.failed { background: var(--red-bg); color: var(--red-ink); }

/* ---------- Check-in counter ---------- */
.counter {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--iris), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Shared check-in link box ---------- */
.link-box { display: flex; gap: .5rem; margin-top: .7rem; }
.link-box input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  background: var(--panel);
}
.confirmation {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  color: var(--muted);
  margin: .25rem 0 0;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -.25rem; padding: 0 .25rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
thead th { color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--panel); }
td.stay, th.stay { white-space: nowrap; font-weight: 600; }
td .price-form { display: flex; gap: .3rem; align-items: center; }
td .price-form input { padding: .45rem .5rem; font-size: .9rem; }
td .price-form input[name="amount"] { width: 5.2rem; }
td .price-form input[name="currency"] { width: 3rem; text-transform: uppercase; }
td .price-form button { padding: .45rem .65rem; font-size: .85rem; white-space: nowrap; }

/* ---------- Filter tabs ---------- */
.tabs { display: flex; gap: .45rem; flex-wrap: wrap; margin: .9rem 0; }
.tabs a {
  font-size: .86rem; font-weight: 700; text-decoration: none;
  padding: .4rem .85rem; border-radius: 999px;
  border: 1.5px solid var(--border-strong); color: var(--muted); background: var(--card);
  transition: all .12s ease;
}
.tabs a:hover { color: var(--text); border-color: var(--primary); text-decoration: none; }
.tabs a.active {
  background: linear-gradient(180deg, #1a83f0, var(--primary));
  color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(0, 115, 234, .3);
}

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; font-size: .9rem; }
.pagination a, .pagination span.disabled {
  padding: .45rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  text-decoration: none; color: var(--text); background: var(--card);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination span.disabled { color: var(--muted); opacity: .5; }

/* ---------- Danger zone ---------- */
.card.danger { border-color: #f0cdd3; background: linear-gradient(180deg, #fffafb, #fff); }
.card.danger h3 { color: var(--red-ink); }

/* ---------- Admin analytics ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 1rem; margin-top: .4rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow-sm); }
.stat .n { font-size: 2rem; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.stat .l { color: var(--muted); font-size: .88rem; margin-top: .4rem; }
.stat.accent .n {
  background: linear-gradient(135deg, var(--iris), var(--primary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.funnel-row { display: flex; align-items: center; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.funnel-row:last-child { border-bottom: none; }
.funnel-row .fl { width: 11rem; font-weight: 700; flex-shrink: 0; }
.funnel-row .bar { flex: 1; height: 12px; background: var(--panel); border-radius: 999px; overflow: hidden; min-width: 60px; }
.funnel-row .bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--iris), var(--primary)); }
.funnel-row .fn { width: 6rem; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Guest check-in specifics ---------- */
.reservation {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  margin: 1.1rem 0 1.5rem;
}
.reservation dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.reservation dd { margin: 0 0 .6rem; font-weight: 700; }
.reservation dd:last-child { margin-bottom: 0; }
.status-icon { font-size: 2.6rem; }
.ok { color: var(--green-ink); }
.privacy-note { color: var(--muted); font-size: .82rem; margin-top: 1.5rem; }
