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

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

.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;
}

.new-ceremony {
  margin-left: auto;
  border-radius: 999px;
  border: none;
  padding: 8px 18px;
  background: #111827;
  color: #fefce8;
  font-weight: 600;
  cursor: pointer;
}

main {
  padding: 8px 12px 80px;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

h2 {
  margin-top: 8px;
}

/* Κάρτες τελετών */

.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);
}

/* Πράσινο πλαίσιο για σημερινές (και αυριανές μετά το δίωρο) */
.ceremony-card-today {
  border: 2px solid #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3);
}

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

.ceremony-name {
  font-weight: 700;
  font-size: 18px;
}

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

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

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

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

.card-buttons {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.card-buttons button {
  border-radius: 999px;
  padding: 6px 14px;
  border: none;
  font-size: 13px;
  cursor: pointer;
}

.card-buttons .edit {
  background: #1f2937;
  color: #f9fafb;
}

.card-buttons .delete {
  background: #fef2f2;
  color: #b91c1c;
}

/* WhatsApp κουμπί */

.card-buttons .wa-share {
  background: #22c55e;
  color: #022c22;
}

/* Warehouse */

.warehouse-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

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

.warehouse-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.warehouse-table th,
.warehouse-table td {
  padding: 6px 4px;
  border-bottom: 1px solid #e5e7eb;
}

.warehouse-table th {
  text-align: left;
  font-size: 13px;
  color: #4b5563;
}

.warehouse-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.warehouse-actions button {
  border-radius: 999px;
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.warehouse-actions .edit {
  background: #1f2937;
  color: #f9fafb;
}

.warehouse-actions .delete {
  background: #fef2f2;
  color: #b91c1c;
}

/* Έξυπνα χρώματα αποθήκης */

.warehouse-low {
  background: #ffe5e5 !important;     /* qty = 0 */
}

.warehouse-medium {
  background: #fff4d6 !important;     /* qty 1–2 */
}

.warehouse-good {
  background: #e8f9e8 !important;     /* qty >= 5 */
}

/* Γρήγορα κουμπιά + / - */

.fast-adjust {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.fast-adjust button {
  border-radius: 6px;
  border: none;
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  padding: 2px 8px;
  cursor: pointer;
}

.fast-adjust button.minus {
  background: #b91c1c;
}

/* 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;
}

#ceremonyForm label,
#warehouseForm label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  margin-bottom: 8px;
}

#ceremonyForm input,
#ceremonyForm select,
#ceremonyForm textarea,
#warehouseForm input {
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 8px 10px;
  font-size: 14px;
}

.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;
}

#cancelModalBtn,
#cancelWarehouseBtn,
#closeQrBtn {
  background: #e5e7eb;
}

#saveCeremonyBtn,
#saveWarehouseBtn {
  background: #111827;
  color: #f9fafb;
}

/* Τάφοι layout */

.grave-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 4px 0 6px;
}

.grave-option {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.grave-fields {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

/* Footer */

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

/* Πράσινο πλαίσιο για σημερινές / αυριανές (μετά το δίωρο) τελετές */
.ceremony-card.ceremony-today-highlight {
  border: 2px solid #16a34a;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.15),
    0 4px 10px rgba(15, 23, 42, 0.18);
}

/* WhatsApp κουμπί δίπλα σε Επεξεργασία / Διαγραφή */
.card-buttons .whatsapp {
  background: #22c55e;
  color: #022c22;
  font-weight: 600;
}