/* YPF Events – one stylesheet for every page.
   Colours come from the YPF logo: white and green. Mobile first, widens on laptops. */
:root {
  --green: #3f9a2b;          /* main brand green (buttons, highlights) */
  --green-dark: #2f7a1f;
  --green-deep: #0f2a1b;     /* side menu */
  --green-deep-2: #173a26;
  --lime: #9bd53a;           /* bright accent from the logo */
  --tint: #eef6ea;           /* soft green backgrounds */
  --tint-2: #f6faf4;
  --bg: #f5f7f4;
  --card: #ffffff;
  --line: #e3e9e0;
  --text: #15241b;
  --muted: #6b7b70;
  --red: #c4362b;
  --red-tint: #fdeeec;
  --amber: #a86b00;
  --amber-tint: #fff5e1;
  --blue: #2f6db5;
  --blue-tint: #eaf2fb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 40, 24, .04), 0 4px 16px rgba(16, 40, 24, .04);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* keep hidden elements hidden even when a class sets display */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font: 15px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text); background: var(--bg);
}
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--green-dark); }
b, strong { font-weight: 700; }
small { display: block; color: var(--muted); font-size: .82rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }

/* Icons: thin rounded line icons from /icons.svg */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
        stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* ---------- App layout: side menu + top bar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 30;
  display: flex; flex-direction: column; gap: 8px; padding: 22px 14px;
  background: linear-gradient(180deg, var(--green-deep) 0%, #0b2216 100%); color: #dce8df;
  transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto;
}
.brand { display: block; padding: 4px 10px 18px; }
.brand img { width: 100%; max-width: 200px; display: block; }
.nav-label { margin: 14px 12px 6px; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7f9a88; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0;
  border-radius: 10px; color: #dce8df; text-decoration: none; font-weight: 500;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.on { background: linear-gradient(90deg, rgba(155, 213, 58, .22), rgba(155, 213, 58, .08)); color: #fff; box-shadow: inset 3px 0 0 var(--lime); }
.nav-link.on .icon { color: var(--lime); }
.sidebar-card {
  margin-top: auto; display: flex; gap: 12px; align-items: center; padding: 14px;
  border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-card img { width: 40px; height: 40px; }
.sidebar-card p { margin: 0; font-size: .82rem; color: #a9bdb0; }
.sidebar-card b { color: #fff; }
.scrim { display: none; }
body.nav-open .sidebar { transform: none; }
body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(10, 25, 15, .45); }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.page-head { flex: 1; min-width: 0; }
.page-head h1 { font-size: 1.2rem; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-right form { margin: 0; }
.date-pill { display: none; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .85rem; font-weight: 500; }
.date-pill .icon { width: 17px; height: 17px; color: var(--green); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-text { display: none; line-height: 1.2; }
.user-text b { font-size: .88rem; }
.avatar {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 700; font-size: .85rem;
}
.avatar.soft { background: var(--tint); color: var(--green-dark); width: 36px; height: 36px; }
.avatar.lg { width: 46px; height: 46px; font-size: 1.05rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--tint-2); color: var(--green-dark); }
.content { padding: 18px 16px 40px; width: 100%; max-width: 1280px; }

@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .shell { margin-left: 264px; }
  .menu-btn { display: none; }
  .topbar { padding: 14px 28px; }
  .content { padding: 24px 28px 48px; }
  body.nav-open .scrim { display: none; }
}
@media (min-width: 720px) {
  .date-pill { display: inline-flex; }
  .user-text { display: block; }
}

/* ---------- Plain layout: guest pages and login ---------- */
.plain {
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(155, 213, 58, .22), transparent 60%),
    linear-gradient(180deg, #f3f8f0 0%, var(--bg) 100%);
}
.plain-main { max-width: 520px; margin: 0 auto; padding: 28px 16px 40px; }
.plain-logo { display: block; width: 210px; max-width: 70%; margin: 4px auto 24px; }
.plain-foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 24px; }
.form-card { padding: 28px 24px; }
.form-card h1 { margin-bottom: 6px; }
.eyebrow { margin: 0 0 6px; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green); }
.event-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0 20px; color: var(--muted); font-size: .9rem; }
.event-meta span { display: inline-flex; align-items: center; gap: 6px; }
.event-meta .icon { width: 17px; height: 17px; color: var(--green); }
.card-icon {
  display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px;
  border-radius: 12px; background: var(--tint); color: var(--green);
}
.card-icon .icon { width: 24px; height: 24px; }

