/* ══════════════════════════════════════════════════════
   Croqui de Festas — Design System
   ══════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
body { background: #f4f6f9; }

/* ── Lucide icons ──────────────────────────────────── */
i[data-lucide] { display: inline-block; vertical-align: middle; }

/* ── Layout shell ──────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.app-header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.header-cal-icon {
  width: 18px; height: 18px;
  color: #3b82f6;
  flex-shrink: 0;
}
.header-event-info { min-width: 0; }
.header-event-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.header-event-meta {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.app-main {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 88px;
  min-height: calc(100dvh - 57px);
}

/* ── Bottom nav ────────────────────────────────────── */
.app-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.97);
  border-top: 1px solid #e5e7eb;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.app-nav-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 0 11px;
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.15s;
}
.nav-item--active { color: #3b82f6; }
.nav-icon { width: 20px; height: 20px; }
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: 0.01em; }

/* ── Page sections ─────────────────────────────────── */
.page-content { padding: 20px 16px 8px; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.page-header-simple { margin-bottom: 20px; }

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-subtitle {
  font-size: 13px;
  color: #9ca3af;
  margin: 2px 0 0;
}

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: white;
  border-radius: 16px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  overflow: hidden;
}
.card-danger { border-color: #fee2e2; }
.card-body { padding: 16px; }

.card-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.card-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.card-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}
.card-section-sub {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
}

/* ── Stat cards ────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  border-radius: 14px;
  padding: 14px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  border: 1px solid #f1f5f9;
  text-align: center;
}

/* ── Buttons ───────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary:active { transform: scale(0.96); opacity: 0.9; }

.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-success:active { transform: scale(0.96); }

.btn-success-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  background: #f0fdf4;
  color: #16a34a;
  border: 1.5px solid #bbf7d0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-success-outline:active { transform: scale(0.96); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 18px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-danger:active { transform: scale(0.96); }

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  background: #fef2f2;
  color: #ef4444;
  border: 1.5px solid #fecaca;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-danger-outline:active { transform: scale(0.96); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn-ghost:active { transform: scale(0.96); }

.btn-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.btn-switch:active { opacity: 0.7; }

.btn-icon { width: 15px; height: 15px; }
.w-full { width: 100%; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mt-1 { margin-top: 4px; }

/* ── Forms ─────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 11px;
  font-size: 14px;
  color: #111827;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
  background: white;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  accent-color: #3b82f6;
}
.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(59,130,246,0.4);
}

.field-textarea {
  width: 100%;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 11px;
  font-size: 13px;
  color: #111827;
  outline: none;
  resize: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.field-textarea:focus {
  border-color: #3b82f6;
  background: white;
}

/* ── Forma buttons (mesa shape) ────────────────────── */
.forma-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.forma-btn {
  padding: 11px 4px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: white;
  color: #4b5563;
  border: 2px solid #e5e7eb;
  transition: all 0.15s;
}
.forma-btn--active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* ── Search ────────────────────────────────────────── */
.search-wrap {
  position: relative;
  margin-bottom: 16px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: #9ca3af;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  font-size: 14px;
  color: #111827;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ── View toggle ───────────────────────────────────── */
.view-toggle {
  display: flex;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}
.view-btn {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #9ca3af;
  transition: all 0.15s;
}
.view-btn.active {
  background: white;
  color: #111827;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ── Badges ────────────────────────────────────────── */
.badge-blue {
  padding: 2px 9px;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

/* ── Modal system ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  background: white;
  border-radius: 20px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.22);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid #f1f5f9;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}
.modal-sub {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px 22px;
  border-top: 1px solid #f1f5f9;
}

/* ── Occ bar ───────────────────────────────────────── */
.occ-bar { transition: width 0.4s ease; }
#panelRing { transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease; }

/* ── Accordion chevrons ────────────────────────────── */
[id^="chv-"] { transition: transform 0.2s ease; }

/* ── Guest row ─────────────────────────────────────── */
.guest-row { transition: background 0.1s; }
.guest-row:active { background: #f9fafb; }

/* ── Map ───────────────────────────────────────────── */
#mapaCanvas [data-mesa-id],
#fsCanvas   [data-mesa-id] { will-change: left, top; }
#mapaCanvas [data-mesa-id]:hover > div,
#fsCanvas   [data-mesa-id]:hover > div {
  box-shadow: 0 6px 20px rgba(0,0,0,0.16) !important;
  border-color: #3b82f6 !important;
}

/* Zoom controls */
.zoom-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.zoom-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  background: #f3f4f6;
  color: #374151;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s, transform 0.1s;
  line-height: 1;
}
.zoom-btn:active { transform: scale(0.9); background: #e5e7eb; }
.zoom-label {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  min-width: 40px;
  text-align: center;
}

/* ── Assign dropdown ───────────────────────────────── */
#assignDropdown { border-radius: 14px; }

/* ── Scrollbars ────────────────────────────────────── */
::-webkit-scrollbar        { width: 4px; height: 4px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #d1d5db; border-radius: 2px; }

/* ── Animations ────────────────────────────────────── */
.animate-spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ──────────────────────────────────────────── */
.text-blue-500 { color: #3b82f6; }
.font-bold { font-weight: 700; }
