/* ==========================================================================
   Pamêlla & Jakson — painel administrativo
   Estilos próprios do /admin. Os tokens, reset e primitivos (.btn, .field,
   .input, .textarea, .select, .hint, .eyebrow, .skip-link, .sr-only) vêm de
   /css/tokens.css e NÃO devem ser duplicados aqui.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

.admin {
  --topbar-h: 94px;
  --sidebar-w: 272px;
  background: var(--cream);
}

[hidden] {
  display: none !important;
}

.admin ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.admin ::-webkit-scrollbar-thumb {
  background: var(--sage-300);
  border: 3px solid var(--cream);
  border-radius: var(--radius-pill);
}

.admin ::-webkit-scrollbar-track {
  background: transparent;
}

/* Botões e ícones auxiliares ------------------------------------------------ */

.icon,
.icon-btn svg,
.sidebar__site-link svg,
.nav-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.icon-btn:hover {
  background: var(--cream-3);
  color: var(--ink);
}

.icon-btn--sm {
  width: 30px;
  height: 30px;
}

.icon-btn--sm svg {
  width: 16px;
  height: 16px;
}

.icon-btn--danger:hover {
  background: #f8ecea;
  color: var(--danger);
}

.btn--xs {
  min-height: 32px;
  padding: 0.4rem 0.85rem;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
}

.btn--danger {
  --btn-bg: var(--danger);
  --btn-fg: #fff;
}

.btn--danger:hover {
  background: #8f463f;
}

.btn--quiet {
  --btn-bg: transparent;
  --btn-fg: var(--ink-3);
  --btn-border: transparent;
}

.btn--quiet:hover {
  background: var(--cream-3);
  color: var(--ink);
  border-color: transparent;
  box-shadow: none;
}

.btn .icon,
.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.btn--busy {
  pointer-events: none;
  opacity: 0.7;
}

.link {
  color: var(--sage-800);
  text-decoration: underline;
  text-decoration-color: var(--sage-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}

.link:hover {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Marca / monograma
   -------------------------------------------------------------------------- */

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--sage-300);
  border-radius: 50%;
  background: var(--paper);
  color: var(--sage-800);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand-mark--lg {
  width: 68px;
  height: 68px;
  font-size: 1.5rem;
}

.brand-mark__amp {
  font-style: italic;
  font-size: 0.92em;
  color: var(--sage-600);
}

/* --------------------------------------------------------------------------
   Boot (verificação de sessão)
   -------------------------------------------------------------------------- */

.boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-5);
  text-align: center;
}

.boot__text {
  color: var(--text-soft);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
}

.spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--sage-200);
  border-top-color: var(--sage-600);
  animation: spin 0.9s linear infinite;
}

.spinner--sm {
  width: 18px;
  height: 18px;
  border-width: 1.5px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.login {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter);
  overflow: hidden;
  background: radial-gradient(
      120% 90% at 15% 0%,
      rgba(171, 196, 171, 0.28) 0%,
      transparent 55%
    ),
    radial-gradient(90% 80% at 100% 100%, rgba(239, 234, 222, 0.9) 0%, transparent 60%),
    var(--cream);
}

.login__glow {
  position: absolute;
  z-index: -1;
  width: 46rem;
  height: 46rem;
  border-radius: 50%;
  left: 50%;
  top: -28rem;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(171, 196, 171, 0.3), transparent 68%);
  filter: blur(10px);
  pointer-events: none;
}

.login__card {
  width: min(440px, 100%);
  padding: clamp(1.75rem, 5vw, 2.75rem);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  text-align: center;
}

.login__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.login__title {
  font-size: clamp(2rem, 4vw, 2.65rem);
  margin-bottom: var(--space-2);
}

.login__subtitle {
  color: var(--text-soft);
  font-size: var(--fs-sm);
  max-width: 34ch;
  margin: 0 auto var(--space-6);
  line-height: 1.6;
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
}

.login__submit {
  width: 100%;
  margin-top: var(--space-1);
}

