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

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

.tab { display: none; }
.tab.active { display: block; }

h2 { margin-top: 8px; }

/* Helpers */
.tab-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.tab-head.small h3{ margin:0; }
.section-title{
  margin: 12px 0 8px;
  font-weight: 900;
  font-size: 14px;
  color: #111827;
}
.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 520px){
  .grid-2{ grid-template-columns:1fr; }
}

.primary{
  border-radius:999px;
  border:none;
  padding:8px 16px;
  background:#111827;
  color:#f6f0e7;
  font-weight:800;
  cursor:pointer;
}
.secondary{
  border-radius:999px;
  border:none;
  padding:8px 16px;
  background:#e5e7eb;
  color:#111827;
  font-weight:800;
  cursor:pointer;
}

/* Week divider */
.week-divider{
  margin: 10px 0 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.7);
  border: 1px solid #e6dccf;
  font-weight: 900;
  font-size: 12px;
  color: #1f2430;
}

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

/* Κάρτες τελετών */
.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-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; }

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

/* Warehouse */
.table-wrap{ overflow:auto; border-radius:16px; }
.table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
.table th, .table td{
  padding:8px 6px;
  border-bottom:1px solid #e5e7eb;
  vertical-align:middle;
  background: transparent;
}
.table th{
  text-align:left;
  font-size:13px;
  color:#4b5563;
}

.warehouse-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.warehouse-actions button {
  border-radius: 999px;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 800;
}
.warehouse-actions .edit { background:#1f2937; color:#f9fafb; }
.warehouse-actions .delete { background:#fef2f2; color:#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,
#setForm label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  margin-bottom: 8px;
}
#ceremonyForm input,
#ceremonyForm select,
#ceremonyForm textarea,
#warehouseForm input,
#warehouseForm select,
#setForm input,
#setForm select {
  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;
}

/* ✅ FIX: checkbox line */
.checkline{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:13px;
  font-weight:800;
  margin:10px 0;
}

/* =========================
   ΝΕΑ ΒΙΒΛΟΣ: WhatsApp icon δίπλα στο Edit
   ========================= */
.card-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:10px;
}
.btn-edit{
  border-radius:999px;
  padding:6px 14px;
  border:none;
  font-size:13px;
  cursor:pointer;
  background:#1f2937;
  color:#f9fafb;
  font-weight: 900;
}
.btn-delete{
  border-radius:999px;
  padding:6px 14px;
  border:none;
  font-size:13px;
  cursor:pointer;
  background:#fef2f2;
  color:#b91c1c;
  margin-left:auto;
  font-weight: 900;
}
.btn-whatsapp{
  width:36px;
  height:36px;
  border-radius:50%;
  background:#25d366;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}
.btn-whatsapp svg{
  width:18px;
  height:18px;
  fill:#fff;
}

/* FIX: ο JS βάζει green-frame */
.ceremony-card.green-frame{
  border-color:#16a34a;
}

/* =========================
   Ceremony V2: AUTO STATUS + MISSING ITEMS
   ========================= */
.auto-statusbar{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 12px;border-radius:14px;border:1px solid #e6dccf;
  background:rgba(255,255,255,0.7);margin:10px 0 10px;
}
.auto-pill{
  display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;
  font-size:12px;font-weight:900;border:1px solid #e6dccf;background:#fff;color:#1f2430;white-space:nowrap;
}
.auto-pill[data-state="ready"]{background:#dcfce7;color:#14532d;border-color:#86efac;}
.auto-pill[data-state="not_ready"]{background:#fee2e2;color:#7f1d1d;border-color:#fecaca;}
.auto-pill[data-state="warning"]{background:#ffedd5;color:#9a3412;border-color:#fdba74;}
.auto-meta{
  font-size:12px;color:#4b5563;font-weight:650;display:flex;align-items:center;gap:8px;
  flex-wrap:wrap;justify-content:flex-end;
}
.late-badge{
  display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;
  font-size:12px;font-weight:900;background:#fee2e2;color:#7f1d1d;border:1px solid #fecaca;
}
.missing-box{
  border-radius:16px;border:1px solid #fecaca;background:#fff1f2;padding:12px 12px 10px;margin:0 0 10px;
}
.missing-title{
  font-weight:900;font-size:13px;color:#7f1d1d;display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px;
}
.missing-list{display:flex;flex-direction:column;gap:8px;}
.missing-item{
  background:rgba(255,255,255,0.75);border:1px solid #e6dccf;border-radius:14px;padding:10px 10px 8px;
}
.missing-item .top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;}
.missing-item .label{font-weight:900;font-size:13px;color:#1f2430;}
.missing-item .owner{font-size:12px;color:#4b5563;font-weight:650;margin-top:2px;}
.missing-item .pressure{font-size:12px;font-weight:900;white-space:nowrap;color:#9a3412;}
.missing-item[data-sev="blocking"]{border-color:#fecaca;}
.missing-item[data-sev="important"]{border-color:#e6dccf;background:rgba(255,255,255,0.6);}
.missing-actions{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap;justify-content:flex-end;}
.missing-actions button{
  border-radius:999px;padding:6px 12px;border:none;font-size:12px;cursor:pointer;font-weight:900;
}
.btn-open{background:#111827;color:#f9fafb;}
.btn-ping{background:#22c55e;color:#052e16;}
.btn-ping.urgent{background:#ef4444;color:#fff;}