:root {
  --black: #030303;
  --deep: #090806;
  --surface: rgba(10, 9, 7, 0.78);
  --surface-2: rgba(16, 14, 11, 0.82);
  --text: #f8f1df;
  --soft: #d8ccb7;
  --muted: #a79b87;
  --gold: #d7a94f;
  --gold-soft: #ffe2a0;
  --gold-dark: #7b5520;
  --danger: #ff6d80;
  --line: rgba(215, 169, 79, 0.2);
  --line-soft: rgba(255, 226, 160, 0.08);
  --container: min(100%, 1180px);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 16% 10%, rgba(215, 169, 79, 0.1), transparent 26%),
    radial-gradient(circle at 84% 12%, rgba(255, 226, 160, 0.055), transparent 24%),
    linear-gradient(135deg, #000, #090806 48%, #020202);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 0, rgba(0, 0, 0, 0.76) 82%);
  z-index: 0;
}

#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.admin-login {
  display: grid;
  place-items: center;
  padding: 22px;
}

.login-card,
.panel,
.metric,
.table-panel,
.admin-form,
.table-tools,
.page-head,
.presence-card {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 226, 160, 0.035), rgba(255, 255, 255, 0.006)),
    var(--surface);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 226, 160, 0.055);
  backdrop-filter: blur(16px);
}

.login-card::before,
.panel::before,
.metric::before,
.table-panel::before,
.admin-form::before,
.table-tools::before,
.page-head::before,
.presence-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 226, 160, 0.045);
  border-radius: 12px;
  pointer-events: none;
}

.login-card {
  z-index: 1;
  width: min(460px, 100%);
  padding: 34px;
}

.admin-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(circle at 50% 0, rgba(215, 169, 79, 0.11), transparent 38%),
    rgba(3, 3, 3, 0.94);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 34px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.3);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--gold-soft);
  background: radial-gradient(circle, rgba(215, 169, 79, 0.18), transparent 68%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 700;
  box-shadow: 0 0 24px rgba(215, 169, 79, 0.22);
}

.brand strong {
  color: var(--gold-soft);
  letter-spacing: 0.14em;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.08em;
}

.sidebar nav {
  display: grid;
  gap: 10px;
}

.sidebar a,
.ghost-button,
.copy-btn,
.actions-cell a,
.actions-cell button {
  color: var(--text);
  text-decoration: none;
}

.sidebar nav a,
.logout {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #e7dcc7;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.sidebar nav a span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--gold-soft);
}

.admin-profile {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: -18px 0 24px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.admin-profile > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #080807;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  font-weight: 900;
}

.admin-profile b {
  display: block;
  color: var(--text);
}

.admin-profile small {
  color: var(--muted);
}

.sidebar nav a:hover,
.logout:hover {
  border-color: var(--line);
  background: rgba(215, 169, 79, 0.08);
  transform: translateX(2px);
}

.logout {
  position: absolute;
  right: 22px;
  bottom: 22px;
  left: 22px;
}

.logout-form {
  margin: 0;
}

.logout-form .logout {
  width: calc(100% - 44px);
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.admin-main {
  width: var(--container);
  padding: clamp(18px, 3vw, 34px);
  margin: 0 auto;
}

.admin-topbar {
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr) minmax(240px, 420px) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.admin-topbar span,
.top-search span,
.activity-pill {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-topbar strong {
  display: block;
  margin-top: 3px;
  color: var(--gold-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 400;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  width: 46px;
  height: 46px;
  place-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--gold-soft);
  background: rgba(0, 0, 0, 0.32);
  padding: 0;
  cursor: pointer;
}

.sidebar-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.top-search {
  display: grid;
  gap: 5px;
}

.top-search input {
  width: 100%;
  border: 1px solid rgba(215, 169, 79, 0.18);
  border-radius: 999px;
  padding: 11px 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  outline: none;
}

.activity-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(70, 255, 187, 0.22);
  border-radius: 999px;
  color: #8cffca;
  background: rgba(70, 255, 187, 0.06);
}

.activity-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8cffca;
  box-shadow: 0 0 14px #8cffca;
}

.admin-main.narrow {
  max-width: 740px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 22px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 16px;
  color: #fff7e5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 4.4vw, 3.7rem);
  font-weight: 500;
  line-height: 0.98;
}

h2 {
  margin: 0 0 16px;
  color: #fff7e5;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}

.metrics-shell {
  position: relative;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 226, 160, 0.03), rgba(255, 255, 255, 0.006)),
    rgba(0, 0, 0, 0.18);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.chart-card {
  min-height: 360px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 226, 160, 0.035), rgba(255, 255, 255, 0.006)), rgba(0, 0, 0, 0.2);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 226, 160, 0.04);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card canvas {
  width: 100% !important;
  height: 280px !important;
}

.chart-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.chart-title h2 {
  margin: 0;
}

.chart-title span {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metrics-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.metrics-head span,
.metrics-head b {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.metrics-head span {
  color: var(--gold-soft);
}

.metric {
  min-height: 112px;
  padding: 18px;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(215, 169, 79, 0.12);
  border-radius: 50%;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 18px;
  color: var(--gold-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 2.7vw, 2.3rem);
  font-weight: 400;
  line-height: 1;
}

.panel {
  min-height: 320px;
  padding: 22px;
}

.presence-board {
  display: grid;
  gap: 18px;
}

.presence-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  min-height: 136px;
}

.presence-hero h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 4vw, 3.3rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}