.login__foot {
  margin-top: var(--space-6);
  color: var(--muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
}

.login__link {
  color: var(--sage-800);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.password-field {
  position: relative;
}

.password-field .input {
  padding-right: 3rem;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  color: var(--ink-3);
}

.password-field__toggle:hover {
  background: var(--cream-3);
  color: var(--ink);
}

.password-field__toggle .icon {
  width: 19px;
  height: 19px;
}

.password-field__toggle .icon--eye-off {
  display: none;
}

.password-field__toggle.is-revealed .icon--eye {
  display: none;
}

.password-field__toggle.is-revealed .icon--eye-off {
  display: block;
}

/* --------------------------------------------------------------------------
   Estrutura da aplicação
   -------------------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.app__main {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Sidebar ------------------------------------------------------------------ */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: 1.6rem 1.15rem 1.4rem;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #f8f4eb 0%, var(--cream) 58%);
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0 0.45rem;
}

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar__brand-names {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--ink);
}

.sidebar__brand-sub {
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.72rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 300;
  transition: background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.nav-item svg {
  width: 19px;
  height: 19px;
  color: var(--sage-600);
  transition: color var(--dur-fast) var(--ease-out);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.nav-item.is-active {
  background: var(--sage-100);
  color: var(--sage-900);
  font-weight: 400;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 50%;
  width: 3px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--sage-500);
  transform: translateY(-50%);
}

.nav-item.is-active svg {
  color: var(--sage-800);
}

.sidebar__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem 0.45rem 0;
  border-top: 1px solid var(--line-soft);
}

.sidebar__date {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.sidebar__date-day {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--sage-700);
}

.sidebar__date-meta {
  display: flex;
  flex-direction: column;
  font-size: 0.6875rem;
  color: var(--muted);
  line-height: 1.45;
}

.sidebar__date-meta strong {
  font-weight: 400;
  color: var(--ink-2);
}

.sidebar__site-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-2);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.6);
  transition: border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.sidebar__site-link:hover {
  border-color: var(--sage-300);
  background: var(--paper);
  color: var(--ink);
}

.sidebar__site-link svg {
  width: 15px;
  height: 15px;
}

.sidebar__user {
  font-size: 0.6875rem;
  color: var(--muted);
  padding-left: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Topbar ------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0.95rem clamp(1.15rem, 2.6vw, 2.5rem);
  background: rgba(251, 249, 244, 0.88);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}

.topbar__start {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.topbar__menu {
  display: none;
}

.topbar__titles {
  min-width: 0;
}

.topbar__eyebrow {
  font-size: 0.625rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--sage-700);
}

.topbar__title {
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem);
  line-height: 1.15;
  margin-top: 0.1rem;
}

.topbar__subtitle {
  margin-top: 0.15rem;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}

/* Conteúdo ----------------------------------------------------------------- */

.content {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding: clamp(1.4rem, 2.6vw, 2.6rem) clamp(1.15rem, 2.6vw, 2.5rem) 5rem;
}

.view {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  animation: viewIn var(--dur) var(--ease-out);
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Barra de ferramentas de uma visão --------------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.toolbar__grow {
  flex: 1 1 auto;
}

.toolbar__text {
  color: var(--text-soft);
  font-size: var(--fs-sm);
}

.toolbar__group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search {
  position: relative;
  flex: 1 1 220px;
  max-width: 340px;
}

.search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.search .input {
  padding-left: 2.5rem;
  min-height: 42px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   Componentes: cards, métricas, progresso
   -------------------------------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: clamp(1.15rem, 2vw, 1.65rem);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.card__title {
  font-size: 1.35rem;
  line-height: 1.2;
}

.card__hint {
  color: var(--muted);
  font-size: var(--fs-xs);
  margin-top: 0.15rem;
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card--flush .card__head {
  padding: 1.25rem 1.4rem 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.4vw, 1.15rem);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.2rem 1.3rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.stat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.stat__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sage-50);
  color: var(--sage-700);
}

.stat__icon svg {
  width: 19px;
  height: 19px;
}

.stat__icon--warn {
  background: #fbf2e4;
  color: #9a7438;
}

.stat__icon--danger {
  background: #f9ece9;
  color: var(--danger);
}

.stat__icon--ink {
  background: var(--cream-3);
  color: var(--ink-2);
}

.stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.4rem + 1.4vw, 2.5rem);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.stat__label {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stat__meta {
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.stat__meta strong {
  color: var(--ink-2);
  font-weight: 400;
}

.progress {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--cream-3);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage-300), var(--sage-500));
  transition: width var(--dur-slow) var(--ease-out);
}

