:root {
  --bg: #e8f0eb;
  --bg-accent: #d3e4d8;
  --surface: #f7fbf8;
  --ink: #14241c;
  --muted: #4d6357;
  --brand: #0f3d2e;
  --brand-2: #1f6b4f;
  --accent: #c45c26;
  --accent-soft: #f3e0d2;
  --line: #b7cfc2;
  --ok: #1b6b3a;
  --ok-bg: #dbf0e3;
  --err: #8f1f1f;
  --err-bg: #f8e0e0;
  --danger: #9b2c2c;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(15, 61, 46, 0.08);
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --max: 720px;
  --max-admin: 960px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #cfe4d6 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #f0d8c4 0%, transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
  line-height: 1.5;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  max-width: var(--max-admin);
  width: 100%;
  margin: 0 auto;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-link {
  color: var(--brand-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.nav-link:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}

#admin-panel .main,
body:has(#admin-panel:not([hidden])) .main {
  max-width: var(--max-admin);
}

.main:has(#admin-panel:not([hidden])) {
  max-width: var(--max-admin);
}

.hero-block {
  margin: 0.5rem 0 1.25rem;
}

.hero-block h1,
.gate h1,
.section h2 {
  font-family: var(--display);
  letter-spacing: -0.03em;
  margin: 0 0 0.4rem;
  color: var(--brand);
}

.hero-block h1 {
  font-size: clamp(1.85rem, 5vw, 2.4rem);
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 36ch;
}

.admin-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.field {
  margin-bottom: 1rem;
}

.field label,
.waktu-group legend {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--brand);
}

input[type="text"],
input[type="date"],
input[type="month"],
input[type="password"],
select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

input[readonly] {
  background: #eef5f0;
  color: var(--muted);
}

.hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.hint code {
  background: var(--accent-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.waktu-group {
  border: 0;
  margin: 0 0 1.25rem;
  padding: 0;
}

.waktu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.waktu-option {
  cursor: pointer;
}

.waktu-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.waktu-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.waktu-option input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.waktu-option input:focus-visible + span {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-2);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--line);
}

.btn-danger {
  background: var(--accent-soft);
  color: var(--danger);
  border: 1px solid #e8c4b0;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.alert-success {
  background: var(--ok-bg);
  color: var(--ok);
}

.alert-error {
  background: var(--err-bg);
  color: var(--err);
}

.hasil {
  background: #eef5f0;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.hasil p {
  margin: 0.2rem 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.section {
  margin-top: 1.75rem;
}

.section h2 {
  font-size: 1.25rem;
}

.list-feed .item,
.plain-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.list-feed .item:last-child,
.plain-list li:last-child {
  border-bottom: 0;
}

.plain-list,
.pct-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.35rem 1rem;
}

.plain-list li span,
.list-feed time,
.plain-list time {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}

.empty {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 0.5rem 0;
  list-style: none;
}

.filters .filter-row {
  display: grid;
  gap: 0.75rem;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-actions .btn-primary {
  width: auto;
  flex: 1;
  min-width: 140px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin: 1.25rem 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.admin-grid {
  display: grid;
  gap: 0.5rem;
}

.pct-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  display: block;
}

.pct-list li:last-child {
  border-bottom: 0;
}

.pct-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.pct-head span {
  color: var(--muted);
  font-size: 0.85rem;
}

.bar {
  height: 8px;
  background: #e2ece6;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-2), var(--accent));
  border-radius: 999px;
  min-width: 0;
  transition: width 0.3s ease;
}

.detail-list .meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.footer {
  text-align: center;
  padding: 1rem 1.25rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer p {
  margin: 0;
}

.gate .btn-primary {
  margin-top: 0.25rem;
}

@media (min-width: 640px) {
  .waktu-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stats {
    grid-template-columns: repeat(5, 1fr);
  }

  .filters .filter-row {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .admin-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section-wide {
    grid-column: 1 / -1;
  }

  .filter-actions .btn-primary {
    width: auto;
    flex: 0;
  }
}

@media (max-width: 380px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1;
  }
}
