/* ===== Reset & Base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: #f4f6f9;
  color: #1c1c1e;
  line-height: 1.45;
  font-size: 16px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; }
a { color: #0a6cd6; text-decoration: none; }

/* ===== Theme ===== */
:root {
  --primary: #0a3d62;
  --primary-dark: #06283d;
  --accent: #e74c3c;
  --gold: #f39c12;
  --green: #27ae60;
  --bg-card: #fff;
  --border: #e3e6ec;
  --text-muted: #6b7280;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,.08);
  --radius: 14px;
}

/* ===== Header ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px;
  box-shadow: var(--shadow-sm);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.header-title h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.header-dates {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 500;
}
.install-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, background .15s;
}
.install-btn:active { transform: scale(0.92); background: rgba(255,255,255,0.28); }
.install-btn.hidden { display: none; }

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  padding: 0 12px;
  height: 38px;
}
.search-icon { color: #8a8a8e; flex-shrink: 0; margin-right: 8px; }
#searchInput {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: #1c1c1e;
}
#searchInput::placeholder { color: #8a8a8e; }
.clear-search {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c7c7cc;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}
.clear-search.hidden { display: none; }

/* ===== Tab Content ===== */
main { min-height: 60vh; }
.tab-content { display: none; padding: 14px 14px 24px; }
.tab-content.active { display: block; }

/* ===== Day Navigation (chips) ===== */
.day-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 4px 12px;
  margin: 0 -14px 8px;
  padding-left: 14px;
  padding-right: 14px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.day-nav::-webkit-scrollbar { display: none; }
.day-chip {
  flex-shrink: 0;
  scroll-snap-align: start;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 7px 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  transition: all .18s;
  position: relative;
}
.day-chip .weekday {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.6px;
  line-height: 1;
  margin-bottom: 2px;
}
.day-chip .num {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.day-chip .label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.day-chip.active {
  background: var(--primary);
  border-color: var(--primary);
}
.day-chip.active .num,
.day-chip.active .label { color: #fff; }
.day-chip.active .weekday { color: #fde68a; }
.day-chip.complete::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
}

/* ===== Day Card ===== */
.day-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
}
.day-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 16px;
}
.day-header .day-date {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.day-header h2 {
  font-size: 19px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: -0.3px;
}
.day-header .day-tagline {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 6px;
}
.day-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
}
.progress-bar {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width .3s;
}

