:root {
  --voice-capture-brand: #59bc5b;
  --voice-capture-brand-soft: rgba(89, 188, 91, 0.12);
  --voice-capture-warn: #b8790a;
  --voice-capture-warn-soft: rgba(255, 171, 29, 0.15);
}

/* ---------- Botão flutuante ---------- */

.voice-capture-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 30%, #6ecb70, var(--voice-capture-brand));
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(89, 188, 91, 0.4);
  z-index: 1040;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.voice-capture-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 24px rgba(89, 188, 91, 0.45);
}

.voice-capture-fab-orb {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px var(--voice-capture-brand);
}

/* ---------- Painel ---------- */

.voice-capture-panel {
  position: fixed;
  right: 1.5rem;
  bottom: 6.5rem;
  width: 420px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 8rem);
  background-color: var(--bs-body-bg, #fff);
  border-radius: 1.25rem;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
  z-index: 1041;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .voice-capture-panel {
    position: fixed;
    inset: 0;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    z-index: 1080;
  }
}

.voice-capture-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bs-border-color, #eef0f2);
  flex-shrink: 0;
}

.voice-capture-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.voice-capture-date-input {
  border: 1px solid var(--bs-border-color, #e0e0e0);
  border-radius: 0.5rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  background: transparent;
  color: inherit;
}

.voice-capture-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.voice-capture-close:hover {
  opacity: 1;
}

.voice-capture-panel-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* ---------- Telas (transição simples e fluida) ---------- */

.voice-capture-screen {
  animation: voice-capture-fade-in 0.25s ease;
}

.voice-capture-screen-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

@keyframes voice-capture-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Indicador de IA (orbe) — substitui o mascote até o asset real ser integrado ---------- */

.voice-capture-orb {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #8fe092, var(--voice-capture-brand));
  vertical-align: middle;
}

.voice-capture-orb-sm {
  width: 10px;
  height: 10px;
}

.voice-capture-orb-visual {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto 1.25rem;
}

.voice-capture-orb-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(89, 188, 91, 0.35);
  animation: voice-capture-pulse 2.4s ease-out infinite;
}

.voice-capture-orb-pulse-2 { animation-delay: 0.6s; }
.voice-capture-orb-pulse-3 { animation-delay: 1.2s; }

@keyframes voice-capture-pulse {
  0% { transform: scale(0.55); opacity: 0.8; }
  100% { transform: scale(1); opacity: 0; }
}

.voice-capture-orb-core {
  position: relative;
  width: 64%;
  height: 64%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #8fe092, var(--voice-capture-brand));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(89, 188, 91, 0.3);
  z-index: 1;
  animation: voice-capture-breathe 3.2s ease-in-out infinite;
}

