/* VozConsultAI — Módulo de gravação | Design tokens */

:root {
  /* Surfaces */
  --bg: #F4F1EA;
  --surface: #FFFFFF;
  --surface-2: #FBF8F1;
  --surface-3: #EFEBE1;
  --line: #E4DFD3;
  --line-strong: #CFC9BA;

  /* Ink */
  --ink: #18222F;
  --ink-2: #3E4A5C;
  --ink-3: #6F7B8E;
  --ink-4: #A4ADBD;

  /* Accent — Azul clínico */
  --accent: #0F4C81;
  --accent-hover: #0A3D6B;
  --accent-press: #082F54;
  --accent-soft: #E5EEF6;
  --accent-soft-2: #D2E0EF;

  /* States */
  --rec: #B8443D;
  --rec-soft: #F4E6E4;
  --rec-pulse: #D85B53;
  --success: #2D7A5C;
  --success-soft: #E3F0EA;
  --warn: #B07A2A;
  --warn-soft: #F5EBD7;
  --danger: #A8362F;
  --danger-soft: #F4E2E0;

  /* Ranking panel tints (soft) */
  --rk-blue-bg: #E9F1F8;   --rk-blue-ink: #0F4C81;   --rk-blue-soft: #CFE0EF;
  --rk-green-bg: #E7F1EC;  --rk-green-ink: #2D7A5C;  --rk-green-soft: #CDE6DA;
  --rk-amber-bg: #F6EEDB;  --rk-amber-ink: #9C6E26;  --rk-amber-soft: #EADCBC;
  --rk-violet-bg: #EDEAF6; --rk-violet-ink: #654FA3; --rk-violet-soft: #DBD3EE;

  /* Type */
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif-reading: "IBM Plex Sans", system-ui, sans-serif;

  /* Radius + shadows */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  --shadow-card: 0 1px 0 rgba(24,34,47,0.04), 0 1px 2px rgba(24,34,47,0.05);
  --shadow-elev: 0 12px 32px -16px rgba(24,34,47,0.18), 0 4px 12px -4px rgba(24,34,47,0.08);
  --shadow-toast: 0 20px 48px -20px rgba(24,34,47,0.28), 0 6px 16px -6px rgba(24,34,47,0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-sm);
  transition: all 120ms ease;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.15);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); transform: translateY(1px); }
.btn-primary:disabled {
  background: var(--surface-3);
  color: var(--ink-4);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn-secondary:active { background: var(--surface-3); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); border-color: var(--ink-3); }

.btn-danger-ghost {
  background: transparent;
  color: var(--rec);
  border: 1px solid transparent;
}
.btn-danger-ghost:hover { background: var(--rec-soft); border-color: var(--rec-soft); }

.btn-danger-primary {
  background: var(--rec);
  color: white;
  border: 1px solid var(--rec);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-sm);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: background 120ms, border-color 120ms, transform 80ms;
}
.btn-danger-primary:hover { background: #B8453E; border-color: #B8453E; }
.btn-danger-primary:active { transform: translateY(1px); }
.btn-danger-primary:disabled {
  background: var(--surface-3); border-color: var(--line-strong);
  color: var(--ink-4); cursor: not-allowed; box-shadow: none;
}

/* Curadoria action buttons — outlined */
.btn-report-abuse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--warn);
  background: var(--surface);
  border: 1px solid var(--warn);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 80ms;
}
.btn-report-abuse:hover {
  background: var(--warn);
  color: white;
  border-color: var(--warn);
}
.btn-report-abuse:active { transform: translateY(1px); }

.btn-reject-final {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--rec);
  background: var(--surface);
  border: 1px solid var(--rec);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 80ms;
}
.btn-reject-final:hover {
  background: var(--rec);
  color: white;
  border-color: var(--rec);
}
.btn-reject-final:active { transform: translateY(1px); }

/* Pagination buttons */
.pg-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.pg-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-soft-2);
}
.pg-btn:disabled {
  color: var(--ink-4);
  cursor: not-allowed;
  background: var(--surface-2);
}

.btn-lg {
  padding: 14px 22px;
  font-size: 15px;
  border-radius: var(--r-md);
}

.btn-xl {
  padding: 18px 28px;
  font-size: 16px;
  border-radius: var(--r-md);
  font-weight: 500;
}

/* === INPUTS === */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.field-input {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: all 120ms ease;
}
.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-input::placeholder { color: var(--ink-4); }

/* === KBD === */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  line-height: 1;
}

/* === BADGE / CHIP === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-rec    { background: var(--rec-soft); color: var(--rec); }
.chip-success{ background: var(--success-soft); color: var(--success); }
.chip-warn   { background: var(--warn-soft); color: var(--warn); }

/* === CARDS === */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

/* === DOT PULSE === */
.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rec-pulse);
  box-shadow: 0 0 0 0 rgba(216,91,83,0.5);
  animation: rec-pulse 1.6s infinite;
}
@keyframes rec-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(216,91,83,0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(216,91,83,0); }
  100% { box-shadow: 0 0 0 0 rgba(216,91,83,0); }
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* === Transitions === */
.fade-enter {
  animation: fadeIn 240ms cubic-bezier(0.2, 0.6, 0.2, 1);
}
@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(15,76,129,0.35); }
  70%  { box-shadow: 0 0 0 10px rgba(15,76,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(15,76,129,0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sentence-enter {
  animation: sentenceIn 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes sentenceIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sentence-refresh {
  animation: sentenceRefresh 420ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes sentenceRefresh {
  0%   { opacity: 0.25; transform: scale(0.985); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}

/* Tiny utility */
.mono { font-family: var(--mono); font-feature-settings: "zero"; }
.tabular { font-variant-numeric: tabular-nums; }

/* === Dashboard responsive grids === */
.trend-bar-col:hover .trend-bar-val { opacity: 1 !important; }

/* === Linhas de grid: destaque suave no hover; clicáveis executam a ação default === */
/* Cabeçalho de grid levemente destacado em relação às linhas (projeto inteiro) */
thead th { background: var(--surface-3); }
tbody tr.grid-row, tbody tr.grid-row-ro { transition: background-color 120ms ease; }
tbody tr.grid-row { cursor: pointer; }
tbody tr.grid-row:hover, tbody tr.grid-row-ro:hover { background-color: var(--surface-2); }

/* === Botão Ouvir (recuperação + reprodução) === */
@keyframes vc-spin { to { transform: rotate(360deg); } }
.vc-spin {
  display: inline-block;
  border: 2px solid var(--accent-soft-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: vc-spin 0.7s linear infinite;
}
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.eq i {
  width: 2.5px; height: 4px; border-radius: 1px;
  background: currentColor;
  animation: eqbar 0.9s ease-in-out infinite;
}
.eq i:nth-child(1) { animation-delay: 0s; }
.eq i:nth-child(2) { animation-delay: 0.18s; }
.eq i:nth-child(3) { animation-delay: 0.36s; }
.eq i:nth-child(4) { animation-delay: 0.54s; }
@keyframes eqbar {
  0%, 100% { height: 3px; }
  50%      { height: 13px; }
}

.dash-wrap { padding: 40px 32px 56px; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.charts-row {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.rankings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
/* Tablet / small laptop: charts and rankings stack, KPIs go 2-up */
@media (max-width: 1024px) {
  .charts-row { grid-template-columns: 1fr; }
  .rankings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .dash-wrap { padding: 28px 18px 44px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 460px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

.shimmer {
  background: linear-gradient(90deg, transparent, rgba(15,76,129,0.08), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