/* ---------- Cards and grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.link-more { font-size: .85rem; font-weight: 600; text-decoration: none; }
.link-more:hover { text-decoration: underline; }
.narrow-card { max-width: 640px; }
.grid-2 { display: grid; gap: 18px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .grid-2, .grid-2 + .card, .stats + .grid-2 { margin-top: 18px; }
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2.wide-left { grid-template-columns: 1.5fr 1fr; align-items: start; }
}
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state h2 { margin-bottom: 6px; }

/* Stat tiles */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 18px; }
.stats-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 360px)); }
.stat { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat-icon { display: inline-grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; background: var(--tint); color: var(--green); }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-label { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 500; }
.stat-value { margin: 2px 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.stat-sub { margin: 0; color: var(--muted); font-size: .8rem; }
.stat-sub b { color: var(--green); }

/* Progress ring (dashboard) */
.ring-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; justify-content: center; }
.ring {
  --a: 0%; --b: 0%;
  width: 190px; height: 190px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--green-deep) 0 var(--a), var(--green) var(--a) var(--b), #dfe7dc var(--b) 100%);
}
.ring-center { width: 136px; height: 136px; border-radius: 50%; background: #fff; display: grid; place-content: center; text-align: center; }
.ring-center b { font-size: 2rem; font-weight: 800; line-height: 1; }
.ring-center span { color: var(--muted); font-size: .85rem; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 220px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.legend b { margin-left: auto; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-1 { background: var(--green-deep); }
.dot-2 { background: var(--green); }
.dot-3 { background: #dfe7dc; }

/* Quick access list */
.quick { display: grid; gap: 8px; }
.quick a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600;
}
.quick a .icon { color: var(--green); }
.quick a span { flex: 1; }
.quick a .chev { color: var(--muted); width: 18px; height: 18px; }
.quick a:hover { border-color: #c9dcc1; background: var(--tint-2); }

/* Rows inside cards */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row form { margin: 0; }
.soft-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--tint); color: var(--green); }
.soft-icon.warn { background: var(--amber-tint); color: var(--amber); }
.soft-icon .icon { width: 18px; height: 18px; }
.count-badge { min-width: 30px; height: 30px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 99px; background: var(--tint); color: var(--green-dark); font-weight: 700; font-size: .85rem; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: #eef1ee; color: var(--muted); }
.pill-link_sent { background: var(--amber-tint); color: var(--amber); }
.pill-registered { background: var(--blue-tint); color: var(--blue); }
.pill-checked_in { background: var(--tint); color: var(--green-dark); }
.pill-error { background: var(--red-tint); color: var(--red); }
.pill-test { background: var(--amber-tint); color: var(--amber); }
.pill-admin { background: var(--green-deep); color: #fff; }
.pill-staff { background: var(--tint); color: var(--green-dark); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
input:not([type=checkbox]):not([type=file]), select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  font: inherit; font-weight: 500; color: var(--text); background: #fff;
  border: 1px solid #d5ddd2; border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(63, 154, 43, .15); }
input:disabled { background: var(--tint-2); color: var(--muted); }
input[type=checkbox] { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--green); }
label.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--tint-2); }
.hint { font-size: .82rem; color: var(--muted); margin: -8px 0 14px; }
.field-error { color: var(--red); margin: -8px 0 14px; font-weight: 600; font-size: .88rem; }
.form-row { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.input-sm { width: 90px !important; margin: 0 !important; padding: 8px 10px !important; }
.input-sm.wide { width: 170px !important; }
.locked-input { position: relative; display: block; }
.locked-input .icon { position: absolute; right: 14px; top: 50%; transform: translateY(-30%); width: 17px; height: 17px; color: var(--muted); }

.search-field { position: relative; display: block; margin: 0 0 12px; }
.search-field .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-field input { margin: 0 !important; padding-left: 44px !important; }
.search-xl input { padding: 18px 18px 18px 52px !important; font-size: 1.25rem; border-radius: 14px; }
.search-xl .icon { left: 18px; width: 24px; height: 24px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 28px 16px; margin-bottom: 14px; border: 2px dashed #cddbc6; border-radius: 14px; background: var(--tint-2); cursor: pointer;
}
.dropzone > .icon { width: 30px; height: 30px; color: var(--green); }
.dropzone input { margin-top: 8px; max-width: 100%; font: inherit; font-size: .85rem; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--muted); }
.steps b { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px;
  font: inherit; font-weight: 600; font-size: .9rem; color: var(--text); text-decoration: none; white-space: nowrap;
  background: #fff; border: 1px solid #d5ddd2; border-radius: 10px; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--tint-2); border-color: #c3d4bb; }
.btn .icon { width: 18px; height: 18px; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-tint); border-color: #f0c4bf; }
.btn-ghost { border-color: transparent; background: none; color: var(--green-dark); padding-left: 4px; }
.btn-sm { padding: 7px 12px; font-size: .82rem; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { padding: 14px 20px; font-size: 1rem; }
.btn-xl { padding: 16px 30px; font-size: 1.1rem; border-radius: 12px; }
.btn-xl .icon { width: 22px; height: 22px; stroke-width: 2.4; }
.btn-block { width: 100%; margin-top: 6px; }

/* ---------- Messages ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; font-weight: 500; background: var(--tint); border: 1px solid #cfe5c4; color: #245a17; }
.flash .icon { margin-top: 1px; }
.flash.error { background: var(--red-tint); border-color: #f2c6c1; color: var(--red); }
.flash.warning { background: var(--amber-tint); border-color: #f1d9a6; color: var(--amber); }
.test-banner { padding: 10px 14px; border-radius: 12px; background: var(--amber-tint); border: 1px solid #f1d9a6; color: var(--amber); text-align: center; font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.message-card { text-align: center; padding: 36px 24px; max-width: 560px; }
.content .message-card { margin: 10px auto; }
.message-card h2 { font-size: 1.35rem; margin-bottom: 8px; }
.message-card p { color: var(--muted); margin: 0; }
.message-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; margin-bottom: 16px; }
.message-icon .icon { width: 32px; height: 32px; }
.message-icon.ok { background: var(--tint); color: var(--green); }
.message-icon.notice { background: var(--amber-tint); color: var(--amber); }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-weight: 600; text-decoration: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: 10px 12px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--tint-2); border-bottom: 1px solid var(--line); }
th:first-child { border-radius: 10px 0 0 10px; }
th:last-child { border-radius: 0 10px 10px 0; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover td { background: #fafcf9; }
td form { margin: 0; }
td.right form { display: inline-block; }
.person { display: flex; align-items: center; gap: 10px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .88rem; text-decoration: none; }
.tabs a b { font-size: .75rem; padding: 1px 8px; border-radius: 99px; background: #eef1ee; color: var(--muted); }
.tabs a:hover { background: var(--tint-2); color: var(--text); }
.tabs a.on { background: var(--green-deep); color: #fff; }
.tabs a.on b { background: rgba(255, 255, 255, .18); color: #fff; }
.head-actions { display: flex; gap: 8px; }

/* Contact search results (Send links) */
.results { margin-bottom: 8px; }
.result { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.result label { display: flex; align-items: center; gap: 12px; margin: 0; font-weight: 500; min-width: 0; cursor: pointer; }
.result-text { min-width: 0; }
.result-text b { display: block; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Gate page ---------- */
.gate-top { display: grid; gap: 18px; }
.gate-top .card { margin-bottom: 0; }
@media (min-width: 900px) { .gate-top { grid-template-columns: 340px 1fr; align-items: stretch; } }
.gate-count-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.gate-number { margin: 0; color: var(--muted); font-weight: 500; }
.gate-number b { font-size: 2.2rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.progress { height: 10px; border-radius: 99px; background: #e3ebe0; overflow: hidden; margin-bottom: 10px; }
.progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--lime)); transition: width .4s ease; }
.gate-search-card { display: flex; flex-direction: column; justify-content: center; }
.gate-search-card .search-field { margin-bottom: 6px; }
.gate-search-card .btn-ghost { align-self: flex-start; }
#gate-message { margin-top: 18px; }
.gate-results { margin-top: 18px; display: grid; gap: 12px; }
.guest {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.guest.registered { border-left-color: var(--green); }
.guest.checked_in { border-left-color: #b9c6bc; background: #fbfcfa; }
.guest.link_sent { border-left-color: #e2b04a; }
.guest-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.guest-who strong { font-size: 1.2rem; display: block; }
.guest-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 4px; font-size: .85rem; }
.guest .actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) { .guest .actions, .guest .actions .btn { width: 100%; } }

/* ---------- Printable list ---------- */
.print-actions { margin-bottom: 14px; }
.print-head { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; margin-bottom: 18px; }
.print-head img { width: 180px; }
.print-head p { margin: 4px 0 0; }
.tickbox { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--text); border-radius: 4px; }
@media print {
  @page { margin: 12mm; }
  .sidebar, .topbar, .no-print, .flash, .scrim { display: none !important; }
  body, .plain { background: #fff; font-size: 11px; }
  .shell { margin: 0; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; padding: 0; }
  th { background: none; }
  .print-table tr { break-inside: avoid; }
}