@keyframes voice-capture-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.voice-capture-orb-success {
  background: radial-gradient(circle at 32% 28%, #8fe092, var(--voice-capture-brand));
  animation: none;
  margin-bottom: 0.75rem;
  width: 72px;
  height: 72px;
}

.voice-capture-orb-visual-thinking {
  width: 96px;
  height: 96px;
}

.voice-capture-orb-thinking {
  animation: voice-capture-breathe 1.6s ease-in-out infinite;
}

/* ---------- Tela 1: Escutando ---------- */

.voice-capture-listening-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.voice-capture-listening-subtitle {
  font-size: 0.9rem;
  color: var(--bs-secondary-color, #6c757d);
  margin-bottom: 1.25rem;
}

.voice-capture-waveform {
  width: 100%;
  height: 64px;
  display: block;
  background-color: var(--voice-capture-brand-soft);
  border-radius: 0.75rem;
}

.voice-capture-timer {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  color: var(--bs-secondary-color, #6c757d);
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

.voice-capture-stop-button {
  border: none;
  border-radius: 2rem;
  padding: 0.65rem 1.75rem;
  background-color: var(--bs-danger, #dc3545);
  color: #fff;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.voice-capture-stop-button:hover {
  filter: brightness(1.08);
}

/* ---------- Botões genéricos ---------- */

.voice-capture-button-row {
  display: flex;
  gap: 0.6rem;
  width: 100%;
}

.voice-capture-btn {
  border-radius: 0.75rem;
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  flex: 1;
  transition: filter 0.15s ease, background-color 0.15s ease;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.voice-capture-btn-primary {
  background-color: var(--voice-capture-brand);
  color: #fff;
}

.voice-capture-btn-primary:hover {
  filter: brightness(1.06);
  color: #fff;
}

.voice-capture-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.voice-capture-btn-outline {
  background: transparent;
  border-color: var(--voice-capture-brand);
  color: var(--voice-capture-brand);
}

.voice-capture-btn-ghost {
  background: transparent;
  border-color: var(--bs-border-color, #e0e0e0);
  color: inherit;
}

/* ---------- Tela 2: Timeline de relatos ---------- */

.voice-capture-timeline {
  max-height: 42vh;
  overflow-y: auto;
  padding-left: 0.75rem;
  border-left: 2px solid var(--bs-border-color, #eef0f2);
  margin-bottom: 0.5rem;
}

.voice-capture-timeline-item {
  position: relative;
  margin-bottom: 1rem;
}

.voice-capture-timeline-dot {
  position: absolute;
  left: -1.05rem;
  top: 0.4rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--voice-capture-brand);
}

.voice-capture-timeline-card {
  background-color: var(--bs-tertiary-bg, #f8f9fa);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.voice-capture-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.voice-capture-card-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bs-secondary-color, #6c757d);
}

.voice-capture-card-actions {
  display: flex;
  gap: 0.75rem;
}

.voice-capture-card-action {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #6c757d);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.voice-capture-card-action:hover {
  color: var(--voice-capture-brand);
}

.voice-capture-card-action-danger:hover {
  color: var(--bs-danger, #dc3545);
}

.voice-capture-card-transcript {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  resize: none;
  padding: 0;
  color: inherit;
}

.voice-capture-card-transcript:focus {
  outline: none;
}

.voice-capture-card-badge {
  font-size: 0.75rem;
  color: var(--voice-capture-brand);
  margin: 0.35rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.voice-capture-card-audio {
  width: 100%;
  height: 32px;
  margin-top: 0.4rem;
}

.voice-capture-card-error {
  color: var(--bs-danger, #dc3545);
  font-size: 0.85rem;
  margin: 0;
}

/* ---------- Tela 3: Interpretando ---------- */
/* (usa .voice-capture-orb-visual / .voice-capture-listening-title) */

/* ---------- Tela 4: Revisão ---------- */

.voice-capture-review-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.voice-capture-badge-review {
  background-color: var(--voice-capture-warn-soft);
  color: var(--voice-capture-warn);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.voice-capture-review-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.voice-capture-review-entry {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bs-border-color, #eef0f2);
}

.voice-capture-review-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.voice-capture-review-entry-header {
  margin-bottom: 0.35rem;
}

.voice-capture-review-entry-time {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bs-secondary-color, #6c757d);
}

.voice-capture-review-transcript {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--bs-secondary-color, #6c757d);
  margin-bottom: 0.75rem;
}

.voice-capture-fact-card {
  background-color: var(--bs-tertiary-bg, #f8f9fa);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  transition: opacity 0.2s ease;
}

.voice-capture-fact-card-matched {
  box-shadow: inset 3px 0 0 var(--voice-capture-brand);
}

.voice-capture-fact-card-unresolved {
  box-shadow: inset 3px 0 0 var(--voice-capture-warn);
}

.voice-capture-fact-card-removed,
.voice-capture-fact-card-observation {
  opacity: 0.55;
}

.voice-capture-fact-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.voice-capture-fact-card-matched .voice-capture-fact-label {
  color: var(--voice-capture-brand);
}

.voice-capture-fact-card-unresolved .voice-capture-fact-label {
  color: var(--voice-capture-warn);
}

.voice-capture-fact-value {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.voice-capture-fact-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.voice-capture-quantity-input {
  width: 110px;
  border: 1px solid var(--bs-border-color, #e0e0e0);
  border-radius: 0.5rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  background: var(--bs-body-bg, #fff);
  color: inherit;
}

.voice-capture-confidence {
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #6c757d);
}

.voice-capture-fact-remove {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #6c757d);
  cursor: pointer;
}

.voice-capture-fact-remove:hover {
  color: var(--bs-danger, #dc3545);
}

.voice-capture-fact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.voice-capture-fact-action {
  border: 1px solid var(--bs-border-color, #e0e0e0);
  background: var(--bs-body-bg, #fff);
  border-radius: 2rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: inherit;
}

.voice-capture-fact-action:hover {
  border-color: var(--voice-capture-brand);
  color: var(--voice-capture-brand);
}

.voice-capture-fact-action-danger:hover {
  border-color: var(--bs-danger, #dc3545);
  color: var(--bs-danger, #dc3545);
}

.voice-capture-candidate-select {
  width: 100%;
  border: 1px solid var(--bs-border-color, #e0e0e0);
  border-radius: 0.5rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  margin-top: 0.4rem;
  background: var(--bs-body-bg, #fff);
  color: inherit;
}

.voice-capture-catalog-search,
.voice-capture-create-item {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--bs-border-color, #e0e0e0);
}

.voice-capture-search-input,
.voice-capture-create-input {
  width: 100%;
  border: 1px solid var(--bs-border-color, #e0e0e0);
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  background: var(--bs-body-bg, #fff);
  color: inherit;
}

.voice-capture-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 160px;
  overflow-y: auto;
}

.voice-capture-search-result {
  text-align: left;
  border: none;
  background: var(--bs-body-bg, #fff);
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.voice-capture-search-result:hover {
  background-color: var(--voice-capture-brand-soft);
}

/* ---------- Genéricos ---------- */

.voice-capture-hint {
  color: var(--bs-secondary-color, #6c757d);
  font-style: italic;
  font-size: 0.85rem;
}

.voice-capture-meta {
  font-size: 0.8rem;
  color: var(--bs-secondary-color, #6c757d);
}

.voice-capture-error {
  color: var(--bs-danger, #dc3545);
  margin: 0.5rem 0 1rem;
}

.voice-capture-error-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
