* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

body {
  margin: 0;
  background: #f6f0e7;
  color: #1f2430;
}

.hidden { display: none !important; }

.top-bar {
  background: #f6f0e7;
  padding: 12px 16px 4px;
}

.brand-pill {
  display: inline-block;
  background: #1f2430;
  color: #f6f0e7;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.top-links {
  margin-top: 4px;
  font-size: 13px;
  color: #6b7280;
}

.top-links span + span::before { content: " · "; }

.tabs {
  display: flex;
  gap: 8px;
  padding: 8px 12px 4px;
  align-items: center;
  flex-wrap: wrap;
}

.tab-button {
  flex: 0 0 auto;
  border-radius: 999px;
  border: none;
  padding: 8px 18px;
  background: #e3d7c5;
  color: #1f2430;
  font-weight: 500;
  cursor: pointer;
}

.tab-button.active {
  background: #1f2430;
  color: #f6f0e7;
}

main { padding: 8px 12px 80px; }
.tab { display: none; }
.tab.active { display: block; }
h2 { margin-top: 8px; }

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

button.primary{
  margin-left:auto;
  border-radius: 999px;
  border: none;
  padding: 8px 18px;
  background: #111827;
  color: #f6f0e7;
  font-weight: 800;
  cursor: pointer;
}

button.secondary{
  border-radius: 999px;
  border: none;
  padding: 8px 14px;
  background: #1f2937;
  color: #f9fafb;
  font-size: 14px;
  cursor: pointer;
}

.history-search { margin: 8px 0 10px; }
.history-search input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 10px 12px;
  font-size: 14px;
  background: #fbf7f0;
}

/* Cards */
.ceremony-card {
  background: #fbf7f0;
  border-radius: 18px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  border: 2px solid transparent;
}

.ceremony-card.cancelled{
  opacity: 0.7;
  border-color: #fca5a5;
}

.ceremony-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  gap: 10px;
}

.ceremony-name {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.15;
}

.ceremony-date {
  font-size: 13px;
  color: #4b5563;
  white-space: nowrap;
}

.ceremony-place {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 6px;
}

.ceremony-row {
  font-size: 13px;
  margin-bottom: 2px;
}

.ceremony-label { font-weight: 700; }

/* Actions row */
.card-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:10px;
  flex-wrap: wrap;
}

.btn-edit{
  border-radius:999px;
  padding:6px 14px;
  border:none;
  font-size:13px;
  cursor:pointer;
  background:#1f2937;
  color:#f9fafb;
  font-weight:800;
}

.btn-cancel{
  border-radius:999px;
  padding:6px 14px;
  border:none;
  font-size:13px;
  cursor:pointer;
  background:#fef2f2;
  color:#b91c1c;
  font-weight:900;
}

.btn-wa{
  width:36px;
  height:36px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}

.btn-wa svg{
  width:18px;
  height:18px;
  fill:#fff;
}

.btn-wa.supplier{ background:#2563eb; }
.btn-wa.delivery{ background:#16a34a; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.modal.hidden { display: none; }

.modal-content {
  background: #f9fafb;
  border-radius: 18px;
  padding: 16px 16px 12px;
  width: min(420px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 { margin-top:0; margin-bottom:8px; }

.form label{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:13px;
  margin-bottom:8px;
}

.form input, .form select, .form textarea{
  border-radius:10px;
  border:1px solid #d1d5db;
  padding:8px 10px;
  font-size:14px;
  background:#fff;
}

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

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

.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:8px;
}
.modal-actions button{
  border-radius:999px;
  border:none;
  padding:7px 14px;
  font-size:14px;
  cursor:pointer;
  font-weight:900;
}
#cancelModalBtn{
  background:#e5e7eb;
  color:#111827;
}
.modal-actions .primary{ background:#111827; color:#f9fafb; }

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  background: #111827;
  color: #e5e7eb;
}

/* Stats */
.stats-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width:520px){ .stats-grid{ grid-template-columns:1fr; } }

.stat-card{
  background:#fbf7f0;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:12px;
}
.stat-title{ font-size:12px; color:#6b7280; font-weight:800; }
.stat-value{ font-size:28px; font-weight:900; margin-top:4px; }

.stat-section{
  background:#fbf7f0;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:12px;
  margin-top:10px;
}
.stat-section h3{ margin:0 0 8px; font-size:14px; }