/* =========================================================
   Identidade visual — Mateus & Ana Vitória
   Verde-sálvia (natureza, calma) · Rosé terroso (afeto)
   Dourado champanhe (celebração) · Marfim (leveza)
   ========================================================= */
:root {
  --sage: #7A8B6F;
  --sage-dark: #4F5D47;
  --sage-soft: #E7ECE2;
  --rose: #C98B7A;
  --rose-soft: #F5E6E0;
  --gold: #B8975A;
  --gold-soft: #F3EBDD;
  --ivory: #FAF7F2;
  --paper: #FFFFFF;
  --ink: #2E2A26;
  --muted: #8A837B;
  --line: #ECE6DD;
  --danger: #B5574B;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Pinyon Script', 'Cormorant Garamond', cursive;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(46, 42, 38, .04), 0 8px 24px rgba(46, 42, 38, .06);
  --shadow-lg: 0 24px 60px rgba(46, 42, 38, .18);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; letter-spacing: .01em; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sage-dark); }

/* ---------- Monograma ---------- */
.monogram {
  --size: 56px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: var(--ivory);
  box-shadow: inset 0 0 0 1.5px var(--gold), inset 0 0 0 5px var(--ivory), inset 0 0 0 5.6px rgba(184,151,90,.45);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--sage-dark);
  flex-shrink: 0;
}
.monogram span { font-size: calc(var(--size) * .42); line-height: 1; letter-spacing: -.02em; }
.monogram em { font-size: calc(var(--size) * .22); color: var(--gold); margin: 0 .04em; position: relative; top: -.35em; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand-names { font-family: var(--font-display); font-size: 21px; line-height: 1.1; }
.brand-names small { display: block; font-family: var(--font-body); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* ---------- Layout admin ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  display: flex; flex-direction: column; gap: 32px;
  position: sticky; top: 0; height: 100vh;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  transition: .15s;
}
.nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav a:hover { background: var(--ivory); color: var(--ink); }
.nav a.active { background: var(--sage-soft); color: var(--sage-dark); }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--muted); text-align: center; }
.sidebar-foot .countdown-mini { font-family: var(--font-display); font-size: 28px; color: var(--sage-dark); display: block; }

.main { padding: 36px 44px 80px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 40px; line-height: 1; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 8px; }

/* ---------- Componentes ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { font-size: 22px; margin-bottom: 14px; }
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  background: var(--sage-dark); color: #fff;
  transition: .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: #3f4b39; }
.btn svg { width: 16px; height: 16px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--ivory); }
.btn-rose { background: var(--rose); }
.btn-rose:hover { background: #b87a69; }
.btn-gold { background: var(--gold); }
.btn-gold:hover { background: #a3844b; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; border-radius: 10px; background: transparent; color: var(--muted); border: none; }
.btn-icon:hover { background: var(--ivory); color: var(--ink); }
.btn-icon.danger:hover { color: var(--danger); background: var(--rose-soft); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--ivory); color: var(--muted); }
.chip-sage { background: var(--sage-soft); color: var(--sage-dark); }
.chip-rose { background: var(--rose-soft); color: #9a5c4c; }
.chip-gold { background: var(--gold-soft); color: #8a6d36; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi .label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font-family: var(--font-display); font-size: 40px; line-height: 1.1; margin-top: 8px; }
.kpi .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi .ic { position: absolute; right: 18px; top: 18px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.kpi .ic svg { width: 20px; height: 20px; }

.hero {
  background: linear-gradient(120deg, var(--sage-dark), #6b7d61 60%, var(--sage));
  color: #fff; border: none;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 30px 34px;
  position: relative; overflow: hidden;
}
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 0 0 26px rgba(255,255,255,.04); }
.hero h2 { font-family: var(--font-script); font-size: 46px; font-weight: 400; line-height: 1.1; }
.hero p { margin: 6px 0 0; opacity: .85; }
.countdown { display: flex; gap: 10px; position: relative; z-index: 1; }
.countdown div { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 10px 14px; text-align: center; min-width: 70px; }
.countdown b { display: block; font-family: var(--font-display); font-size: 32px; font-weight: 500; line-height: 1; }
.countdown small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }

/* barras */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row .bar-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.bar-row .bar-top b { font-weight: 700; }
.bar { height: 10px; border-radius: 99px; background: var(--ivory); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--sage); }
.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--ivory); }
.stack i { display: block; height: 100%; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* tabela */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fdfbf8; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }

/* toolbar */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search { flex: 1; min-width: 200px; position: relative; }
.search input { padding-left: 40px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--muted); }
.tabs { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tabs button { border: none; background: none; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--sage-soft); color: var(--sage-dark); }

