/* Warna dasar: mode terang */
:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --text: #1b2636;
  --muted: #647184;
  --border: #e2e7ed;
  --accent: #23594d;
  --accent-soft: #eaf3ef;
  --accent-text: #ffffff;
  --badge-bg: #edf1f5;
  --shadow: 0 12px 32px rgba(23, 37, 54, 0.04);
}

/* Nilai warna pengganti saat mode gelap aktif */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11161d;
  --surface: #19212b;
  --surface-soft: #1d2733;
  --text: #edf2f7;
  --muted: #a4afbe;
  --border: #303c4b;
  --accent: #a2d8c2;
  --accent-soft: #243d35;
  --accent-text: #12271e;
  --badge-bg: #2b3645;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
.table-wrap:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 32px 22px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 13px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 22px;
}

.brand small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
}

.nav-label,
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
}

.nav-label {
  margin: 45px 12px 14px;
}

.navigation {
  display: grid;
  gap: 7px;
}

.nav-link {
  padding: 12px 15px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.nav-link:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 32px;
  overflow-wrap: anywhere;
}

.sidebar-bottom p,
.sidebar-bottom span {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-bottom strong {
  display: block;
  margin: 5px 0;
  font-size: 14px;
}

.sidebar-bottom form {
  margin-top: 18px;
}

.sidebar-bottom button,
.theme-button,
.page-links a {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.sidebar-bottom button {
  width: 100%;
}

/* Isi dashboard */
.main-content {
  width: 100%;
  max-width: 1440px;
  min-width: 0;
  margin: 0 auto;
  padding: 28px 42px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.topbar p {
  margin: 0;
}

.topbar-title {
  font-size: 14px;
  font-weight: 600;
}

.theme-button:hover,
.page-links a:hover {
  background: var(--surface-soft);
}

.welcome {
  padding: 40px 0 30px;
}

h1 {
  margin: 8px 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.2;
  letter-spacing: -1.2px;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
  padding: 11px 17px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card,
.panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 24px;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.stat-card strong {
  display: block;
  margin: 12px 0 6px;
  font-size: 38px;
  line-height: 1.2;
  letter-spacing: -1px;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

/* Tabel akun */
.panel {
  overflow: hidden;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

h2 {
  margin: 0;
  font-size: 18px;
}

.panel-heading p {
  margin: 5px 0 0;
  font-size: 13px;
}

.count-label {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

th,
td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

td {
  white-space: nowrap;
}

.account-name {
  font-weight: 600;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.badge-admin {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-user {
  background: var(--badge-bg);
  color: var(--text);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px 24px;
  color: var(--muted);
  font-size: 13px;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer {
  padding: 28px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

/* Tampilan tablet dan HP */
@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-label {
    margin: 24px 0 10px;
  }

  .navigation {
    display: flex;
    flex-wrap: wrap;
  }

  .sidebar-bottom {
    padding-top: 20px;
  }

  .sidebar-bottom button {
    width: auto;
  }

  .main-content {
    padding: 24px;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 20px 16px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .panel-heading {
    padding: 20px;
  }
}

/* =====================================
   Halaman RSVP
   ===================================== */

.rsvp-list {
  display: grid;
  gap: 14px;
  padding: 0 24px 24px;
}

.rsvp-entry {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.rsvp-entry-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.rsvp-person {
  min-width: 0;
}

.rsvp-person h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.rsvp-person time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.rsvp-entry-heading .badge {
  flex-shrink: 0;
}

.rsvp-attending {
  background: var(--accent-soft);
  color: var(--accent);
}

.rsvp-absent {
  background: var(--badge-bg);
  color: var(--muted);
}

.rsvp-message {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;

  /* Mempertahankan baris baru dalam ucapan tamu. */
  white-space: pre-wrap;

  /* Mencegah teks panjang merusak lebar kartu. */
  overflow-wrap: anywhere;
}

.rsvp-empty {
  padding: 48px 24px;
  text-align: center;
}

.rsvp-empty-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 26px;
}

.rsvp-empty h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.rsvp-empty p {
  max-width: 380px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 14px;
}

.rsvp-count-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 600px) {
  .rsvp-list {
    padding: 0 16px 16px;
  }

  .rsvp-entry {
    padding: 18px;
  }

  .rsvp-entry-heading {
    flex-direction: column;
    gap: 12px;
  }
}
