/* SayInvite Admin — dasar dan komponen */

:root {
  font-family: system-ui,sans-serif;
  color: #2e3038;
  background: #f7f6f2;
  --accent: #793f25;
  --line: #e8e5dd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

header {
  padding: 16px max(24px,calc((100vw - 1240px)/2));
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

header img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 14px;
}

small {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-left: 8px;
}

main {
  max-width: 1288px;
  padding: 40px 24px;
  margin: auto;
}

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

.eyebrow {
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

h1 {
  font-family: Georgia,serif;
  font-size: 40px;
  font-weight: 400;
  margin: 10px 0;
}

p {
  color: #777870;
  font-size: 14px;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: white;
  padding: 11px 16px;
  font: 600 13px system-ui;
  cursor: pointer;
}

button:disabled {
  opacity: .45;
  cursor: default;
}

.secondary {
  background: #eeece6;
  color: #594c3f;
}

.danger {
  color: #ac3544;
  background: #fff0f0;
}

input, select {
  font: 14px system-ui;
  padding: 11px;
  border: 1px solid #dcd9d0;
  border-radius: 7px;
  width: 100%;
  background: white;
  min-height: 44px;
}

input:focus, select:focus {
  outline: 2px solid #c8b49b;
  outline-offset: 2px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 18px;
  margin: 24px 0;
}

.stats article {
  background: white;
  border: 1px solid var(--line);
  padding: 22px;
  border-radius: 10px;
  color: #777870;
  font-size: 13px;
}

.stats b {
  display: block;
  color: #34352e;
  font-size: 31px;
  margin-top: 8px;
}

.layout {
  display: grid;
  grid-template-columns: 290px minmax(0,1fr);
  gap: 22px;
}

aside, .panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
}

aside {
  padding: 20px;
}

h2 {
  font-size: 18px;
  margin: 0 0 16px;
}

.event {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-top: 12px;
  padding: 12px;
}

.event.active {
  background: #f4efe7;
  border-color: #b39a7e;
}

.pick {
  display: block;
  text-align: left;
  width: 100%;
  background: transparent;
  color: #36372e;
  padding: 0 0 10px;
}

.pick small {
  display: block;
  letter-spacing: 0;
  margin: 6px 0 0;
  color: #fff;
  font-weight: 400;
  opacity: .9;
}

.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.actions button {
  padding: 9px 12px;
  font-size: 12px;
  min-height: 44px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel>.section-head {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
}

.section-head p {
  margin: 0 0 6px;
}

.toolbar {
  padding: 16px 22px;
  display: flex;
  gap: 10px;
}

.toolbar select {
  max-width: 155px;
}

.toolbar button {
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 650px;
}

th, td {
  text-align: left;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

th {
  background: #faf9f6;
  color: #787870;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.badge {
  display: inline-block;
  border-radius: 20px;
  padding: 5px 9px;
  background: #eeece6;
}

.hadir {
  background: #e6f2e7;
  color: #34653d;
}

.tidak {
  background: #fbe8e8;
  color: #9e3c3c;
}

.empty {
  text-align: center;
  color: #888;
  padding: 45px 15px;
}

dialog {
  border: 0;
  border-radius: 12px;
  width: min(480px,calc(100% - 32px));
  padding: 26px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

dialog::backdrop {
  background: #25221d80;
}

label {
  display: block;
  font-size: 13px;
  margin: 17px 0 6px;
}

label input, label select {
  margin-top: 7px;
}

#formError {
  color: #a43141;
}

#notice.error {
  background: #ffeded;
  padding: 14px;
  color: #9e3030;
}

@media (max-width:850px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: flex-start;
  }

  h1 {
    font-size: 30px;
  }

  .stats {
    gap: 8px;
  }

  .stats article {
    padding: 14px;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .toolbar input {
    flex-basis: 100%;
  }

  main {
    padding: 24px 14px;
  }

  .section-head {
    flex-wrap: wrap;
  }
}

@media (max-width:450px) {
  .hero {
    display: block;
  }

  .hero>button {
    margin-top: 12px;
  }

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

  .stats article {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .stats b {
    margin: 0;
    font-size: 24px;
  }
}

button, button.secondary, button.danger, button.pick {
  background: #793f25;
  color: #fff;
  min-height: 44px;
  transition: background-color .18s ease;
}

button:not(:disabled):hover, button.secondary:not(:disabled):hover, button.danger:not(:disabled):hover, button.pick:not(:disabled):hover {
  background: #60301c;
}

button:focus-visible {
  outline: 3px solid #cda58f;
  outline-offset: 3px;
}

button.pick {
  padding: 12px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.layout>* {
  min-width: 0;
}

.section-head>div {
  min-width: 0;
}

h2, #eventDetails {
  overflow-wrap: anywhere;
}

@media (min-width:701px) and (max-width:1100px) {
  main {
    padding: 30px 20px;
  }

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

  #events {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px;
  }

  .event {
    margin-top: 0;
  }

  aside>input {
    margin-bottom: 12px;
  }

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

  .toolbar {
    display: grid;
    grid-template-columns: minmax(0,1fr) 160px auto;
  }

  .toolbar select {
    max-width: none;
  }
}

@media (max-width:700px) {
  header {
    padding: 14px 16px;
    gap: 12px;
  }

  header a {
    gap: 8px;
  }

  header small {
    display: block;
    margin: 3px 0 0;
  }

  main {
    padding: 22px 14px;
  }

  .hero {
    display: block;
  }

  .hero>button {
    width: 100%;
    margin-top: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stats article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
  }

  .stats b {
    margin: 0;
    font-size: 25px;
  }

  .panel>.section-head {
    padding: 18px;
    align-items: stretch;
    flex-direction: column;
  }

  .section-head>button {
    width: 100%;
  }

  .toolbar {
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toolbar input {
    grid-column: 1/-1;
  }

  .toolbar select {
    max-width: none;
    min-width: 0;
  }

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

  thead {
    display: none;
  }

  tbody {
    display: block;
    padding: 0 18px 18px;
  }

  tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 14px;
    margin-bottom: 12px;
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
  }

  td::before {
    font-size: 12px;
    color: #777870;
    flex-shrink: 0;
  }

  td:nth-child(1)::before {
    content: 'Nama tamu';
  }

  td:nth-child(2)::before {
    content: 'WhatsApp';
  }

  td:nth-child(3)::before {
    content: 'Jumlah';
  }

  td:nth-child(4)::before {
    content: 'RSVP';
  }

  td:last-child {
    border-bottom: 0;
    justify-content: flex-end;
  }

  td.empty {
    display: block;
    padding: 24px 0;
  }

  td.empty::before {
    content: none;
  }

  .actions {
    gap: 10px;
  }

  dialog {
    padding: 20px;
    width: calc(100% - 24px);
  }

  dialog .section-head {
    flex-wrap: nowrap;
  }

  dialog .section-head>button {
    width: auto;
  }

  input, select {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion:reduce) {
  button {
    transition: none;
  }
}

