:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --panel: #ffffff;
  --ink: #18201d;
  --muted: #60706a;
  --line: #dbe3df;
  --accent: #116a55;
  --accent-2: #b48736;
  --danger: #b3261e;
  --ok: #0b7a4b;
  --shadow: 0 12px 34px rgba(24, 32, 29, 0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button, input, select, textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 13px 16px;
  min-height: 46px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:disabled { opacity: .55; cursor: not-allowed; }
.secondary { background: #e7ece9; color: var(--ink); }
.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.compact { min-height: 36px; padding: 8px 11px; font-size: 14px; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
}

textarea { resize: vertical; }
label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: #35423d;
}

.hidden { display: none !important; }
.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.auth-shell {
  background:
    linear-gradient(180deg, rgba(17, 106, 85, .08), rgba(180, 135, 54, .08)),
    var(--bg);
}

.auth-panel {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}

.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

h1, h2, p { margin: 0; }
.brand-block h1 { font-size: 24px; }
.brand-block p, .hint, #userLabel { color: var(--muted); font-size: 14px; margin-top: 3px; }
.stack { display: grid; gap: 14px; }
.section-title { font-size: 15px; font-weight: 800; }

.notice {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f9fbfa;
  color: var(--ink);
  font-size: 14px;
}
.notice.error { border-color: #f0b8b4; background: #fff4f3; color: var(--danger); }
.notice.success { border-color: #a5dfc1; background: #f0fff7; color: var(--ok); }

.app { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar h1 { font-size: 24px; }
.eyebrow {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.icon-action {
  width: 44px;
  height: 44px;
  padding: 0;
  background: #eef3f0;
  position: relative;
}
.icon-action span,
.icon-action::before,
.icon-action::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.icon-action span { width: 17px; height: 2px; left: 13px; top: 21px; }
.icon-action::before { width: 2px; height: 18px; left: 21px; top: 9px; }
.icon-action::after {
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  background: transparent;
  transform: rotate(45deg);
  right: 11px;
  top: 16px;
}

.content {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px 14px 28px;
  display: grid;
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(24, 32, 29, .06);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.panel-head h2 { font-size: 19px; }

.form-grid {
  display: grid;
  gap: 12px;
}
.full { grid-column: 1 / -1; }

.phone-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.phone-entry button { min-height: 44px; }
.phone-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}
.phone-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 8px 7px 11px;
  background: #f8fbf9;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.phone-chip button {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  background: #e7ece9;
  color: var(--ink);
  line-height: 1;
}

.pin-card {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.pin-card img {
  width: 120px;
  height: 70px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.pin-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.search { margin-bottom: 12px; }
.invite-list {
  display: grid;
  gap: 10px;
}
.invite-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #fff;
}
.invite-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.invite-main strong { display: block; font-size: 16px; }
.pin {
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}
.meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
.badge {
  display: inline-flex;
  width: max-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef3f0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.badge.activa { background: #e8f7ee; color: var(--ok); }
.badge.cancelada, .badge.usada { background: #fff0ef; color: var(--danger); }
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.actions button { min-height: 40px; padding: 9px 10px; }
.danger { background: #fff0ef; color: var(--danger); }

@media (min-width: 760px) {
  .content { max-width: 560px; }
  .panel { padding: 18px; }
}

@media (max-width: 420px) {
  .topbar h1 { font-size: 21px; }
  .content { padding-left: 10px; padding-right: 10px; }
  .panel { border-radius: 10px; padding: 12px; }
  .invite-main { display: grid; }
}