/* Layouts ------------------------------------------------------------------ */

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(0.85rem, 1.6vw, 1.25rem);
  align-items: start;
}

/* Atalhos da visão geral --------------------------------------------------- */

.quick-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.7rem 0.6rem;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--ink-2);
  font-size: 0.9375rem;
  transition: background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.quick-link:hover {
  background: var(--cream-2);
  color: var(--ink);
}

.quick-link svg {
  width: 18px;
  height: 18px;
  color: var(--sage-600);
}

.quick-link__arrow {
  margin-left: auto;
  color: var(--muted);
}

.quick-link__arrow svg {
  width: 15px;
  height: 15px;
  color: currentColor;
}

/* --------------------------------------------------------------------------
   Tabelas
   -------------------------------------------------------------------------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-top: 1px solid var(--line-soft);
}

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--cream-2);
  white-space: nowrap;
}

.table td {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--ink-2);
}

.table tbody tr {
  transition: background var(--dur-fast) var(--ease-out);
}

.table tbody tr:hover {
  background: rgba(246, 242, 233, 0.55);
}

.table .cell-main {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.cell-stack strong {
  font-weight: 400;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 26ch;
}

.cell-stack span,
.cell-stack small {
  color: var(--muted);
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
}

.cell-nowrap {
  white-space: nowrap;
}

.cell-money {
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.thumb {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: var(--cream-2);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb svg {
  width: 20px;
  height: 20px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  justify-content: flex-end;
}

.table th:last-child,
.table td:last-child {
  text-align: right;
}

.table td .row-actions {
  margin-left: auto;
}

/* Pills / badges ----------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.26rem 0.62rem;
  border-radius: var(--radius-pill);
  font-size: 0.625rem;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--cream-3);
  color: var(--ink-3);
}

.pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.pill--success {
  background: var(--sage-100);
  color: var(--sage-800);
}

.pill--warn {
  background: #fbf1e2;
  color: #8c6733;
}

.pill--danger {
  background: #f8ebe8;
  color: #8f463f;
}

.pill--sage {
  background: var(--sage-50);
  color: var(--sage-700);
}

.pill--muted {
  background: var(--cream-3);
  color: var(--ink-3);
}

.pill--plain::before {
  display: none;
}

/* --------------------------------------------------------------------------
   Estados (loading, vazio, erro)
   -------------------------------------------------------------------------- */

.state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.7rem;
  padding: clamp(2rem, 5vw, 3rem) 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
}

.state-card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 0.2rem;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--sage-700);
}

.state-card__icon svg {
  width: 23px;
  height: 23px;
}

.state-card--error .state-card__icon {
  background: #f9ece9;
  color: var(--danger);
}

.state-card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
}

.state-card__text {
  color: var(--text-soft);
  font-size: var(--fs-sm);
  max-width: 46ch;
}

.state-card .btn {
  margin-top: 0.5rem;
}

.loading-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
}

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--cream-3) 25%,
    var(--cream-2) 37%,
    var(--cream-3) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
}

.skeleton--title {
  width: 34%;
  height: 20px;
}

.skeleton--row {
  width: 100%;
  height: 46px;
}

.skeleton--stats {
  height: 108px;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 0.2rem;
  color: var(--text-soft);
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   Editor de conteúdo
   -------------------------------------------------------------------------- */

.content-toolbar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0;
  margin-top: -0.4rem;
  background: linear-gradient(
    180deg,
    rgba(251, 249, 244, 0.97) 72%,
    rgba(251, 249, 244, 0)
  );
  backdrop-filter: blur(6px);
}

.content-toolbar__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-soft);
  font-size: var(--fs-sm);
}

.content-toolbar__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage-500);
}

.content-toolbar__dot--dirty {
  background: #c08a43;
}