.presence-score {
  min-width: 170px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  text-align: center;
  background: rgba(215, 169, 79, 0.075);
  box-shadow: inset 0 0 26px rgba(215, 169, 79, 0.06);
}

.presence-score strong {
  display: block;
  color: var(--gold-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1;
}

.presence-score span,
.guest-list span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.presence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.presence-card {
  padding: 20px;
  overflow: hidden;
}

.presence-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 24px;
  left: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215, 169, 79, 0.75), transparent);
}

.presence-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.presence-top h3 {
  margin: 12px 0 0;
  color: #fff7e5;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 400;
}

.presence-count {
  min-width: 92px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  text-align: center;
  background: rgba(0, 0, 0, 0.28);
}

.presence-count strong {
  display: block;
  color: var(--gold-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
}

.presence-count span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.presence-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.presence-meta span,
.guest-list,
.presence-notes {
  border: 1px solid rgba(215, 169, 79, 0.16);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
}

.presence-meta span {
  padding: 10px;
  font-size: 0.82rem;
}

.presence-meta b,
.guest-list p,
.presence-notes p {
  color: var(--soft);
}

.guest-list,
.presence-notes {
  padding: 14px;
}

.guest-list p,
.presence-notes p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.presence-notes {
  margin-top: 12px;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-signal {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 0 26px rgba(215, 169, 79, 0.18);
}

.confirmation-list {
  display: grid;
  gap: 14px;
}

.confirmation-card {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 226, 160, 0.035), rgba(255, 255, 255, 0.006)), var(--surface);
  box-shadow: var(--shadow);
}

.confirmation-code {
  display: grid;
  place-items: center;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--gold-soft);
  font-family: Georgia, "Times New Roman", serif;
}

.confirmation-card h2 {
  margin: 10px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  letter-spacing: 0;
  text-transform: none;
}

.confirmation-card p {
  margin: 0;
  color: var(--soft);
}

.confirmation-stats {
  display: flex;
  gap: 10px;
}

.confirmation-stats span,
.report-panel {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
}

.confirmation-stats span {
  min-width: 86px;
  padding: 10px;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
}

.confirmation-stats b {
  display: block;
  color: var(--gold-soft);
  font-size: 1.35rem;
}

.report-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.report-panel {
  padding: 20px;
}

.report-panel span {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.report-panel strong {
  display: block;
  margin: 14px 0;
  color: var(--gold-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  font-weight: 400;
}

.table-tools {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
}

.table-tools input,
.table-tools select,
.admin-form input,
.admin-form select,
.admin-form textarea,
.login-card input {
  width: 100%;
  border: 1px solid rgba(215, 169, 79, 0.18);
  border-radius: 12px;
  padding: 14px 15px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.5);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.table-tools input:focus,
.table-tools select:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.login-card input:focus {
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(215, 169, 79, 0.12);
}

.admin-form,
.login-card form {
  display: grid;
  gap: 16px;
}

.admin-form {
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.table-panel {
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  padding: 15px;
  border-bottom: 1px solid rgba(215, 169, 79, 0.1);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--gold-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(215, 169, 79, 0.055);
}

td {
  color: var(--soft);
}

tr:hover td {
  background: rgba(215, 169, 79, 0.04);
}

.badge {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge.confirmado {
  color: #8cffca;
  background: rgba(70, 255, 187, 0.1);
  box-shadow: 0 0 18px rgba(70, 255, 187, 0.16);
}

.badge.pendente {
  color: var(--gold-soft);
  background: rgba(215, 169, 79, 0.11);
  box-shadow: 0 0 18px rgba(215, 169, 79, 0.12);
}

.actions-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.actions-cell form {
  margin: 0;
}

.actions-cell button {
  border: 0;
  padding: 0;
  font: inherit;
  background: transparent;
  cursor: pointer;
}

.copy-btn,
.ghost-button,
.neon-button {
  min-height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.copy-btn,
.ghost-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
}

.neon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--gold);
  color: #fff2c8;
  background: linear-gradient(90deg, rgba(215, 169, 79, 0.16), rgba(215, 169, 79, 0.34), rgba(215, 169, 79, 0.1));
  box-shadow: 0 0 22px rgba(215, 169, 79, 0.24), inset 0 1px 0 rgba(255, 226, 160, 0.22);
  text-decoration: none;
}

.alert {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(215, 169, 79, 0.07);
}

.alert.error {
  border-color: rgba(255, 109, 128, 0.45);
  color: #ffd8df;
  background: rgba(255, 109, 128, 0.12);
}

.pagination {
  display: flex;
  gap: 8px;
  padding: 14px;
}

.pagination button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
}

.pagination button.active {
  color: #080807;
  background: var(--gold-soft);
}

@media (max-width: 1180px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .admin-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 290px;
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: grid;
  }

  .logout {
    position: static;
    margin-top: 16px;
  }

  .admin-main {
    padding: 74px 16px 16px;
  }

  .cards,
  .presence-grid,
  .chart-grid,
  .report-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    grid-template-columns: auto 1fr;
  }

  .top-search,
  .activity-pill {
    grid-column: 1 / -1;
  }

  .confirmation-card {
    grid-template-columns: 1fr;
  }

  .confirmation-stats {
    flex-direction: column;
  }

  .presence-hero,
  .presence-top,
  .presence-meta {
    grid-template-columns: 1fr;
  }

  .presence-hero,
  .presence-top {
    flex-direction: column;
  }

  .presence-score,
  .presence-count {
    width: 100%;
  }

  .page-head,
  .table-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .table-panel {
    overflow-x: auto;
  }
}
