/* Gerar Voucher — Método NES Care */

#nes-voucher-view {
  display: none;
  padding: var(--space-4, 1rem) var(--space-5, 1.25rem) 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

#nes-voucher-view.visible {
  display: block;
}

.nes-voucher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--navy-100, #e2e8f0);
}

.nes-voucher-header h2 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--navy-800, #0c3b6e);
}

.nes-voucher-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nes-voucher-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .nes-voucher-layout {
    grid-template-columns: 1fr;
  }
}

.nes-voucher-form-card,
.nes-voucher-agenda-card,
.nes-voucher-receipt {
  background: #fff;
  border: 1px solid rgba(12, 59, 110, 0.12);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(15, 35, 55, 0.05);
}

.nes-voucher-form-card h3,
.nes-voucher-agenda-card h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  color: #0f4c66;
}

.nes-voucher-paciente-banner {
  background: linear-gradient(90deg, #f0fdfa, #f8fafc);
  border: 1px solid #99f6e4;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}

.nes-voucher-paciente-banner strong {
  color: #0c3b6e;
}

.nes-voucher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.nes-voucher-grid .form-group.nes-field-full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .nes-voucher-grid {
    grid-template-columns: 1fr;
  }
}

.nes-voucher-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.nes-voucher-cal-nav strong {
  font-size: 0.95rem;
  color: #0c3b6e;
}

.nes-voucher-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 14px;
}

.nes-voucher-cal-dow {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  padding: 4px 0;
}

.nes-voucher-cal-day {
  aspect-ratio: 1;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.nes-voucher-cal-day:hover:not(:disabled) {
  border-color: #16846f;
  background: #f0fdfa;
}

.nes-voucher-cal-day.is-selected {
  background: #0f4c66;
  color: #fff;
  border-color: #0f4c66;
}

.nes-voucher-cal-day.is-muted {
  opacity: 0.35;
  cursor: default;
}

.nes-voucher-cal-day:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nes-voucher-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.nes-voucher-slot {
  min-width: 88px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.nes-voucher-slot.is-free:hover {
  border-color: #16846f;
  background: #ecfdf5;
}

.nes-voucher-slot.is-busy {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
  cursor: not-allowed;
}

.nes-voucher-slot.is-selected {
  background: #0f4c66;
  color: #fff;
  border-color: #0f4c66;
}

.nes-voucher-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 10px;
}

.nes-voucher-legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.nes-voucher-legend .lg-free::before { background: #ecfdf5; border: 1px solid #16846f; }
.nes-voucher-legend .lg-busy::before { background: #fef2f2; border: 1px solid #fecaca; }
.nes-voucher-legend .lg-sel::before { background: #0f4c66; }

.nes-voucher-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.nes-voucher-receipt {
  margin-top: 20px;
}

.nes-voucher-receipt.hidden {
  display: none;
}

.nes-voucher-print-doc {
  border: 2px solid #0f4c66;
  border-radius: 12px;
  padding: 24px;
  max-width: 720px;
  margin: 0 auto;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #0f172a;
}

.nes-voucher-print-doc .v-head {
  text-align: center;
  border-bottom: 2px solid #16846f;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.nes-voucher-print-doc .v-head h1 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f4c66;
  letter-spacing: 0.04em;
}

.nes-voucher-print-doc .v-head h2 {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: #16846f;
}

.nes-voucher-print-doc .v-title {
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  margin: 12px 0 18px;
  color: #0c3b6e;
}

.nes-voucher-print-doc dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 12px;
  font-size: 0.88rem;
}

.nes-voucher-print-doc dt {
  font-weight: 700;
  color: #475569;
}

.nes-voucher-print-doc dd {
  margin: 0;
}

.nes-voucher-print-doc .v-orient {
  margin-top: 18px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #334155;
}

.nes-voucher-print-doc .v-codigo {
  margin-top: 16px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #0f4c66;
}

@media print {
  body.nes-print-voucher * { visibility: hidden; }
  body.nes-print-voucher #nes-voucher-comprovante,
  body.nes-print-voucher #nes-voucher-comprovante * { visibility: visible; }
  body.nes-print-voucher #nes-voucher-comprovante {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}