.content-toolbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.group-card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.group-card + .group-card {
  margin-top: 0.7rem;
}

.group-card__heading {
  margin: 0;
  font: inherit;
}

.group-card__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 1.05rem 1.3rem;
  text-align: left;
  transition: background var(--dur-fast) var(--ease-out);
}

.group-card__head:hover {
  background: rgba(246, 242, 233, 0.5);
}

.group-card__num {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--sage-600);
  width: 1.6rem;
}

.group-card__titles {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.group-card__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--ink);
}

.group-card__desc {
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.5;
}

.group-card__badge {
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: #fbf1e2;
  color: #8c6733;
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.group-card__chevron {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--ink-3);
  transition: transform var(--dur) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}

.group-card__chevron svg {
  width: 16px;
  height: 16px;
}

.group-card__head[aria-expanded="true"] .group-card__chevron {
  transform: rotate(180deg);
  background: var(--sage-100);
  color: var(--sage-800);
}

.group-card__body {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 0 1.3rem 1.4rem;
  border-top: 1px solid var(--line-soft);
  padding-top: 1.15rem;
}

.group-card__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.group-card__tools-hint {
  color: var(--muted);
  font-size: var(--fs-xs);
  margin-left: auto;
}

.group-card__fields {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.group-card__body.is-advanced .group-card__fields {
  display: none;
}

/* Modo avançado (JSON) ----------------------------------------------------- */

.advanced {
  display: none;
  flex-direction: column;
  gap: 0.8rem;
}

.group-card__body.is-advanced .advanced {
  display: flex;
}

.json-area {
  width: 100%;
  min-height: 280px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfbf8;
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.65;
  resize: vertical;
  tab-size: 2;
}

.json-area:focus {
  outline: none;
  border-color: var(--sage-400);
  box-shadow: 0 0 0 4px rgba(171, 196, 171, 0.22);
}

.json-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Formulários -------------------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.15rem;
}

.form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field--span {
  grid-column: 1 / -1;
}

.field__error {
  display: block;
  margin-top: 0.1rem;
  color: var(--danger);
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.field.has-error .input,
.field.has-error .textarea,
.field.has-error .select,
.field.has-error .money-input {
  border-color: #c78a82;
  box-shadow: 0 0 0 3px rgba(164, 85, 77, 0.1);
}

.subfieldset {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin: 0;
  padding: 0.95rem 1.05rem 1.15rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(246, 242, 233, 0.5), transparent);
}

.subfieldset__legend {
  padding: 0 0.4rem;
  margin-left: -0.4rem;
  font-family: var(--font-sans);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-800);
}

/* Switch ------------------------------------------------------------------- */

.switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  cursor: pointer;
  padding: 0.1rem 0;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch__track {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin-top: 0.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--cream-3);
  transition: background var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur) var(--ease-out);
}

.switch input:checked + .switch__track {
  background: var(--sage-400);
  border-color: var(--sage-500);
}

.switch input:checked + .switch__track::after {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.switch__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-top: 0.05rem;
}

.switch__label {
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.4;
}

.switch__hint {
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.45;
}

/* Campos compostos -------------------------------------------------------- */

.image-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.image-field__row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.image-field__row .input {
  flex: 1 1 auto;
  min-width: 0;
}

.image-preview {
  flex: none;
  display: grid;
  place-items: center;
  width: 66px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream-2);
  color: var(--muted);
}

.image-preview--lg {
  width: 104px;
  height: 78px;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview svg {
  width: 18px;
  height: 18px;
}

.color-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.color-field input[type="color"] {
  flex: none;
  width: 46px;
  height: 46px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
}

.color-field .input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.875rem;
}

.money-input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out);
}

.money-input:focus {
  outline: none;
  border-color: var(--sage-400);
  box-shadow: 0 0 0 4px rgba(171, 196, 171, 0.22);
}

.password-field--admin .input {
  padding-right: 3.2rem;
}

/* Arrays ------------------------------------------------------------------- */

.array-field {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.array-field__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
}