.day-body { padding: 6px 0; }
.activity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f1f4;
  transition: background .15s;
  cursor: pointer;
  position: relative;
}
.activity:last-child { border-bottom: none; }
.activity:active { background: #f9fafb; }
.activity-chevron {
  flex-shrink: 0;
  align-self: center;
  color: #c7c7cc;
  margin-left: 4px;
  transition: transform .15s, color .15s;
}
.activity:active .activity-chevron { transform: translateX(2px); color: var(--primary); }
.activity-check {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 2px solid #c7c7cc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all .15s;
  background: #fff;
}
.activity-check.checked {
  background: var(--green);
  border-color: var(--green);
}
.activity-check.checked svg { display: block; }
.activity-check svg { display: none; color: #fff; }

.activity-body { flex: 1; min-width: 0; }
.activity-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c1c1e;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.activity-icon {
  font-size: 16px;
  line-height: 1;
}
.activity.checked .activity-title {
  text-decoration: line-through;
  color: var(--text-muted);
}
.activity-time {
  display: inline-block;
  background: #fff5e6;
  color: #b8730a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  margin-right: 6px;
  letter-spacing: 0.2px;
}
.activity-desc {
  font-size: 13.5px;
  color: #4a4a4e;
  margin-top: 4px;
  line-height: 1.5;
}
.activity-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.meta-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.meta-tag.location { background: #e8f4fd; color: #0a6cd6; }
.meta-tag.food { background: #fef0e7; color: #c2410c; }
.meta-tag.tip { background: #ecfdf5; color: #065f46; }

/* ===== Reservation Card ===== */
.reservation-card {
  margin: 12px 16px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.reservation-card .res-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.reservation-card .res-info { flex: 1; min-width: 0; }
.reservation-card .res-label {
  font-size: 10px;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.reservation-card .res-code {
  font-size: 17px;
  font-weight: 700;
  color: #78350f;
  font-family: "SF Mono", "Menlo", monospace;
  letter-spacing: 0.3px;
  margin-top: 2px;
}
.reservation-card .res-detail {
  font-size: 12px;
  color: #92400e;
  margin-top: 2px;
}
.copy-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.7);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #92400e;
}
.copy-btn:active { transform: scale(0.92); }

/* ===== Contact link ===== */
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e8f4fd;
  color: #0a6cd6;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  margin-right: 6px;
}
.contact-link:active { background: #d1e9fb; }

/* ===== Tomorrow Preview ===== */
.tomorrow-preview {
  margin: 14px 16px 18px;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-radius: var(--radius);
  padding: 14px 16px;
  border-left: 4px solid #7c3aed;
}
.tomorrow-preview h3 {
  font-size: 13px;
  color: #5b21b6;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tomorrow-preview .tomorrow-title {
  font-size: 16px;
  font-weight: 700;
  color: #4c1d95;
  margin-top: 6px;
}
.tomorrow-preview ul {
  margin-top: 8px;
  padding-left: 18px;
  font-size: 13.5px;
  color: #5b21b6;
}
.tomorrow-preview ul li { margin-bottom: 4px; }

/* ===== Pendencias ===== */
.pendencias-section { margin-bottom: 22px; }
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 4px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .count {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  letter-spacing: 0;
}

.pend-item {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.pend-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.pend-header .activity-check { margin-top: 0; }
.pend-info { flex: 1; min-width: 0; }
.pend-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c1c1e;
}
.pend-item.checked .pend-title {
  text-decoration: line-through;
  color: var(--text-muted);
}
.pend-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pend-cat.docs { background: #fee2e2; color: #991b1b; }
.pend-cat.pay { background: #dcfce7; color: #14532d; }
.pend-cat.book { background: #dbeafe; color: #1e3a8a; }
.pend-cat.other { background: #f3e8ff; color: #581c87; }

.expand-arrow {
  color: var(--text-muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.pend-item.expanded .expand-arrow { transform: rotate(180deg); }
.pend-detail {
  display: none;
  padding: 0 14px 14px 52px;
  font-size: 13.5px;
  color: #4a4a4e;
  line-height: 1.55;
  border-top: 1px solid #f0f1f4;
  padding-top: 12px;
}
.pend-detail strong { color: #1c1c1e; }
.pend-item.expanded .pend-detail { display: block; }

/* ===== Info Tab ===== */
.info-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.info-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  font-size: 14px;
  gap: 10px;
  border-bottom: 1px solid #f4f5f8;
}
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-muted); flex-shrink: 0; font-weight: 500; }
.info-row .value { font-weight: 600; text-align: right; word-break: break-word; }
.info-row .value.mono { font-family: "SF Mono", "Menlo", monospace; }

.warning-box {
  background: #fff7ed;
  border-left: 4px solid #f97316;
  padding: 12px 14px;
  border-radius: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: #7c2d12;
  line-height: 1.55;
}
.warning-box strong { color: #c2410c; }

.reset-btn {
  background: #fee2e2;
  color: #991b1b;
  font-weight: 600;
  padding: 12px;
  border-radius: 10px;
  width: 100%;
  font-size: 14px;
  margin-top: 8px;
}
.reset-btn:active { background: #fecaca; }

.export-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 600;
  padding: 14px;
  border-radius: 10px;
  width: 100%;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform .12s, filter .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.export-btn:active { transform: scale(0.98); filter: brightness(0.92); }

.agency-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.agency-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .12s, filter .12s;
}
.agency-btn:active { transform: scale(0.97); filter: brightness(0.95); }
.agency-btn.whatsapp {
  background: #25D366;
  color: #fff;
}
.agency-btn.phone {
  background: #eef4fb;
  color: var(--primary);
}

/* ===== Bottom Tab Bar ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(env(safe-area-inset-bottom) + 4px);
  z-index: 100;
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  color: #8a8a8e;
  font-size: 10.5px;
  font-weight: 600;
  position: relative;
  transition: color .15s;
}
.tab-btn.active { color: var(--primary); }
.tab-btn:active { transform: scale(0.95); }
.badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 22px);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.badge.hidden { display: none; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(28, 28, 30, 0.95);
  color: #fff;
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
  max-width: 80%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Empty / No Results ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .emoji { font-size: 40px; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== Search highlight ===== */
mark {
  background: #fef08a;
  color: #713f12;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}

.hidden { display: none !important; }

/* ===== Print Root (hidden on screen) ===== */
#printRoot { display: none; }

/* ===== Print Styles ===== */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body {
    background: #fff !important;
    color: #1c1c1e !important;
    padding: 0 !important;
    max-width: none !important;
    box-shadow: none !important;
    font-size: 11pt;
    line-height: 1.4;
  }
  .app-header,
  .tab-bar,
  main,
  .sheet,
  .detail-view,
  .toast,
  #installBtn {
    display: none !important;
  }
  #printRoot {
    display: block !important;
    color: #1c1c1e;
  }
  .print-doc { max-width: 100%; }
  .print-cover {
    text-align: center;
    padding: 30mm 0 20mm;
    border-bottom: 2px solid #0a3d62;
    margin-bottom: 14mm;
    page-break-after: always;
  }
  .print-cover h1 {
    font-size: 28pt;
    color: #0a3d62;
    margin-bottom: 4mm;
    letter-spacing: -0.5pt;
  }
  .print-cover .sub {
    font-size: 14pt;
    color: #4a4a4e;
    margin-bottom: 8mm;
  }
  .print-cover .meta {
    font-size: 10pt;
    color: #6b7280;
    margin-top: 10mm;
    line-height: 1.7;
  }
  .print-section {
    page-break-inside: avoid;
    margin-bottom: 8mm;
  }
  .print-section h2 {
    font-size: 16pt;
    color: #0a3d62;
    border-bottom: 1.5pt solid #0a3d62;
    padding-bottom: 2mm;
    margin-bottom: 4mm;
    page-break-after: avoid;
  }
  .print-section h3 {
    font-size: 13pt;
    color: #06283d;
    margin-top: 4mm;
    margin-bottom: 2mm;
    page-break-after: avoid;
  }
  .print-section h4 {
    font-size: 11pt;
    color: #2c2c2e;
    margin-top: 3mm;
    margin-bottom: 1.5mm;
    page-break-after: avoid;
  }
  .print-section p { margin-bottom: 2mm; }
  .print-section ul { margin: 1mm 0 2mm 6mm; }
  .print-section li { margin-bottom: 1mm; }
  .print-day {
    page-break-before: always;
    page-break-inside: auto;
  }
  .print-day:first-of-type { page-break-before: auto; }
  .print-day-head {
    background: #f3f6fa;
    border-left: 3pt solid #0a3d62;
    padding: 3mm 4mm;
    margin-bottom: 4mm;
  }
  .print-day-head .head-num {
    font-size: 9pt;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5pt;
    font-weight: 700;
  }
  .print-day-head h2 {
    border: none;
    padding: 0;
    margin: 1mm 0;
    font-size: 15pt;
  }
  .print-day-head .tagline {
    font-size: 10pt;
    color: #4a4a4e;
    font-style: italic;
  }
  .print-res {
    background: #fef3c7;
    border-left: 3pt solid #f59e0b;
    padding: 2.5mm 4mm;
    margin: 3mm 0;
    font-size: 10pt;
    page-break-inside: avoid;
  }
  .print-res .label {
    font-size: 8pt;
    text-transform: uppercase;
    color: #92400e;
    font-weight: 700;
    letter-spacing: 0.4pt;
  }
  .print-res .code {
    font-family: "Courier New", monospace;
    font-weight: 700;
    color: #78350f;
    font-size: 12pt;
  }
  .print-act {
    margin: 3mm 0 4mm;
    page-break-inside: avoid;
  }
  .print-act .act-title {
    font-weight: 700;
    font-size: 11pt;
    color: #1c1c1e;
  }
  .print-act .act-title .time {
    background: #fff5e6;
    color: #b8730a;
    font-size: 8.5pt;
    padding: 0.5mm 2mm;
    border-radius: 2pt;
    margin-right: 2mm;
    font-weight: 700;
  }
  .print-act .desc {
    font-size: 10pt;
    color: #4a4a4e;
    margin: 1mm 0 1.5mm;
  }
  .print-detail {
    font-size: 9.5pt;
    padding-left: 4mm;
    border-left: 1.5pt solid #e3e6ec;
    margin: 1.5mm 0;
  }
  .print-detail-row {
    margin-bottom: 1.5mm;
  }
  .print-detail-row .key {
    font-weight: 700;
    color: #06283d;
  }
  .print-warn {
    background: #fff7ed;
    border-left: 2pt solid #f97316;
    padding: 2mm 3mm;
    font-size: 9.5pt;
    color: #7c2d12;
    margin: 2mm 0;
  }
  .print-pend-item {
    page-break-inside: avoid;
    margin-bottom: 3mm;
    padding: 2mm 3mm;
    background: #fafbfd;
    border-left: 2pt solid #c7c7cc;
  }
  .print-pend-item.done {
    opacity: 0.55;
    text-decoration: line-through;
  }
  .print-pend-item .cat {
    font-size: 8pt;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.4pt;
  }
  .print-pend-item .ttl {
    font-weight: 700;
    font-size: 11pt;
    margin: 0.5mm 0;
  }
  .print-pend-item .det {
    font-size: 9.5pt;
    color: #4a4a4e;
  }
  .print-info-grid {
    display: block;
  }
  .print-info-row {
    display: flex;
    justify-content: space-between;
    gap: 4mm;
    padding: 1.5mm 0;
    border-bottom: 0.5pt solid #e3e6ec;
    font-size: 10pt;
  }
  .print-info-row .k { color: #6b7280; font-weight: 500; }
  .print-info-row .v { font-weight: 700; text-align: right; }
  .print-footer {
    text-align: center;
    font-size: 8pt;
    color: #9ca3af;
    margin-top: 8mm;
    padding-top: 3mm;
    border-top: 0.5pt solid #e3e6ec;
  }
  a { color: #1c1c1e !important; text-decoration: none; }
}

/* ===== Detail View (push navigation) ===== */
.detail-view {
  position: fixed;
  inset: 0;
  background: #f4f6f9;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1), visibility 0s linear .28s;
  visibility: hidden;
  overflow: hidden;
}
.detail-view.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .28s cubic-bezier(.4,0,.2,1), visibility 0s linear 0s;
}
.detail-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.detail-back {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  padding: 6px 8px 6px 4px;
  border-radius: 8px;
  margin-left: -4px;
}
.detail-back:active { background: rgba(255,255,255,.12); }
.detail-header-title {
  font-size: 15px;
  font-weight: 600;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: center;
  padding-right: 70px;
}
.detail-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px calc(40px + env(safe-area-inset-bottom));
}

.detail-hero {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.detail-hero .hero-time {
  display: inline-block;
  background: #fff5e6;
  color: #b8730a;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}
.detail-hero h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1c1c1e;
  margin-top: 10px;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-hero h2 .icon { font-size: 26px; }
.detail-hero .day-ref {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
}
.detail-hero .desc {
  font-size: 15px;
  color: #4a4a4e;
  margin-top: 12px;
  line-height: 1.55;
}
.detail-hero .hero-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0f1f4;
}
.detail-hero .hero-check-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-section {
  margin-bottom: 16px;
}
.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin: 4px 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.about-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 14.5px;
  line-height: 1.6;
  color: #2c2c2e;
  box-shadow: var(--shadow-sm);
}

.logistics-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 6px 16px;
  box-shadow: var(--shadow-sm);
}
.logistics-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f4f5f8;
  font-size: 14px;
}
.logistics-row:last-child { border-bottom: none; }
.logistics-row .icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #eef4fb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.logistics-row .text { flex: 1; min-width: 0; }
.logistics-row .label-mini {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.logistics-row .value-mini {
  font-size: 14px;
  font-weight: 600;
  color: #1c1c1e;
  margin-top: 1px;
}

.highlight-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 12px;
}
.highlight-card .h-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef4fb, #e1ecf7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}
.highlight-card .h-body { flex: 1; min-width: 0; }
.highlight-card .h-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #1c1c1e;
  margin-bottom: 3px;
}
.highlight-card .h-text {
  font-size: 13.5px;
  color: #4a4a4e;
  line-height: 1.55;
}

.food-list, .explore-list {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 4px 16px;
}
.food-item, .explore-item {
  padding: 12px 0;
  border-bottom: 1px solid #f4f5f8;
}
.food-item:last-child, .explore-item:last-child { border-bottom: none; }
.food-item .name, .explore-item .name {
  font-size: 14.5px;
  font-weight: 700;
  color: #1c1c1e;
  display: flex;
  align-items: center;
  gap: 8px;
}
.food-item .where {
  font-size: 12px;
  color: #0a6cd6;
  font-weight: 600;
  margin-top: 2px;
}
.food-item .note, .explore-item .note {
  font-size: 13px;
  color: #4a4a4e;
  margin-top: 4px;
  line-height: 1.5;
}

.warn-card {
  background: #fff7ed;
  border-left: 4px solid #f97316;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: #7c2d12;
  line-height: 1.55;
}
.warn-card::before {
  content: "⚠️ ";
}

.detail-reservation {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1.5px solid #f59e0b;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-reservation .res-info { flex: 1; min-width: 0; }
.detail-reservation .res-label {
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.detail-reservation .res-code {
  font-size: 18px;
  font-weight: 700;
  color: #78350f;
  font-family: "SF Mono", "Menlo", monospace;
  margin-top: 2px;
}
.detail-reservation .res-extra {
  font-size: 12px;
  color: #92400e;
  margin-top: 2px;
}

.detail-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== Detail Footer Actions ===== */
.detail-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.footer-btn {
  width: 100%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  transition: transform .12s, background .12s;
}
.footer-btn:active { transform: scale(0.98); background: #e8f0f8; }
.move-from-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ===== Bottom Sheet ===== */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear .25s;
}
.sheet.open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s linear 0s;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .25s ease;
}
.sheet.open .sheet-backdrop { background: rgba(0,0,0,0.4); }

.sheet-panel {
  position: relative;
  background: #f4f6f9;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
}
.sheet.open .sheet-panel { transform: translateY(0); }

.sheet-handle {
  width: 38px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 8px auto 14px;
}
.sheet-title {
  font-size: 18px;
  font-weight: 700;
  color: #1c1c1e;
  text-align: center;
  letter-spacing: -0.2px;
}
.sheet-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 12px;
}

.sheet-days {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 8px 0 14px;
}
.sheet-day {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all .15s;
  position: relative;
}
.sheet-day:active { transform: scale(0.98); }
.sheet-day.current {
  border-color: var(--primary);
  background: #eef4fb;
}
.sheet-day .num {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sheet-day .ttl {
  font-size: 13.5px;
  font-weight: 600;
  color: #1c1c1e;
  line-height: 1.3;
}
.sheet-day .badge-current {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  background: var(--primary);
  color: #fff;
  padding: 2px 6px;
  border-radius: 5px;
  font-weight: 700;
}
.sheet-day .badge-original {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  background: #ede9fe;
  color: #5b21b6;
  padding: 2px 6px;
  border-radius: 5px;
  font-weight: 700;
}

.sheet-form { display: block; }
.sf-label {
  display: block;
  margin-bottom: 12px;
}
.sf-label > span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.sf-label input,
.sf-label select,
.sf-label textarea {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: #1c1c1e;
  outline: none;
  transition: border-color .15s;
}
.sf-label input:focus,
.sf-label select:focus,
.sf-label textarea:focus {
  border-color: var(--primary);
}
.sf-label textarea {
  resize: vertical;
  min-height: 80px;
}

.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.sheet-cancel,
.sheet-confirm {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter .12s, transform .12s;
}
.sheet-cancel {
  background: #e3e6ec;
  color: #1c1c1e;
  border: none;
}
.sheet-confirm {
  background: var(--primary);
  color: #fff;
  border: none;
}
.sheet-cancel:active,
.sheet-confirm:active { transform: scale(0.98); filter: brightness(0.95); }

/* Standalone cancel (used in move sheet) */
.sheet-panel > .sheet-cancel {
  width: 100%;
  margin-top: 4px;
}

/* ===== Add Pendência Button ===== */
.pend-header-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 16px;
}
.pend-header-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}
.pend-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px 6px 10px;
  border-radius: 10px;
  margin-left: auto;
  border: none;
  cursor: pointer;
  transition: filter .12s, transform .12s;
  flex-shrink: 0;
}
.pend-add-btn:active { transform: scale(0.97); filter: brightness(0.92); }
.pend-add-btn svg { flex-shrink: 0; }

/* Custom pendência delete */
.pend-delete {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fef2f2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border: 1px solid #fecaca;
  cursor: pointer;
  transition: background .12s, color .12s, transform .12s;
  z-index: 2;
  position: relative;
}
.pend-delete:hover { background: #fee2e2; }
.pend-delete:active { background: #fecaca; color: #991b1b; transform: scale(0.92); }
.pend-item.custom .pend-title::before {
  content: "✏️ ";
  font-size: 12px;
  margin-right: 2px;
  vertical-align: 1px;
}

@media (min-width: 720px) {
  body { max-width: 480px; margin: 0 auto; box-shadow: 0 0 30px rgba(0,0,0,.08); min-height: 100vh; }
  .tab-bar { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .detail-view {
    inset: auto;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -240px;
    width: 480px;
    box-shadow: 0 0 30px rgba(0,0,0,.08);
  }
}