/* grupos de convidados */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.group-card { display: flex; flex-direction: column; gap: 14px; }
.group-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.group-card h3 { margin: 0; font-size: 24px; }
.group-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.members li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.members li:last-child { border-bottom: none; }
.rsvp-btn { border: none; cursor: pointer; }
.group-card footer { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); padding-top: 14px; align-items: center; }
.group-card footer .spacer { flex: 1; }
.invite-status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* presentes */
.gift-settings { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.gifts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.gift-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: .2s; }
.gift-card.is-reserved .gift-img { filter: grayscale(.6); opacity: .75; }
.gift-img { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--gold-soft), var(--rose-soft)); display: grid; place-items: center; position: relative; overflow: hidden; }
.gift-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 10px; }
.gift-img .gift-ic { width: 46px; height: 46px; color: var(--gold); }
.gift-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gift-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.gift-body h3 { font-size: 22px; margin: 0; line-height: 1.15; }
.gift-price { font-weight: 700; color: var(--sage-dark); }
.gift-desc { margin: 0; font-size: 13px; }
.gift-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.gift-who { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13px; }
.gift-who li { display: flex; align-items: center; justify-content: space-between; padding: 2px 0; border-bottom: 1px dashed var(--line); }
.gift-who li:last-child { border-bottom: none; }
.gift-who .btn-icon { padding: 4px; }
.gift-who .btn-icon svg { width: 14px; height: 14px; }
.gift-link { font-size: 13px; font-weight: 600; margin-left: auto; }
.gift-preview img { max-height: 140px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }

/* formulário */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-soft); }
textarea { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.money-input { position: relative; }
.money-input span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.money-input input { padding-left: 38px; }
.member-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.check input { width: auto; accent-color: var(--sage-dark); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(46,42,38,.4); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .15s; }
.modal { background: var(--paper); border-radius: 22px; width: 100%; max-width: 580px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .2s; }
.modal header { padding: 24px 26px 0; display: flex; justify-content: space-between; align-items: center; }
.modal header h2 { font-size: 28px; }
.modal .body { padding: 20px 26px; }
.modal footer { padding: 0 26px 24px; display: flex; justify-content: flex-end; gap: 10px; }
/* diálogo de confirmação */
.confirm-bg { z-index: 60; }
.confirm-bg.closing { opacity: 0; transition: opacity .15s; }
.confirm-dialog { max-width: 400px; padding: 30px 28px 24px; text-align: center; }
.confirm-dialog h2 { font-size: 28px; line-height: 1.15; margin-bottom: 8px; overflow-wrap: anywhere; }
.confirm-dialog p { color: var(--muted); margin: 0 auto; font-size: 14px; max-width: 300px; }
.confirm-dialog p b { color: var(--ink); }
.confirm-ic {
  width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold);
  box-shadow: 0 0 0 8px rgba(243,235,221,.5);
}
.confirm-ic.danger { background: var(--rose-soft); color: var(--danger); box-shadow: 0 0 0 8px rgba(245,230,224,.5); }
.confirm-ic svg { width: 26px; height: 26px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #9c473c; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* link de convite */
.link-box { display: flex; gap: 8px; background: var(--ivory); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 14px; align-items: center; }
.link-box code { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sage-dark); }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.btn-whats { background: #25D366; }
.btn-whats:hover { background: #1fb457; }

/* vazio */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .monogram { margin: 0 auto 16px; --size: 72px; }
.empty h3 { color: var(--ink); font-size: 26px; margin-bottom: 6px; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 99; box-shadow: var(--shadow-lg); animation: pop .2s; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; z-index: 40;
    flex-direction: row; padding: 8px 10px; border-right: none; border-top: 1px solid var(--line);
  }
  .sidebar .brand, .sidebar-foot { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 3px; font-size: 9.5px; padding: 8px 2px; flex: 1; text-align: center; letter-spacing: -.01em; }
  .gift-settings { flex-direction: column; }
  .gifts-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .gift-body { padding: 12px; }
  .gift-body h3 { font-size: 18px; }
  .main { padding: 22px 16px 100px; }
  .page-head h1 { font-size: 32px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; padding: 24px; }
  .hero h2 { font-size: 36px; }
  .form-grid { grid-template-columns: 1fr; }
  .mobile-brand { display: flex !important; margin-bottom: 18px; }
  .groups { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { min-width: 0; }
  .tabs { overflow-x: auto; max-width: 100%; }
  .tabs button { flex-shrink: 0; }

  /* tabelas viram cartões no celular */
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 6px; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: none; }
  tbody td { padding: 0; border: none; text-align: left !important; }
  tbody td:first-child { grid-column: 1; }
  tbody td.num.strong { grid-column: 2; grid-row: 1; text-align: right !important; }
  tbody td:last-child { grid-column: 2; text-align: right !important; }
  tr:hover td { background: none; }
  tfoot { display: block; }
  tfoot tr { display: flex; justify-content: space-between; padding: 12px 6px; border-top: 1px solid var(--line); }
  tfoot td { display: block; padding: 0; width: auto; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 16px; }
  .kpi .value { font-size: 30px; }
  .kpi .ic { display: none; }
  .countdown div { min-width: 58px; padding: 8px 10px; }
  .countdown b { font-size: 26px; }
}