.array-field__label {
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.array-field__hint {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.array-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.array-item {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(251, 249, 244, 0.6);
  padding: 0.7rem 0.8rem 0.85rem;
}

.array-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.array-item__title {
  font-size: 0.625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.array-item__tools {
  display: flex;
  align-items: center;
  gap: 0.05rem;
}

.array-item__tools .icon-btn {
  width: 28px;
  height: 28px;
}

.array-item__tools .icon-btn svg {
  width: 15px;
  height: 15px;
}

.array-item .form-grid {
  gap: 0.75rem 1rem;
}

.array-item__simple {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.array-item__simple .input {
  flex: 1 1 auto;
  min-width: 0;
}

.array-empty {
  padding: 0.65rem 0.2rem;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.array-add {
  align-self: flex-start;
}

/* Prévia do RSVP ----------------------------------------------------------- */

.embed-preview {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: var(--cream-2);
}

.embed-preview__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.embed-preview__dots {
  display: inline-flex;
  gap: 4px;
}

.embed-preview__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

.embed-preview__frame {
  min-height: 420px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper);
}

.embed-preview iframe {
  width: 100%;
  height: 420px;
  border: 0;
}

.embed-preview__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 160px;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.embed-preview__empty svg {
  width: 24px;
  height: 24px;
  color: var(--sage-600);
}

.embed-preview__status {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.embed-preview__status.is-valid {
  color: var(--success);
}

.embed-preview__status.is-invalid {
  color: var(--danger);
}

/* --------------------------------------------------------------------------
   Pagamento
   -------------------------------------------------------------------------- */

.payment-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: clamp(1.15rem, 2.2vw, 1.65rem);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--sage-50), var(--paper) 62%);
}

.payment-banner__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.payment-banner__eyebrow {
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-700);
}

.payment-banner__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
}

.payment-banner__meta {
  color: var(--text-soft);
  font-size: var(--fs-sm);
}

.payment-banner__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.help-card {
  background: linear-gradient(180deg, var(--cream-2), var(--paper));
}

.help-steps {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  counter-reset: step;
}

.help-step {
  display: flex;
  gap: 0.75rem;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: 1.55;
}

.help-step::before {
  counter-increment: step;
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sage-100);
  color: var(--sage-800);
  font-size: 0.6875rem;
  font-family: var(--font-sans);
}

.help-note {
  display: flex;
  gap: 0.6rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(171, 196, 171, 0.14);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

.help-note svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--sage-700);
  margin-top: 0.1rem;
}

.code-inline {
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  background: var(--cream-3);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
}

.test-result {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--cream-2);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.test-result--ok {
  border-color: var(--sage-300);
  background: var(--sage-50);
  color: var(--sage-900);
}

.test-result--fail {
  border-color: #e7c7c1;
  background: #fbf0ed;
  color: #7d3f38;
}

.test-result__title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.test-result__title svg {
  width: 16px;
  height: 16px;
}

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.payment-actions__status {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--fs-xs);
}

/* --------------------------------------------------------------------------
   Alertas
   -------------------------------------------------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--cream-2);
  color: var(--ink-2);
}

.alert svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 0.15rem;
}

.alert--error {
  border-color: #e7c7c1;
  background: #fbf0ed;
  color: #7d3f38;
}

.alert--success {
  border-color: var(--sage-300);
  background: var(--sage-50);
  color: var(--sage-900);
}

.alert--warn {
  border-color: #ecd9b8;
  background: #fdf6ea;
  color: #7c5e2f;
}

.alert--info {
  border-color: var(--line);
  background: var(--cream-2);
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Modais
   -------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1rem, 4vh, 3rem) 1rem;
  overflow-y: auto;
  background: rgba(44, 50, 44, 0.42);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s var(--ease-out);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 2rem);
  background: var(--cream);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.28s var(--ease-out);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal--sm {
  max-width: 440px;
}

.modal--lg {
  max-width: 880px;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 1.3rem 1.5rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
}

.modal__eyebrow {
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage-700);
}

.modal__title {
  font-size: clamp(1.45rem, 3vw, 1.8rem);
  line-height: 1.15;
  margin-top: 0.1rem;
}

.modal__desc {
  margin-top: 0.4rem;
  color: var(--text-soft);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.modal__close {
  flex: none;
}

.modal__body {
  padding: 1.35rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__body form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--paper);
}

.modal__foot--between {
  justify-content: space-between;
  align-items: center;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.15rem;
}

.modal-section + .modal-section {
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
}

.modal-section__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ink);
}

.modal-section__hint {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 0.1rem;
}

.confirm-message {
  color: var(--ink-2);
  font-size: var(--fs-md);
  line-height: 1.6;
}

.confirm-detail {
  margin-top: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--cream-2);
  color: var(--ink-3);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

body.is-locked {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */

