:root {
  --ivory: #f4eddf;
  --paper: #efe6d8;
  --moss: #6a6c3f;
  --moss-soft: #7a7c51;
  --moss-deep: #474329;
  --ink: #332c0f;
  --gold: #ab884f;
  --line: rgba(51, 44, 15, 0.16);
  --display: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  font-family: var(--sans);
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-shell {
  min-height: 100vh;
  padding: 1.25rem;
}

.admin-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.admin-brand__monogram {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1;
  text-decoration: none;
}

.admin-brand__monogram i {
  width: 1.15rem;
  height: 1px;
  background: var(--gold);
  rotate: -56deg;
}

.admin-brand p {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-view {
  display: grid;
  align-items: center;
  min-height: calc(100vh - 6rem);
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.login-view__intro h1,
.dashboard__header h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.045em;
}

.login-view__intro h1 {
  max-width: 10ch;
  font-size: clamp(3.8rem, 18vw, 6.6rem);
  line-height: 0.82;
}

.login-view__intro h1 em {
  color: var(--moss-soft);
  font-weight: 400;
}

.login-view__intro > p:last-child {
  max-width: 31rem;
  margin: 2rem 0 2.6rem;
  color: rgba(24, 32, 24, 0.65);
  font-size: 0.9rem;
  line-height: 1.7;
}

.login-card {
  position: relative;
  overflow: hidden;
  padding: 2rem 1.5rem 1.5rem;
  color: var(--ivory);
  background: var(--moss-deep);
}

.login-card::after {
  position: absolute;
  top: -7rem;
  right: -7rem;
  width: 13rem;
  height: 13rem;
  border: 1px solid rgba(184, 135, 79, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 2.8rem rgba(184, 135, 79, 0.04), 0 0 0 5.6rem rgba(184, 135, 79, 0.025);
  content: "";
  pointer-events: none;
}

.connection-status {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 3.8rem;
  color: rgba(244, 237, 223, 0.64);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.connection-status > span:first-child {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #d4a871;
  box-shadow: 0 0 0 0.22rem rgba(212, 168, 113, 0.13);
}

.connection-status.is-ready > span:first-child {
  background: #9fbc91;
  box-shadow: 0 0 0 0.22rem rgba(159, 188, 145, 0.13);
}

.admin-field {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.65rem;
}

.admin-field > span {
  color: rgba(244, 237, 223, 0.68);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.admin-field input {
  width: 100%;
  padding: 0.85rem 0 0.95rem;
  border: 0;
  border-bottom: 1px solid rgba(244, 237, 223, 0.28);
  border-radius: 0;
  outline: 0;
  color: var(--ivory);
  background: transparent;
  font-size: 1rem;
}

.admin-field input::placeholder {
  color: rgba(244, 237, 223, 0.3);
}

.admin-field input:focus {
  border-color: var(--gold);
}

.primary-button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  border: 0;
  color: var(--ink);
  background: var(--ivory);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.primary-button svg {
  width: 1.25rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.admin-status {
  position: relative;
  z-index: 1;
  min-height: 1rem;
  margin: 1rem 0 0;
  color: #edb7a9;
  font-size: 0.7rem;
}

.privacy-note {
  position: relative;
  z-index: 1;
  margin: 2.8rem 0 0;
  color: rgba(244, 237, 223, 0.38);
  font-size: 0.62rem;
  line-height: 1.55;
}

.dashboard {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4.5rem 0 5rem;
}

.dashboard__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.dashboard__header h1 {
  font-size: clamp(3.7rem, 8vw, 7rem);
  line-height: 0.85;
}

.dashboard__header > div:first-child > p:last-child {
  margin: 1.1rem 0 0;
  color: rgba(24, 32, 24, 0.55);
  font-size: 0.7rem;
}

.dashboard__actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.outline-button,
.text-button {
  border: 0;
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.outline-button {
  padding: 0.85rem 1rem;
  border: 1px solid var(--ink);
  background: transparent;
}

.text-button {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 3.6rem;
  border: 1px solid var(--line);
}

.summary-card {
  display: grid;
  min-height: 11rem;
  padding: 1.2rem;
  border-right: 1px solid var(--line);
  background: rgba(244, 237, 223, 0.42);
}

.summary-card:last-child {
  border-right: 0;
}

.summary-card span,
.summary-card small {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.summary-card strong {
  align-self: end;
  font-family: var(--display);
  font-size: clamp(3.2rem, 7vw, 5.7rem);
  font-weight: 400;
  line-height: 0.75;
}

.summary-card small {
  align-self: end;
  color: rgba(24, 32, 24, 0.45);
  font-size: 0.48rem;
}

.summary-card--total {
  color: var(--ivory);
  background: var(--moss);
}

.summary-card--total small {
  color: rgba(244, 237, 223, 0.48);
}

.summary-card--muted {
  color: rgba(24, 32, 24, 0.65);
}

.guest-panel {
  margin-top: 2rem;
  border: 1px solid var(--line);
  background: rgba(244, 237, 223, 0.62);
}

.guest-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: min(100%, 27rem);
}

.search-field svg {
  width: 1rem;
  flex: 0 0 auto;
  stroke: rgba(24, 32, 24, 0.55);
  stroke-width: 1.4;
}

.search-field input,
.filter-field select {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.72rem;
}

.search-field input {
  width: 100%;
}

.search-field input::placeholder {
  color: rgba(24, 32, 24, 0.42);
}

.filter-field select {
  padding: 0.5rem 1.8rem 0.5rem 0.3rem;
  font-weight: 600;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: rgba(24, 32, 24, 0.5);
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

th:nth-child(1) { width: 22%; }
th:nth-child(2) { width: 12%; }
th:nth-child(3) { width: 23%; }
th:nth-child(4) { width: 13%; }
th:nth-child(5) { width: 18%; }
th:nth-child(6) { width: 12%; }

td {
  color: rgba(24, 32, 24, 0.7);
  font-size: 0.7rem;
  line-height: 1.55;
}

td:first-child {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
}

.guest-household strong,
.guest-household small {
  display: block;
}

.guest-household small {
  margin-top: 0.25rem;
  color: rgba(24, 32, 24, 0.42);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guest-household ul {
  display: grid;
  gap: 0.18rem;
  margin: 0.6rem 0 0;
  padding: 0;
  color: rgba(24, 32, 24, 0.58);
  font-size: 0.62rem;
  font-weight: 400;
  list-style: none;
}

.guest-household li::before {
  margin-right: 0.35rem;
  color: var(--gold);
  content: "—";
}

tbody tr:last-child td {
  border-bottom: 0;
}

.attendance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.attendance-badge::before {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: #708c68;
  content: "";
}

.attendance-badge--no::before {
  background: #a48472;
}

.attendance-badge--mixed::before {
  background: var(--gold);
}

.empty-state {
  padding: 5rem 1rem;
  text-align: center;
}

.empty-state span {
  color: rgba(24, 32, 24, 0.14);
  font-family: var(--display);
  font-size: 3.4rem;
}

.empty-state p {
  margin: 0.8rem 0 0;
  color: rgba(24, 32, 24, 0.5);
  font-size: 0.72rem;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@media (min-width: 780px) {
  .admin-shell {
    padding: 1.5rem 2rem;
  }

  .login-view {
    grid-template-columns: minmax(0, 1.35fr) minmax(22rem, 0.65fr);
    gap: 6vw;
  }

  .login-card {
    padding: 2.5rem;
  }
}

@media (max-width: 700px) {
  .dashboard {
    padding-top: 3.2rem;
  }

  .dashboard__header {
    display: block;
  }

  .dashboard__actions {
    justify-content: space-between;
    margin-top: 2rem;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary-card {
    min-height: 9.5rem;
  }

  .summary-card--total {
    grid-column: auto;
    min-height: 9.5rem;
    border-right: 1px solid rgba(244, 237, 223, 0.18);
    border-bottom: 1px solid rgba(244, 237, 223, 0.18);
  }

  .summary-card:nth-child(2),
  .summary-card:nth-child(4) {
    border-right: 0;
  }

  .summary-card:nth-child(1),
  .summary-card:nth-child(3) {
    border-right: 1px solid var(--line);
  }

  .summary-card:nth-child(3),
  .summary-card:nth-child(4) {
    border-bottom: 0;
  }

  .guest-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-field select {
    width: 100%;
    padding: 0.7rem 0;
    border-top: 1px solid var(--line);
  }

  table,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.8rem 1rem;
    padding: 1.1rem;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  td {
    padding: 0;
    border: 0;
  }

  td:nth-child(3),
  td:nth-child(4),
  td:nth-child(5),
  td:nth-child(6) {
    grid-column: 1 / -1;
  }

  td:nth-child(3),
  td:nth-child(4),
  td:nth-child(5) {
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
  }

  td:nth-child(3)::before,
  td:nth-child(4)::before,
  td:nth-child(5)::before {
    display: block;
    margin-bottom: 0.35rem;
    color: rgba(24, 32, 24, 0.38);
    font-size: 0.48rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  td:nth-child(3)::before { content: "Endereço"; }
  td:nth-child(4)::before { content: "Chinelos femininos"; }
  td:nth-child(5)::before { content: "Recado"; }

  td:nth-child(6) {
    color: rgba(24, 32, 24, 0.38);
    font-size: 0.56rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

@media (max-width: 380px) {
  .admin-shell {
    padding: 1rem;
  }

  .admin-brand p {
    font-size: 0.5rem;
  }

  .login-view__intro h1 {
    font-size: 3.35rem;
  }
}
