/* Tahap 3: tata letak, navigasi, kartu, tombol, dan formulir.
   Dirancang untuk HP dulu (iPhone dan Android), lalu melebar untuk layar besar. */

/* Header dan navigasi */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  padding-top: calc(0.75rem + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-family: var(--font-baca);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.nav { display: flex; gap: 0.25rem; }
.nav a {
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
}
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }

/* Halaman */
main { max-width: 46rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; }

/* Di HP: navigasi pindah ke bawah, mudah dijangkau ibu jari */
@media (max-width: 899px) {
  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
  }
  .nav a { flex: 1; border-radius: 12px; }
  main { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
}

/* Kartu menu */
.menu-grid { display: grid; gap: 0.75rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
@media (min-width: 600px) { .menu-grid { grid-template-columns: 1fr 1fr; } }
.kartu {
  display: block;
  min-height: 44px;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}
.kartu strong { display: block; font-family: var(--font-baca); font-size: 1.1rem; margin-bottom: 0.15rem; }
.kartu span { color: var(--muted); font-size: 0.95rem; }

/* Catatan dan keadaan kosong */
.catatan {
  background: var(--sand);
  color: var(--sand-text);
  border: 1px solid #e3d4a6;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.kosong {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.sub { color: var(--muted); }

/* Tombol */
.btn {
  font: inherit;
  min-height: 48px;
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.btn-ghost { background: transparent; color: var(--accent-strong); }
.btn-pending {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  flex-direction: column;
  line-height: 1.25;
}
.btn-pending small { font-size: 0.75rem; }
.aksi { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Formulir (huruf 16px agar iPhone tidak memperbesar layar saat mengetik) */
.field { margin-bottom: 1.1rem; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 0.25rem; padding: 0; }
.field fieldset { border: 0; margin: 0; padding: 0; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.35rem; }
input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 6rem; resize: vertical; }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
.field label.pilihan { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 400; margin-bottom: 0; }
.pilihan input { width: 1.25rem; height: 1.25rem; flex: none; }

/* Pesan kesalahan formulir (kosong = tersembunyi) */
.pesan {
  background: var(--rose);
  color: var(--rose-text);
  border: 1px solid #e3c3b8;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 1rem 0 0;
  font-weight: 600;
}
.pesan:empty { display: none; }

/* Data awal proyek */
.ringkas { margin: 0 0 1.25rem; }
.ringkas dt { font-weight: 600; margin-top: 0.9rem; }
.ringkas dd { margin: 0.15rem 0 0; }
.nilai { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Lencana status bab */
.lencana {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-belum_dibuat { background: var(--surface-2); color: var(--muted); }
.status-sedang_diproses { background: var(--sky); color: var(--sky-text); }
.status-berhasil_dibuat { background: var(--sage); color: var(--sage-text); }
.status-gagal { background: var(--rose); color: var(--rose-text); }
.status-menunggu_dilanjutkan { background: var(--sand); color: var(--sand-text); }