.toasts {
  position: fixed;
  right: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(400px, calc(100vw - 1.5rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sage-500);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toastIn 0.28s var(--ease-out);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.toast--error {
  border-left-color: var(--danger);
}

.toast--warn {
  border-left-color: #c08a43;
}

.toast--info {
  border-left-color: var(--ink-3);
}

.toast__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--success);
}

.toast--error .toast__icon {
  color: var(--danger);
}

.toast--warn .toast__icon {
  color: #a97b3c;
}

.toast--info .toast__icon {
  color: var(--ink-3);
}

.toast__icon svg {
  width: 18px;
  height: 18px;
}

.toast__content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.toast__title {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.toast__message {
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.toast__close {
  flex: none;
  width: 26px;
  height: 26px;
  margin-left: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.toast__close:hover {
  background: var(--cream-2);
  color: var(--ink);
}

.toast__close svg {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   Scrim / gaveta mobile
   -------------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 180;
  background: rgba(44, 50, 44, 0.4);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s var(--ease-out);
}

/* Noscript ----------------------------------------------------------------- */

.noscript {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 200;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--cream);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Responsivo
   ========================================================================== */

@media (max-width: 1180px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 959px) {
  .admin {
    --topbar-h: 82px;
  }

  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .app__main {
    grid-column: 1;
  }

  .sidebar {
    inset: 0 auto 0 0;
    z-index: 200;
    width: min(84vw, 310px);
    transform: translateX(-102%);
    transition: transform var(--dur) var(--ease-out);
    box-shadow: var(--shadow-lg);
    border-right: 0;
  }

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

  .topbar__menu {
    display: inline-grid;
    margin-left: -0.4rem;
  }

  .topbar__subtitle {
    display: none;
  }

  .content {
    padding-bottom: 4rem;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar__actions {
    margin-left: auto;
  }

  .topbar__site {
    display: none;
  }

  .form-grid,
  .form-grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid--3 > .field:not(.field--span) {
    grid-column: 1 / -1;
  }

  .group-card__head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0.95rem 1rem;
    gap: 0.65rem;
  }

  .group-card__badge {
    grid-column: 2;
    justify-self: start;
  }

  .group-card__body {
    padding: 1rem;
  }

  .group-card__tools-hint {
    display: none;
  }

  .table-wrap {
    border: 0;
    overflow: visible;
  }

  .table {
    min-width: 0;
    display: block;
  }

  .table thead {
    display: none;
  }

  .table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }

  .table tr {
    display: block;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    background: var(--paper);
  }

  .table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.35rem 0;
    border-top: 0;
    text-align: right;
  }

  .table td::before {
    content: attr(data-label);
    flex: none;
    font-size: 0.5625rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
  }

  .table td .cell-main {
    justify-content: flex-end;
    text-align: left;
  }

  .table td .cell-stack {
    align-items: flex-end;
  }

  .table td:first-child {
    padding-top: 0;
  }

  .table td:last-child {
    padding-bottom: 0;
    margin-top: 0.35rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--line-soft);
    justify-content: flex-end;
  }

  .table td:last-child::before {
    display: none;
  }

  .row-actions {
    flex-wrap: wrap;
  }

  .table td .row-actions {
    margin-left: 0;
  }

  .modal-overlay {
    padding: 0;
  }

  .modal {
    max-width: none;
    min-height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .modal__head,
  .modal__body {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .modal__foot {
    position: sticky;
    bottom: 0;
    border-radius: 0;
    padding: 0.9rem 1.15rem;
  }

  .content-toolbar {
    position: static;
    background: none;
    backdrop-filter: none;
    margin-top: 0;
  }

  .content-toolbar__actions {
    width: 100%;
  }

  .content-toolbar__actions .btn {
    flex: 1 1 auto;
  }

  .payment-actions__status {
    margin-left: 0;
    width: 100%;
  }

  .toasts {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    width: auto;
  }

  .cell-stack strong {
    max-width: 20ch;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .login__card {
    padding: 1.6rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .topbar {
    padding: 0.8rem 1rem;
  }

  .topbar__eyebrow {
    display: none;
  }

  .topbar__actions .btn {
    padding-inline: 0.9rem;
  }

  .content {
    padding-inline: 1rem;
  }

  .card {
    padding: 1rem;
  }

  .topbar__title {
    font-size: 1.35rem;
  }

  .group-card__num {
    display: none;
  }

  .group-card__head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .group-card__badge {
    grid-column: 1;
  }

  .modal__head,
  .modal__body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .modal__foot {
    padding: 0.85rem 1rem;
  }

  .modal__foot .btn {
    flex: 1 1 auto;
  }

  .image-field__row {
    flex-direction: column;
  }

  .image-preview {
    width: 100%;
    height: 130px;
  }

  .image-preview--lg {
    width: 100%;
    height: 150px;
  }

  .color-field {
    flex-wrap: wrap;
  }

  .color-field input[type="color"] {
    width: 100%;
  }

  .cell-stack strong {
    max-width: 15ch;
  }
}

/* Reduz animações quando o sistema pede ------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .view,
  .modal,
  .modal-overlay,
  .toast,
  .scrim {
    animation: none;
  }

  .skeleton {
    animation: none;
  }
}

/* Ajustes: atalhos da visao geral e filtros compactos */
.quick-link__label {
  display: block;
  color: var(--ink-2);
}

.quick-link__hint {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.toolbar > select.input {
  flex: 0 1 240px;
  max-width: 260px;
  min-height: 40px;
  font-size: var(--fs-sm);
}

/* ==========================================================================
   Mensagens, presenças e e-mails (entregas novas)
   ========================================================================== */

/* Contador de mensagens não lidas na sidebar --------------------------------- */

.nav-item__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item__badge {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  background: #fbf1e2;
  color: #8c6733;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* Inbox de mensagens -------------------------------------------------------- */

.messages-rows {
  padding: 0 1.25rem 1.25rem;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.message-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--paper);
  transition: border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}

.message-card.is-unread {
  border-color: var(--sage-300);
  background: linear-gradient(180deg, var(--sage-50), var(--paper) 58%);
  box-shadow: inset 3px 0 0 var(--sage-500);
}

.message-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem 1rem;
}

.message-card__who {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.message-card__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
}

.message-card__email {
  color: var(--muted);
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
}

.message-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.message-card__date {
  color: var(--muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.message-card__text {
  color: var(--ink-2);
  font-size: var(--fs-sm);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line-soft);
}

.message-card__state {
  margin-right: auto;
  color: var(--muted);
  font-size: var(--fs-xs);
}

/* Presenças ---------------------------------------------------------------- */

.table .cell-message {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 34ch;
  color: var(--ink-2);
  font-size: var(--fs-xs);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.table td .cell-error {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--danger);
  font-size: var(--fs-xs);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* E-mails (Resend) ---------------------------------------------------------- */

.email-log .table-wrap {
  border-top: 1px solid var(--line-soft);
}

.email-log .state-card {
  margin: 0 1.25rem 1.25rem;
}

/* Responsivo até 360px ------------------------------------------------------ */

@media (max-width: 760px) {
  .messages-rows {
    padding: 0 0.9rem 1rem;
  }

  .message-card {
    padding: 0.9rem;
  }

  .message-card__actions {
    justify-content: flex-start;
  }

  .message-card__state {
    width: 100%;
  }

  .email-log .state-card {
    margin: 0 1rem 1rem;
  }
}

@media (max-width: 480px) {
  .messages-rows {
    padding: 0 0.85rem 0.9rem;
  }

  .message-card__name {
    font-size: 1.1rem;
  }

  .table .cell-message {
    max-width: 22ch;
  }

  .nav-item__badge {
    height: 18px;
    min-width: 18px;
    font-size: 0.625rem;
  }
}

/* ==========================================================================
   Convidados (convites com código, membros e confirmações)
   ========================================================================== */

/* Cinco indicadores: uma linha no desktop e colunas no mobile ---------------- */

.stats--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (min-width: 761px) and (max-width: 1180px) {
  .stats--5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .stats--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .stats--5 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A tabela de convites precisa de espaço para as 6 colunas ---------------- */

.invitations-rows .table {
  min-width: 860px;
}

/* Respiro entre um alerta e o formulário dentro dos modais ------------------ */

.modal__body > .alert {
  margin-bottom: 1rem;
}

/* Separa o estado vazio do restante do conteúdo no modal de resposta -------- */

.modal__body > .state-card + .modal-section {
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
}

/* Lista -------------------------------------------------------------------- */

.invitations-rows .state-card {
  margin: 0 1.25rem 1.25rem;
}

.invite-code-cell {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.invite-code {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--cream-2);
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* Nota de transição exibida em Presenças ----------------------------------- */

.invitation-note {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.invitation-note__text {
  flex: 1 1 260px;
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.invitation-note .btn {
  flex: none;
}

/* Formulário --------------------------------------------------------------- */

.invite-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.invite-code-row .input {
  flex: 1 1 150px;
  max-width: 190px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invite-code-row .btn {
  flex: none;
}

/* Lista dinâmica de pessoas do convite */

.member-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.member-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.member-row.is-invalid {
  border-color: #c78a82;
  background: #fdf7f5;
}

.member-row__num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cream-3);
  color: var(--ink-3);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.member-row .input {
  min-height: 38px;
  font-size: var(--fs-sm);
}

.member-row__flags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.member-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  background: var(--cream-2);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.member-flag:hover {
  border-color: var(--sage-300);
}

.member-flag input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--sage-600);
  cursor: pointer;
}

.member-flag.is-checked {
  background: var(--sage-100);
  border-color: var(--sage-300);
  color: var(--sage-900);
}

.member-row__remove {
  justify-self: end;
}

.member-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.member-count {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

/* Detalhes da resposta ------------------------------------------------------ */

.attendee-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.attendee {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: var(--fs-sm);
}

.attendee__name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.attendee__tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.attendee__tags .pill {
  font-size: 0.5625rem;
}

.response-message {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--cream-2);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Responsivo até 360px ------------------------------------------------------ */

@media (max-width: 760px) {
  .invitations-rows {
    padding: 0 0.9rem 1rem;
  }

  /* No mobile a tabela vira cards, então não precisa de largura mínima. */
  .invitations-rows .table {
    min-width: 0;
  }

  .invitations-rows .table-wrap {
    border-top: 0;
  }

  .invitations-rows .state-card {
    margin: 0;
  }

  .invite-code-cell {
    justify-content: flex-end;
  }

  .member-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "num name remove"
      "num flags flags";
    row-gap: 0.45rem;
    align-items: start;
  }

  .member-row__num {
    grid-area: num;
    margin-top: 0.35rem;
  }

  .member-row__name {
    grid-area: name;
  }

  .member-row__flags {
    grid-area: flags;
  }

  .member-row__remove {
    grid-area: remove;
    margin-top: 0.15rem;
  }
}

@media (max-width: 480px) {
  .invitations-rows {
    padding: 0 0.85rem 0.9rem;
  }

  .invite-code-row .input {
    flex: 1 1 100%;
    max-width: none;
  }

  .invite-code-row .btn {
    flex: 1 1 auto;
  }

  .invitation-note {
    align-items: flex-start;
  }

  .invitation-note .btn {
    flex: 1 1 100%;
  }

  .member-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name remove"
      "flags flags";
    padding: 0.55rem;
  }

  .member-row__num {
    display: none;
  }

  .member-row .input {
    min-height: 40px;
  }

  .attendee {
    flex-wrap: wrap;
  }

  .attendee__tags {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .invitations-rows {
    padding: 0 0.75rem 0.85rem;
  }

  .member-flag {
    padding: 0.32rem 0.5rem;
  }
}
