/* ============================================================
   Pride Video — style.css
   Paleta: branco limpo | #ca991e (dourado) | Fonte: Poppins
   ============================================================ */

:root {
  --bg:          #ffffff;
  --bg-2:        #f7f8fa;
  --bg-3:        #eef0f4;
  --accent:      #ca991e;
  --accent-light:#e4b234;
  --accent-dim:  rgba(202,153,30,0.10);
  --accent-glow: rgba(202,153,30,0.22);
  --text:        #0f172a;
  --text-muted:  #64748b;
  --text-dim:    #94a3b8;
  --border:      rgba(202,153,30,0.28);
  --border-soft: rgba(0,0,0,0.07);
  --radius:      14px;
  --radius-sm:   10px;
  --radius-lg:   22px;
  --radius-xl:   32px;
  --shadow:      0 4px 28px rgba(0,0,0,0.09);
  --shadow-sm:   0 2px 10px rgba(0,0,0,0.06);
  --transition:  0.22s cubic-bezier(.4,0,.2,1);

  /* z-index hierarchy */
  --z-dropdown:  100;
  --z-panel:     200;
  --z-overlay:   300;
  --z-modal:     400;
  --z-toast:     500;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

svg { display: block; flex-shrink: 0; }
/* Ícones modernos: traços arredondados em todos os SVGs */
svg path, svg line, svg polyline, svg polygon, svg rect, svg circle, svg ellipse {
  stroke-linecap: round;
  stroke-linejoin: round;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea, label { font-family: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
video { display: block; }

.hidden { display: none !important; }
.accent { color: var(--accent); }

/* ── Screens ────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow: hidden;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
  z-index: 100;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon { display: flex; }
.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}
.logo-text .accent { color: var(--accent); }
.logo-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
  transition: opacity 0.15s;
}
.logo-btn:hover { opacity: 0.75; }

.header-right { display: flex; align-items: center; gap: 10px; }

/* ── Icon Button ─────────────────────────────────────────────── */
.btn-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }

/* ── Settings Panel ─────────────────────────────────────────── */
.settings-panel {
  position: absolute;
  top: 68px; right: 20px;
  width: 380px;
  z-index: var(--z-panel);
  animation: fadeDown 0.22s ease;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.settings-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}

.settings-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.settings-card-header h3 { font-size: 15px; font-weight: 600; color: var(--text); }

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.input-row { display: flex; gap: 8px; }

.input-field {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: 'Poppins', monospace;
  transition: var(--transition);
}
.input-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.input-field::placeholder { color: var(--text-dim); }

.btn-accent {
  background: var(--accent);
  color: #0f172a;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-accent:hover { background: var(--accent-light); transform: translateY(-1px); }
.btn-accent:active { transform: translateY(0); }

.hint {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Select de qualidade de gravação ─────────────────────────── */
.quality-select {
  cursor: pointer;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  -webkit-appearance: none;
}
.quality-select option { background: #1a1a2e; color: #e5e5e5; }

/* ── VU Meter (medidor de nível do microfone) ─────────────────── */
.mic-vu-meter {
  width: 48px;
  height: 6px;
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  overflow: hidden;
  margin: 0 2px;
  flex-shrink: 0;
}
.mic-vu-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: hsl(120,80%,45%);
  transition: width 0.05s linear;
}

/* ── Device picker (mic / camera selector) ───────────────────── */
.device-picker-select {
  display: block;
  max-width: 130px;
  width: 130px;
  padding: 4px 26px 4px 8px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background-color: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--transition), color var(--transition);
}
.device-picker-select:hover  { border-color: var(--accent); color: var(--accent); }
.device-picker-select:focus  { border-color: var(--accent); color: var(--text); }
.device-picker-select option { background: #1a1a2e; color: #e5e5e5; }

.api-key-status {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
}
.api-key-status.success { background: rgba(34,197,94,0.10); color: #16a34a; border: 1px solid rgba(34,197,94,0.22); }
.api-key-status.error   { background: rgba(239,68,68,0.08); color: #dc2626; border: 1px solid rgba(239,68,68,0.20); }

/* ── Recorder Main ───────────────────────────────────────────── */
.recorder-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  min-height: 0;
}

/* ── Preview Container ───────────────────────────────────────── */
.preview-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
  min-height: 0;
}

/* Placeholder */
.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  text-align: center;
}
.preview-placeholder h3 { font-size: 18px; font-weight: 600; color: var(--text); }
.preview-placeholder p  { font-size: 14px; color: var(--text-muted); max-width: 340px; line-height: 1.7; }
.preview-placeholder strong { color: var(--accent); }

.placeholder-graphic {
  width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim);
  border-radius: 50%;
  margin-bottom: 8px;
}

/* Screen Preview */
.screen-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* ── Camera PiP — arrastável ─────────────────────────────────── */
.camera-pip {
  position: absolute;
  width: 200px;
  height: 140px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.30), 0 0 0 1px rgba(202,153,30,0.25);
  z-index: 50;
  cursor: grab;
  user-select: none;
  /* sem transition de posição para arrastar ser fluido */
  transition: box-shadow 0.2s, border-color 0.2s;
}
.camera-pip.dragging {
  cursor: grabbing;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 0 0 2px var(--accent);
  transition: none;
}

.camera-pip video {
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Hint visual de arrastar (ícone de grade) */
.pip-drag-hint {
  position: absolute;
  top: 5px; right: 7px;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  pointer-events: none;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s;
}
.camera-pip:hover .pip-drag-hint { opacity: 1; }



/* ── Camera PiP shapes ──────────────────────────────────────── */
.camera-pip[data-shape="default"] { border-radius: var(--radius); }
.camera-pip[data-shape="square"]  { border-radius: 0; }
.camera-pip[data-shape="round"]   { border-radius: 50%; }


/* ── Overlay arrastável da câmera (durante gravação) ─────────── */
#cam-overlay {
  position: absolute;
  z-index: 20;
  cursor: grab;
  box-sizing: border-box;
  border: 2px dashed rgba(255,255,255,0.55);
  background: transparent;
  transition: border-color 0.15s;
}
#cam-overlay:hover  { border-color: rgba(255,255,255,0.9); }
#cam-overlay.dragging { cursor: grabbing; border-color: var(--accent); transition: none; }
#cam-overlay[data-shape="round"]   { border-radius: 50%; }
#cam-overlay[data-shape="square"]  { border-radius: 0; }
#cam-overlay[data-shape="default"] { border-radius: 10px; }
/* Ícone de arrastar centralizado */
#cam-overlay::after {
  content: '⠿';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: rgba(255,255,255,0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
#cam-overlay:hover::after { opacity: 1; }

/* ── Controle de tamanho da câmera ──────────────────────────── */
.cam-size-control {
  display: flex;
  align-items: center;
  gap: 5px;
}

.cam-size-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.cam-size-btn:hover { background: var(--hover); border-color: var(--accent); color: var(--accent); }

.cam-size-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
.cam-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}
.cam-size-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

.cam-size-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  min-width: 30px;
  text-align: right;
}

/* ── Camera Filters Bar ──────────────────────────────────────── */
.camera-filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: 5px 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.camera-filters-bar.hidden { display: none; }

.cam-filter-sep {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.cam-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cam-filter-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.cam-filter-options { display: flex; gap: 4px; }

.cam-shape-btn, .cam-bg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.cam-shape-btn:hover, .cam-bg-btn:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--accent);
}
.cam-shape-btn.active, .cam-bg-btn.active {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
  font-weight: 600;
}
.cam-shape-btn.active svg { stroke: #0f172a; }

.cam-bg-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}
.cam-bg-btn.loading::after {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Recording Badge ─────────────────────────────────────────── */
.recording-badge {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(239,68,68,0.45);
  border-radius: 100px;
  padding: 6px 16px;
  z-index: 60;
}

.rec-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #ef4444;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

.rec-label { font-size: 12px; font-weight: 700; color: #ef4444; letter-spacing: 1px; }
.rec-time  { font-size: 13px; font-weight: 600; color: #ffffff; font-variant-numeric: tabular-nums; }

/* ── Annotation Overlay ──────────────────────────────────────── */
.ann-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
  border-radius: inherit;
}
.ann-canvas.ann-active {
  pointer-events: all;
  cursor: crosshair;
}
.ann-canvas.ann-active.ann-text-mode {
  cursor: text;
}

/* Toolbar vertical flutuante */
.ann-toolbar {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: rgba(12, 18, 35, 0.82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-radius: 18px;
  padding: 10px 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.09);
  transition: opacity 0.2s;
  user-select: none;
}
.ann-toolbar.hidden { display: none; }

.ann-tool-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.ann-tool-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  transform: scale(1.06);
}
.ann-tool-btn.ann-active {
  background: rgba(202, 153, 30, 0.22);
  color: #e4b234;
  box-shadow: inset 0 0 0 1.5px rgba(202,153,30,0.5);
}
.ann-tool-btn:active { transform: scale(0.93); }

.ann-color-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ann-color-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.ann-color-btn:hover { background: rgba(255,255,255,0.12); }
.ann-color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: block;
  border: 2.5px solid rgba(255,255,255,0.5);
  transition: transform 0.12s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.ann-color-btn:hover .ann-color-dot { transform: scale(1.18); }
#ann-color-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.ann-sep {
  width: 22px;
  height: 1px;
  background: rgba(255,255,255,0.11);
  margin: 3px 0;
  flex-shrink: 0;
}

/* Input flutuante para ferramenta de texto */
.ann-text-input {
  position: absolute;
  background: transparent;
  border: none;
  border-bottom: 2px solid currentColor;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  padding: 2px 6px;
  min-width: 80px;
  z-index: 25;
  caret-color: currentColor;
  text-shadow: 0 1px 5px rgba(0,0,0,0.65);
  letter-spacing: 0;
}

/* ── Controls Panel ──────────────────────────────────────────── */
.controls-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 32px 14px;
  background: var(--bg);
}

/* ── Mode Selector ───────────────────────────────────────────── */
.mode-selector {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3px;
  gap: 2px;
}

.mode-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border-radius: calc(var(--radius-lg) - 4px);
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
}
.mode-btn:hover   { color: var(--text); background: var(--accent-dim); }
.mode-btn.active  { background: var(--accent); color: #0f172a; font-weight: 700; }
.mode-btn.active svg { stroke: #0f172a; }

/* ── Controls Row ────────────────────────────────────────────── */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

/* Control group (mic / camera) */
.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.btn-control {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3);
  border: 2px solid var(--border);
  color: var(--text);
  transition: var(--transition);
}
.btn-control svg { width: 18px; height: 18px; }
.btn-control:hover   { border-color: var(--accent); color: var(--accent); }
.btn-control.active  { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.btn-control.muted   { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.4); color: #f87171; }

.control-label {
  font-size: 10px; font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

/* ── Record Button ───────────────────────────────────────────── */
.record-wrap { display: flex; flex-direction: column; align-items: center; }

.btn-record {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #ca991e, #e4b234);
  color: #0f172a;
  border: none;
  border-radius: var(--radius-xl);
  padding: 0 26px 0 16px;
  height: 54px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 4px 20px rgba(202,153,30,0.35);
  transition: var(--transition);
  position: relative;
}
.btn-record:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(202,153,30,0.5); }
.btn-record:active { transform: translateY(0); }

.btn-record.recording {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(239,68,68,0.35);
}
.btn-record.recording::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: calc(var(--radius-xl) + 5px);
  border: 2px solid rgba(239,68,68,0.5);
  animation: pulse-ring 1.5s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.08); opacity: 0; }
}

.record-icon-wrap {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,0.14);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.record-label { white-space: nowrap; }

/* ── AI Toggle ───────────────────────────────────────────────── */
.ai-toggle-row {
  width: 100%;
  max-width: 480px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.ai-toggle-label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.toggle-switch { position: relative; flex-shrink: 0; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
  display: block;
  width: 46px; height: 26px;
  background: var(--bg-3);
  border: 2px solid var(--border);
  border-radius: 100px;
  position: relative;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
  background: #ffffff;
}

.ai-toggle-info { display: flex; flex-direction: column; gap: 2px; }
.ai-title { font-size: 13px; font-weight: 600; color: var(--text); }
.ai-desc  { font-size: 11px; color: var(--text-muted); }

/* ── Upload Zone ─────────────────────────────────────────────── */
.upload-divider {
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}
.upload-divider::before,
.upload-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}
.upload-divider span {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.upload-zone {
  width: 100%;
  max-width: 480px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px 24px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.upload-zone.drag-over {
  transform: scale(1.01);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.upload-zone.is-loading {
  pointer-events: none;
  opacity: 0.4;
}

/* Upload modal */
.upload-modal-card {
  width: 100%;
  max-width: 480px;
}

.upm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.upm-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.upm-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.upm-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}
.upm-body .upload-zone {
  max-width: none;
  margin: 0;
}

/* ── Upload loading overlay ──────────────────────────────────── */
.upl-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  border-radius: var(--radius);
  animation: upl-fade-in 0.2s ease;
}
@keyframes upl-fade-in {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.upl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 36px 40px 32px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.14);
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.upl-icon-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upl-face-spin {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  animation: face-spin 1s linear infinite;
}

.upl-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upl-filename {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upl-status {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}
.upl-bar-wrap { margin-top: 6px; }
.upl-bar-track {
  height: 5px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}
.upl-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #e4b234);
  border-radius: 99px;
  transition: width 0.15s ease;
  width: 0%;
}
.upload-zone input[type="file"] {
  display: none;
}

.upload-zone-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.upload-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  transition: var(--transition);
}
.upload-zone:hover .upload-icon,
.upload-zone.drag-over .upload-icon {
  background: var(--accent);
  color: #0f172a;
}

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.upload-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
}
.upload-label strong {
  color: var(--accent);
  font-weight: 700;
}
.upload-hint {
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Error Message ───────────────────────────────────────────── */
.error-msg {
  width: 100%; max-width: 480px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: #fca5a5;
  text-align: center;
}

/* ============================================================
   TELA 2: ANÁLISE — Layout estilo Loom
   ============================================================ */

/* ── Loading Overlay ─────────────────────────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 300;
}

.loading-card {
  width: 420px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.loading-logo {
  display: flex; align-items: center; gap: 16px;
}
.loading-logo-text {
  font-size: 22px; font-weight: 700;
  color: var(--text);
}
.loading-logo-text .accent { color: var(--accent); }
.loading-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Stages */
.loading-stages { display: flex; flex-direction: column; gap: 10px; }

.l-stage {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}
.l-stage.active { color: var(--text); }
.l-stage.done   { color: #16a34a; }
.l-stage.pending { opacity: 0.4; }

.stage-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.l-stage.active .stage-dot { border-color: var(--accent); background: var(--accent-dim); }
.l-stage.done   .stage-dot { border-color: #16a34a; background: rgba(34,197,94,0.12); }

.stage-spinner {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  display: none;
}
.l-stage.active .stage-spinner { display: block; }
.l-stage.done .stage-spinner { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.stage-check { display: none; }
.l-stage.done .stage-check { display: block; }

/* Progress bar */
.progress-wrap { display: flex; align-items: center; gap: 12px; }

.progress-bar {
  flex: 1; height: 6px;
  background: var(--bg-2);
  border-radius: 100px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 100px;
  transition: width 0.5s ease;
}
.progress-pct { font-size: 12px; font-weight: 700; color: var(--accent); min-width: 36px; }

/* Frase rotativa de IA */
.ai-loading-phrase {
  margin: 14px 0 0;
  min-height: 20px;
  font-size: 13px;
  color: var(--text-3, #888);
  text-align: center;
  font-style: italic;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.ai-loading-phrase.visible { opacity: 1; }

/* ── Analysis Content (container absoluto, dois filhos: overlay + conteúdo) ── */
.analysis-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

/* ════════════════════════════════════════════════════════════
   TOPBAR (barra de título estilo Loom)
   ════════════════════════════════════════════════════════════ */
.loom-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
  flex-shrink: 0;
  min-height: 0;
}

.loom-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.btn-topback {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  background: var(--bg-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: var(--transition);
}
.btn-topback:hover { color: var(--text); border-color: var(--accent); }

.loom-title-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.loom-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* ── Edição inline do título ─────────────────────────────────── */
.loom-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.loom-title-wrap .loom-title {
  cursor: text;
}
.loom-title-wrap .loom-title:hover {
  color: var(--accent);
  text-decoration: underline dotted 1.5px;
  text-underline-offset: 3px;
}
.loom-edit-pen {
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  color: var(--text-dim);
  transition: opacity 0.15s, color 0.15s;
  line-height: 0;
}
.loom-title-wrap:hover .loom-edit-pen {
  opacity: 1;
  pointer-events: auto;
}
.loom-edit-pen:hover { color: var(--accent); }

/* Input de edição do título */
.loom-title-input {
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-2);
  border: 1.5px solid var(--accent);
  border-radius: 7px;
  padding: 2px 10px;
  outline: none;
  line-height: 1.2;
  min-width: 220px;
  max-width: 480px;
  width: auto;
  box-shadow: 0 0 0 3px rgba(202,153,30,0.12);
}
.loom-title-input:focus {
  box-shadow: 0 0 0 4px rgba(202,153,30,0.18);
}
.loom-title-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.loom-title-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
  flex-shrink: 0;
}
.loom-title-btn-ok  { background: var(--accent);         color: #fff; }
.loom-title-btn-ok:hover  { background: var(--accent-light); }
.loom-title-btn-cancel { background: var(--bg-2); color: var(--text-muted); border: 1px solid var(--border); }
.loom-title-btn-cancel:hover { background: var(--border); }

/* Remove hover no título quando o input está aberto */
.loom-title-wrap.editing .loom-title { pointer-events: none; }
.loom-title-wrap.editing .loom-edit-pen { display: none !important; }
.loom-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.loom-meta-brand { font-size: 12px; font-weight: 600; color: var(--accent); }
.loom-meta-file  { font-size: 12px; color: var(--text-muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loom-meta-dur   { font-size: 12px; color: var(--text-muted); }
.loom-views      { font-size: 12px; color: var(--text-dim); }
.meta-dot        { color: var(--text-dim); font-size: 12px; }

.loom-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-loom-dl {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: var(--transition);
  font-family: 'Poppins', sans-serif;
}
.btn-loom-dl:hover { border-color: var(--accent); color: var(--accent); }

.btn-loom-share {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px; font-weight: 700;
  color: #0f172a;
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-loom-share:hover { background: var(--accent-light); transform: translateY(-1px); }

/* ════════════════════════════════════════════════════════════
   LOOM BODY — duas colunas
   ════════════════════════════════════════════════════════════ */
.loom-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

/* ── Coluna principal (esquerda) ─────────────────────────────── */
.loom-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  max-width: 100%;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border-soft) transparent;
  isolation: isolate;
}
.loom-main::-webkit-scrollbar { width: 6px; }
.loom-main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* Wrapper centralizado que segura vídeo + reações + resumo */
.video-content-wrap {
  max-width: 800px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Card do vídeo — preview fechado, não full-width */
.video-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.06),
    0 8px 24px rgba(0,0,0,0.10),
    0 0 0 1px rgba(0,0,0,0.06);
  background: #000;
  flex-shrink: 0;
}

/* Palco do vídeo — 16:9 dentro do card */
.video-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.playback-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Barra de reações ────────────────────────────────────────── */
.reactions-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: #ffffff;
}
.react-group { display: flex; align-items: center; gap: 2px; }
.react-btn {
  font-size: 17px;
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1px;
  transition: var(--transition);
  background: none;
  position: relative;
}
.react-btn:hover { background: var(--accent-dim); transform: scale(1.12); }
.react-divider {
  width: 1px; height: 24px;
  background: var(--border-soft);
  margin: 0 8px;
}
.btn-comment {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
}
.btn-comment:hover { border-color: var(--accent); color: var(--accent); }
.btn-comment.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── React btn: estado ativo + contador ──────────────────────── */
.react-btn.active { background: var(--accent-dim); }
.react-btn.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--accent);
  pointer-events: none;
}
.react-count {
  font-size: 10px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: var(--accent);
  line-height: 1;
  margin-top: -2px;
}
@keyframes react-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.react-btn.pop { animation: react-pop 0.32s ease; }

/* ── Seção de comentários ─────────────────────────────────────── */
.comment-section {
  border-top: 1px solid var(--border-soft);
  padding: 16px 20px 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.comment-form {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.comment-form-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.comment-form-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.comment-form-right { flex: 1; min-width: 0; }
.comment-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-2);
  resize: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}
.comment-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
.comment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.btn-comment-cancel {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  color: var(--text-muted);
  background: none;
  transition: var(--transition);
}
.btn-comment-cancel:hover { color: var(--text); background: var(--bg-3); }
.btn-comment-submit {
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: #fff;
  background: var(--accent);
  transition: var(--transition);
}
.btn-comment-submit:hover { background: var(--accent-light); }
.btn-comment-submit:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Lista de comentários ─────────────────────────────────────── */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.comment-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.comment-item-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.comment-item-body { flex: 1; min-width: 0; }
.comment-item-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.comment-item-name { font-size: 13px; font-weight: 700; color: var(--text); }
.comment-item-time { font-size: 11px; color: var(--text-dim); }
.comment-item-text { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.comment-delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.comment-item:hover .comment-delete-btn { opacity: 1; }
.comment-delete-btn:hover { color: #f87171; }
@keyframes comment-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.comment-item { animation: comment-in 0.25s ease; }

/* ── Análise inline (resumo abaixo do vídeo, como Loom) ──────── */
.inline-analysis {
  padding: 28px 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
}
.ia-powered-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3px;
  align-self: flex-start;
}
.ia-section { display: flex; flex-direction: column; gap: 12px; }
.ia-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.ia-summary-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
}
.ia-bullet-list { display: flex; flex-direction: column; gap: 10px; }
.ia-bullet-list li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14px; color: var(--text-muted); line-height: 1.65;
}
.ia-bullet-list li::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 8px;
}

/* ════════════════════════════════════════════════════════════
   SIDEBAR (direita)
   ════════════════════════════════════════════════════════════ */
.loom-sidebar {
  width: 340px;
  max-width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--border-soft);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 0;
}

.sidebar-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Tabs da sidebar */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: var(--bg-2);
  padding: 0 12px;
}
.stab {
  flex: 1;
  padding: 11px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'Poppins', sans-serif;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  position: relative;
  bottom: -1px;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.stab:hover  { color: var(--text); }
.stab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Corpo da sidebar */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-body::-webkit-scrollbar { width: 5px; }
.sidebar-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* Painel de aba */
.spanel { display: flex; flex-direction: column; }

/* Seção dentro da sidebar */
.loom-sec {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.loom-sec:last-child { border-bottom: none; }

.loom-sec-header {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.loom-sec-header svg { stroke: var(--accent); flex-shrink: 0; }

/* Listas da sidebar */
.sidebar-list { display: flex; flex-direction: column; gap: 8px; }
.sidebar-list li {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ── Capítulos ───────────────────────────────────────────────── */
.chapters-list { display: flex; flex-direction: column; gap: 6px; }
.chapter-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.chapter-item:hover { border-color: var(--accent); background: var(--accent-dim); }
.chapter-num   { font-size: 10px; color: var(--text-dim); width: 18px; flex-shrink: 0; }
.chapter-time  {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--accent-dim); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px;
  white-space: nowrap; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.chapter-title { font-size: 12px; font-weight: 500; color: var(--text); line-height: 1.4; }

/* ── Sentiment Chart ─────────────────────────────────────────── */
.sentiment-chart { display: flex; flex-direction: column; gap: 10px; }
.sentiment-row   { display: flex; align-items: center; gap: 10px; }
.sentiment-label { font-size: 11px; font-weight: 600; color: var(--text-muted); width: 70px; flex-shrink: 0; }
.sentiment-bar-bg {
  flex: 1; height: 8px;
  background: var(--bg); border-radius: 100px; overflow: hidden;
  border: 1px solid var(--border-soft);
}
.sentiment-bar-fill { height: 100%; border-radius: 100px; transition: width 0.8s cubic-bezier(.4,0,.2,1); }
.sentiment-bar-fill.pos { background: #22c55e; }
.sentiment-bar-fill.neu { background: var(--accent); }
.sentiment-bar-fill.neg { background: #ef4444; }
.sentiment-pct { font-size: 11px; font-weight: 700; width: 32px; text-align: right; flex-shrink: 0; }

/* ── Waveform ────────────────────────────────────────────────── */
.waveform-visual {
  height: 60px;
  display: flex; align-items: center;
  justify-content: center; gap: 2px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 0 8px;
}
.wf-bar {
  width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-light));
  opacity: 0.85; flex-shrink: 0;
  animation: wf-idle 2s ease-in-out infinite;
}
.wf-bar:nth-child(odd)  { animation-delay: 0.1s; }
.wf-bar:nth-child(3n)   { animation-delay: 0.3s; }
@keyframes wf-idle { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }

/* Barras reais — sem animação idle, opacidade fixa */
.wf-bar.wf-real {
  animation: none;
  opacity: 1;
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
}

.wf-loading {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  padding: 10px 0;
}

/* Badge de origem da forma de onda */
.wf-source-badge {
  font-size: 10px;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  letter-spacing: 0.2px;
}
.wf-src-real {
  color: #16a34a;
  background: rgba(34,197,94,0.10);
}
.wf-src-fake {
  color: var(--text-dim);
  font-weight: 400;
  font-style: italic;
}

/* ── Player de áudio na tela de análise ─────────────────────── */
.rec-audio-section {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rec-audio-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.rec-audio-player {
  width: 100%;
  height: 36px;
  border-radius: var(--radius-sm);
  outline: none;
  accent-color: var(--accent);
}
.btn-download-audio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  align-self: flex-start;
}
.btn-download-audio:hover:not(:disabled) {
  background: var(--accent);
  color: #0f172a;
}
.btn-download-audio:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* ── Metric source badges ────────────────────────────────────── */
.metric-src {
  font-size: 10px;
  font-weight: 600;
  margin-top: 4px;
  border-radius: 4px;
  padding: 1px 6px;
  display: inline-block;
  letter-spacing: 0.2px;
}
.metric-src-calc {
  color: #16a34a;
  background: rgba(34,197,94,0.10);
}
.metric-src-ai {
  color: var(--accent);
  background: var(--accent-dim);
}
.metric-src-est {
  color: var(--text-dim);
  background: transparent;
}
.sentiment-src-row {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

/* ── Metrics Cards ───────────────────────────────────────────── */
.metrics-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.metric-card {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
}
.metric-value { font-size: 20px; font-weight: 800; color: var(--accent); line-height: 1; }
.metric-label { font-size: 10px; color: var(--text-muted); margin-top: 5px; font-weight: 500; }

/* ── Botões legados (mantidos por compatibilidade) ───────────── */
.btn-secondary {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 18px;
  font-size: 13px; font-weight: 600; color: var(--text);
  font-family: 'Poppins', sans-serif; transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  display: flex; align-items: center; gap: 6px;
  background: var(--accent); border: none;
  border-radius: var(--radius-sm); padding: 9px 20px;
  font-size: 13px; font-weight: 700; color: #0f172a;
  font-family: 'Poppins', sans-serif; transition: var(--transition);
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }

/* ── Scrollbar global ────────────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.14) transparent;
}

/* ── Transcrição inline ──────────────────────────────────────── */
.transcript-box {
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.transcript-text {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .loom-sidebar { width: 290px; }
}

@media (max-width: 820px) {
  /* Análise: empilha verticalmente */
  .loom-body       { flex-direction: column; }
  .loom-sidebar    { width: 100%; border-left: none; border-top: 1px solid var(--border-soft); max-height: 420px; }
  .video-stage     { aspect-ratio: 16/9; }
  .inline-analysis { padding: 20px 16px 28px; }

  /* Gravador */
  .controls-row { gap: 18px; }
  .btn-record { padding: 0 20px 0 14px; height: 50px; font-size: 13px; }
  .mode-btn { padding: 6px 12px; font-size: 11px; }
}

@media (max-width: 600px) {
  .header { padding: 12px 16px; }
  .controls-panel { padding: 10px 16px 12px; gap: 8px; }
  .mode-selector { flex-wrap: wrap; justify-content: center; }
  .metrics-cards { grid-template-columns: repeat(2, 1fr); }
  .settings-panel { width: calc(100vw - 32px); right: 16px; }
  .loom-topbar { padding: 10px 14px; gap: 10px; }
  .loom-title { font-size: 14px; }
  .loom-meta  { display: none; }
  .btn-loom-dl { display: none; }
  .reactions-bar { padding: 10px 14px; }
  .inline-analysis { padding: 16px; }
}

/* ============================================================
   TELA 0: LOGIN
   ============================================================ */
.login-bg {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(202,153,30,0.07) 0%, transparent 60%),
    #f7f8fa;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-xl);
  padding: 40px 36px 36px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeDown 0.3s ease;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-brand {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.login-tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lform-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.lform-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.pass-row {
  display: flex;
  position: relative;
}
.pass-row .input-field {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  flex: 1;
}

.btn-show-pass {
  width: 42px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}
.btn-show-pass:hover { color: var(--accent); }

.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #0f172a;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(202,153,30,0.3);
  transition: var(--transition);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(202,153,30,0.45); }
.btn-login:active { transform: translateY(0); }

.login-default-hint {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.7;
}
.login-default-hint strong { color: var(--text-muted); }

/* ── Header User Badge ──────────────────────────────────────── */
.header-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 100px;
}

.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.header-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-admin-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(202,153,30,0.12);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
}
.btn-admin-badge:hover { background: var(--accent); color: #0f172a; }

/* ============================================================
   TELA 3: ADMIN
   ============================================================ */

/* Header do admin */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
  z-index: 100;
  flex-shrink: 0;
}
.admin-header-left  { display: flex; align-items: center; gap: 14px; }
.admin-header-right { display: flex; align-items: center; gap: 10px; }

.admin-panel-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  letter-spacing: 0.3px;
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Admin Layout ────────────────────────────────────────────── */
.admin-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Admin Sidebar ───────────────────────────────────────────── */
.admin-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border-soft);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.anav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}
.anav-item svg { flex-shrink: 0; }
.anav-item:hover { color: var(--text); background: var(--accent-dim); }
.anav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  font-weight: 700;
}
.anav-item.active svg { stroke: var(--accent); }

.anav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Seção Exclusões Pendentes ───────────────────────────────── */
.del-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 0;
  color: var(--text-muted);
}
.del-empty-icon { font-size: 40px; }

.del-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-2);
}
.del-bulk-info {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.del-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-del-bulk-approve,
.btn-del-bulk-reject {
  padding: 7px 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-del-bulk-approve {
  background: #dcfce7;
  color: #15803d;
}
.btn-del-bulk-reject {
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
}
.btn-del-bulk-approve:hover:not(:disabled),
.btn-del-bulk-reject:hover:not(:disabled) {
  opacity: .85;
  transform: translateY(-1px);
}
.btn-del-bulk-approve:disabled,
.btn-del-bulk-reject:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}
.td-select {
  width: 42px;
  text-align: center !important;
}
.del-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.btn-del-preview,
.btn-del-approve,
.btn-del-reject {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition);
}
.btn-del-preview {
  background: var(--bg-3);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}
.btn-del-preview:hover { opacity: .8; }
.btn-del-approve {
  background: #dcfce7;
  color: #15803d;
}
.btn-del-approve:hover { opacity: .8; }
.btn-del-reject {
  background: var(--bg-3);
  color: var(--text-muted);
}
.btn-del-reject:hover { opacity: .8; }

.del-urgent  { color: #dc2626; font-weight: 700; }
.del-warning { color: #d97706; font-weight: 600; }
.del-owner-label { font-size: 10px; color: var(--text-dim); display: block; }

/* ── Modal de confirmação de exclusão com senha ─────────────── */
.del-pwd-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 4px; line-height: 1.5; }
.del-pwd-confirm-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: 8px;
  background: #dc2626; color: #fff;
  font-size: 0.85rem; font-weight: 600; font-family: 'Poppins', sans-serif;
  cursor: pointer; transition: background .15s;
}
.del-pwd-confirm-btn:hover:not(:disabled) { background: #b91c1c; }
.del-pwd-confirm-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Admin Content ───────────────────────────────────────────── */
.admin-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border-soft) transparent;
}
.admin-content::-webkit-scrollbar { width: 6px; }
.admin-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.admin-section { padding: 28px 32px 40px; max-width: 1100px; }

/* Section header */
.admin-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.asec-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}
.asec-sub { font-size: 13px; color: var(--text-muted); }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius);
  padding: 20px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--border); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.stat-icon { font-size: 26px; flex-shrink: 0; }
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ── Recent List ─────────────────────────────────────────────── */
.admin-table-section { margin-top: 4px; }
.admin-subsec-header {
  margin-bottom: 14px;
}
.admin-subsec-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.recent-list { display: flex; flex-direction: column; gap: 8px; }

.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.recent-item:hover { border-color: var(--border); }

.recent-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.recent-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.recent-filename {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-user  { font-size: 11px; color: var(--text-muted); }
.recent-meta  { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.recent-dur   { font-size: 12px; font-weight: 700; color: var(--accent); }
.recent-date  { font-size: 11px; color: var(--text-dim); }

.btn-play-sm {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.btn-play-sm:hover { background: var(--accent); color: #0f172a; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  font-size: 14px;
  font-style: italic;
}

/* ── Profile Popup ───────────────────────────────────────────── */
.profile-popup-wrap { position: relative; }

.header-user-badge { cursor: pointer; }

.profile-popup {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 272px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  z-index: var(--z-dropdown);
  animation: pp-in 0.16s cubic-bezier(.4,0,.2,1);
}
@keyframes pp-in {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0);    }
}

.pp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.pp-head-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f172a;
  font-weight: 700;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.pp-head-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  font-family: inherit;
  text-align: left;
}
.pp-item:hover { background: var(--bg-2); }
.pp-item svg   { color: var(--text-muted); flex-shrink:0; }

.pp-sep {
  height: 1px;
  background: var(--border-soft);
  margin: 10px 0;
}

.pp-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.pp-pass-section { display: flex; flex-direction: column; gap: 7px; }

.pp-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.pp-input:focus { border-color: var(--accent); background: var(--bg); }

.pp-msg {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.pp-msg.error   { background: #fee2e2; color: #b91c1c; }
.pp-msg.success { background: #dcfce7; color: #15803d; }

.pp-save-btn {
  width: 100%;
  padding: 8px;
  background: var(--accent);
  color: #0f172a;
  font-weight: 600;
  font-size: 13px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
}
.pp-save-btn:hover { background: var(--accent-light); }
.pp-save-btn:disabled { opacity: .6; cursor: default; }

/* ── FAB: Gravar vídeo ───────────────────────────────────────── */
.fab-record {
  position: fixed;
  bottom: 28px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  background: #0f172a;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 50px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.28);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  z-index: var(--z-panel);
  white-space: nowrap;
}
.fab-record svg {
  animation: fab-spin 10s linear infinite;
  flex-shrink: 0;
}
.fab-record:hover {
  background: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.36);
}
.fab-record:active { transform: translateY(0); }

@keyframes fab-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Admin Table ─────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-3);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table thead tr {
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-3);
}
.admin-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: rgba(202,153,30,0.07); }
.admin-table tbody tr.row-inactive td { opacity: 0.5; }

.td-email  { color: var(--text-muted); font-size: 12px; }
.td-date   { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.td-center { text-align: center; }
.td-file   { max-width: 240px; }
.td-empty  { text-align: center; color: var(--text-dim); padding: 40px !important; font-style: italic; }

/* User cell */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar-sm {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  overflow: hidden;
  justify-content: center;
  flex-shrink: 0;
}

.file-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.file-cell span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Role & status badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.role-admin {
  background: rgba(202,153,30,0.15);
  color: var(--accent);
  border: 1px solid var(--border);
}
.role-gestor {
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.3);
}
.role-user {
  background: var(--bg-2);
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.status-active   { background: rgba(34,197,94,0.10);  color: #16a34a; border: 1px solid rgba(34,197,94,0.22); }
.status-inactive { background: rgba(239,68,68,0.08);  color: #dc2626; border: 1px solid rgba(239,68,68,0.20); }

/* Action buttons */
.action-btns { display: flex; align-items: center; gap: 6px; }

.btn-table-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}
.btn-table-action:hover     { border-color: var(--accent); background: var(--accent-dim); }
.btn-table-action.btn-danger:hover { border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.1); }

.filter-select {
  flex: none;
  width: 200px;
  height: 40px;
  padding: 0 14px;
}

/* ── Barra de filtros da seção de usuários ───────────────── */
.users-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 16px;
}
.input-icon-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.input-icon-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
.input-icon-wrap .input-field {
  width: 100%;
  padding-left: 34px;
  height: 38px;
  box-sizing: border-box;
}
.users-filter-bar .filter-select {
  width: 200px;
  height: 38px;
  flex: none;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: 24px;
}

.modal-card {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 0;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.13), 0 0 0 1px rgba(0,0,0,0.04);
  animation: fadeDown 0.2s ease;
  overflow: hidden;
}
.modal-card-wide { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.modal-title-trunc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 500px;
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-2);
}

/* ── Avatar upload no modal de usuário ──────────────────────── */
.modal-avatar-area {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 4px 0 8px;
}
.modal-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f172a;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--border);
}
.modal-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.modal-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-avatar-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.btn-avatar-upload:hover {
  background: var(--bg-3);
  border-color: var(--accent);
}
.btn-avatar-remove {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(220,38,38,0.3);
  background: rgba(220,38,38,0.06);
  color: #dc2626;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.btn-avatar-remove:hover { background: rgba(220,38,38,0.12); }

/* Player modal */
.play-video-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  position: relative;
}
.play-video-wrap .pp-wrap,
.play-video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  border-radius: var(--radius);
}

/* Player no palco 16:9 */
.video-stage .pp-wrap,
.video-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0 0;
}
.admin-player-meta span strong { color: var(--text); font-weight: 600; }

/* ── Admin Toast ─────────────────────────────────────────────── */
.admin-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  z-index: 500;
  animation: fadeDown 0.2s ease;
  white-space: nowrap;
  pointer-events: none;
}
.admin-toast-success {
  background: rgba(74,222,128,0.14);
  border: 1px solid rgba(74,222,128,0.28);
  color: #16a34a;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.admin-toast-error {
  background: rgba(239,68,68,0.10);
  border: 1px solid rgba(239,68,68,0.28);
  color: #dc2626;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* ── Admin responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-section { padding: 20px 16px 32px; }
}

@media (max-width: 640px) {
  .admin-sidebar { width: 56px; }
  .anav-item span, .anav-item svg + * { display: none; }
  .anav-item { justify-content: center; padding: 12px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .modal-card { max-width: calc(100vw - 32px); }
  .admin-header .logo-text .admin-panel-label { display: none; }
}

/* ================================================================
   DASHBOARD / CENTRAL DE GRAVAÇÕES
   ================================================================ */

/* ── Dashboard Header ──────────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
  flex-shrink: 0;
  z-index: 100;
}

.dash-search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}
.dash-search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  pointer-events: none;
  flex-shrink: 0;
}
.dash-search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
}
.dash-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-secondary {
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  color: var(--text);
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Dashboard Layout ──────────────────────────────────────────── */
.dash-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Dashboard Sidebar — removida; mantida por compatibilidade ── */
.dash-sidebar {
  display: none;
  overflow-y: auto;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-sidebar-section { display: flex; flex-direction: column; gap: 2px; }
.dash-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: 0 8px 6px;
}

.dnav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
  transition: var(--transition);
}
.dnav-item:hover { background: var(--accent-dim); color: var(--text); }
.dnav-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }

/* ── Dashboard Main ────────────────────────────────────────────── */
.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Metric Cards Row ──────────────────────────────────────────── */
.dash-metrics-row {
  display: flex;
  gap: 12px;
  padding: 16px 20px 0;
  flex-shrink: 0;
}

.dmc {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius);
  padding: 14px 18px;
  flex: 1;
  min-width: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  transition: var(--transition);
}
.dmc:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}
.dmc-icon {
  flex-shrink: 0;
  color: var(--text);
  opacity: 0.75;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dmc-val  { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.dmc-lbl  { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

/* ── Filter Bar ────────────────────────────────────────────────── */
.dash-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.filter-select-sm {
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.filter-select-sm:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Date range */
.date-range-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.date-range-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.filter-date-sm {
  height: 34px;
  padding: 0 8px;
  font-size: 12px;
  font-family: inherit;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  width: 128px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.filter-date-sm:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Spacer que empurra botões de ação para a direita */
.filter-bar-spacer { flex: 1; min-width: 0; }

/* Botões de ação da barra (Favoritas / Arquivadas) */
.filter-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.filter-action-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.10); }
.filter-action-btn.btn-active-mode {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(202,153,30,0.30);
}

/* Toggle grade / lista */
.view-toggle-group {
  display: flex;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.view-toggle-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.view-toggle-btn + .view-toggle-btn { border-left: 1px solid rgba(0,0,0,0.07); }
.view-toggle-btn.active { background: var(--accent-dim); color: var(--accent); }
.view-toggle-btn:hover:not(.active) { color: var(--accent); background: var(--bg-2); }

/* ── Dash Body + Grid ──────────────────────────────────────────── */
.dash-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 24px;
}

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-top: 4px;
}

/* ── Modo Lista ────────────────────────────────────────────────── */
.rec-grid--list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rec-grid--list .rec-section-divider { margin: 4px 0; }

.rec-list-item {
  display: grid;
  grid-template-columns: 52px 1fr 130px 90px 95px 52px 54px minmax(0,140px) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}
.rec-list-item:hover { border-color: var(--border); background: var(--bg-2); }
.rec-list-item--archived { opacity: 0.6; }

.rli-thumb {
  width: 52px;
  height: 34px;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.rli-icon { font-size: 18px; }

.rli-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.rli-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rli-status { font-size: 11px; font-weight: 700; white-space: nowrap; }
.rli-date   { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.rli-dur    { font-size: 11px; font-weight: 700; color: var(--accent); white-space: nowrap; text-align: center; }
.rli-score  { font-size: 12px; font-weight: 800; color: var(--accent); text-align: center; }
.rli-score small { font-size: 9px; font-weight: 500; opacity: 0.6; }
.rli-score--empty { color: var(--text-dim); font-size: 11px; text-align: center; }
.rli-bitrix {
  font-size: 10px;
  color: #7c3aed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.rli-bitrix--empty {}
.rli-actions {
  display: flex;
  gap: 3px;
  justify-content: flex-end;
  flex-shrink: 0;
}
/* Estrela favorito na lista não precisa de position absolute */
.rec-list-item .rc-fav-star {
  position: static;
  opacity: 1;
  width: 28px;
  height: 28px;
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  font-size: 13px;
}
.rec-list-item .rc-fav-star.active { background: rgba(255,215,0,0.15); border-color: #f59e0b; }

/* ── Empty State ────────────────────────────────────────────────── */
.rec-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 72px;
  text-align: center;
  gap: 0;
  user-select: none;
}

.res-icon {
  width: 100px;
  height: 100px;
  background: var(--bg-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.res-icon svg { opacity: 0.6; }

.res-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  max-width: 340px;
}

.res-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 320px;
  margin-bottom: 0;
}

.res-cta-wrap {
  margin-top: 24px;
}

.res-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
}
.res-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.res-cta.btn-accent {
  background: linear-gradient(135deg, #ca991e, #e4b234);
  color: #0f172a;
  border: none;
  box-shadow: 0 3px 14px rgba(202,153,30,0.3);
}
.res-cta.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(202,153,30,0.45);
  color: #0f172a;
  background: linear-gradient(135deg, #ca991e, #e4b234);
}

/* ── Recording Card ────────────────────────────────────────────── */
.rec-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.rec-card:hover { border-color: var(--border); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.10); }
.rec-card--archived { opacity: 0.65; }

/* Estrela de favorito no thumbnail */
.rc-fav-star {
  position: absolute;
  top: 7px;
  left: 8px;
  z-index: 10;
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
  background: rgba(255,255,255,0.88);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,0,0,0.08);
  cursor: pointer;
}
.rec-card:hover .rc-fav-star,
.rc-fav-star.active { opacity: 1; }
.rc-fav-star.active { background: rgba(255,215,0,0.2); border-color: #f59e0b; }

/* Faixa horizontal de favoritos — scroll lateral, linha única */
.rec-favs-row {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  gap: 16px;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.rec-favs-row::-webkit-scrollbar { height: 4px; }
.rec-favs-row::-webkit-scrollbar-track { background: transparent; }
.rec-favs-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Cada card na faixa de favoritos: largura fixa para não encolher */
.rec-favs-row .rec-card {
  flex: 0 0 280px;
  width: 280px;
  min-width: 0;
}

/* Seção de Favoritos no grid */
.rec-section-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  padding: 8px 0 8px;
  letter-spacing: -0.2px;
}
.rec-section-favs { color: var(--text); }
.rec-section-count {
  background: var(--bg-3);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
.rec-section-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: rgba(0,0,0,0.12);
  margin: 14px 0 10px;
}
.rec-grid--list .rec-section-header { padding: 10px 14px; margin-bottom: 2px; }

/* Botão arquivar ativo */
.rc-btn-archive--on { background: rgba(202,153,30,0.12); border-color: var(--accent) !important; color: var(--accent) !important; }

.rc-thumb {
  position: relative;
  height: 130px;
  overflow: hidden;
  flex-shrink: 0;
}
.rc-thumb-inner {
  position: relative; /* contém o <video> absoluto */
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rc-thumb-icon { font-size: 40px; }

.rc-dur {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(255,255,255,0.12);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.rc-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  background: rgba(0,0,0,0.42);
}
.rec-card:hover .rc-play-overlay { opacity: 1; }
.rc-btn-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.rc-btn-play:hover { transform: scale(1.1); }

.rc-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.rc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.rc-tags { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }

.rc-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}
.rc-status-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,0.05);
}

.rc-score {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  white-space: nowrap;
}
.rc-score span { font-size: 10px; font-weight: 500; opacity: 0.7; }

.rc-filename {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-sentiment { display: flex; flex-direction: column; gap: 4px; }
.rc-sent-bar {
  height: 5px;
  border-radius: 100px;
  background: var(--bg-3);
  display: flex;
  overflow: hidden;
}
.rc-sent-pos { background: #4ade80; }
.rc-sent-neu { background: var(--accent); }
.rc-sent-neg { background: #f87171; }
.rc-sent-lbl { font-size: 10px; color: var(--text-muted); }
.rc-no-analysis { font-size: 11px; color: var(--text-dim); font-style: italic; }

.rc-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.rc-meta { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.rc-user {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.rc-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f172a;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.rc-date, .rc-size { font-size: 10px; color: var(--text-dim); }

.rc-actions { display: flex; gap: 4px; flex-shrink: 0; }
.rc-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.rc-btn:hover { border-color: var(--accent); color: var(--accent); }
.rc-btn-delete:hover { border-color: rgba(248,113,113,0.5); color: #f87171; }

/* ── Type Selection Modal ──────────────────────────────────────── */
.type-modal-card { max-width: 520px; overflow: visible; }
.type-modal-sub {
  padding: 0 22px 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
}

.type-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 18px 22px 22px;
}

.type-option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 18px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: var(--transition);
}
.type-option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-2px);
}
.to-icon  { font-size: 28px; }
.to-label { font-size: 12px; font-weight: 700; color: var(--text); }

/* Tooltip de descrição ao hover */
.type-option-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #f1f5f9;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: normal;
  width: 200px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
}
/* Setinha embaixo do tooltip */
.type-option-btn[data-tip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 6px solid transparent;
  border-top-color: #0f172a;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
}
.type-option-btn[data-tip]:hover::after,
.type-option-btn[data-tip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Step Bitrix (dentro do type-modal) ───────────────────────── */
.bitrix-step-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px 24px;
  gap: 14px;
  width: 100%;
}

/* estados: loading / error / empty */
.bitrix-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  width: 100%;
}
.bitrix-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: bitrix-spin 0.75s linear infinite;
}
@keyframes bitrix-spin { to { transform: rotate(360deg); } }
.bitrix-state-icon { font-size: 36px; line-height: 1; }
.bitrix-state-msg {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  max-width: 300px;
  line-height: 1.5;
}
.btn-bitrix-retry {
  font-size: 12px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: var(--accent);
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-bitrix-retry:hover { background: var(--accent-dim); }

/* select */
.bitrix-input-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
/* ── Busca de negócios ─────────────────────────────────────────── */
.bitrix-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
}
.bitrix-search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.bitrix-search-input {
  width: 100%;
  padding: 9px 40px 9px 34px;
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.15s;
  outline: none;
}
.bitrix-search-input:focus {
  border-color: var(--accent);
}
.bitrix-search-input::placeholder {
  color: var(--text-muted);
  font-size: 12px;
}
.bitrix-deal-count {
  position: absolute;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Lista de negócios ─────────────────────────────────────────── */
.bitrix-deal-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  width: 100%;
  margin-bottom: 8px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.bitrix-deal-list::-webkit-scrollbar       { width: 4px; }
.bitrix-deal-list::-webkit-scrollbar-track { background: transparent; }
.bitrix-deal-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.bitrix-deal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  text-align: left;
  font-family: 'Poppins', sans-serif;
}
.bitrix-deal-item:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.bitrix-deal-item.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.bdi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bdi-company {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.bdi-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.bdi-id {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.bdi-stage {
  font-size: 10px;
  font-weight: 600;
  color: #6d28d9;
  background: #ede9fe;
  border-radius: 3px;
  padding: 2px 6px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* nenhum resultado */
.bitrix-deal-empty {
  text-align: center;
  padding: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

/* marca o trecho encontrado na busca */
.bdi-highlight {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 2px;
  padding: 0 1px;
}

/* preview do card selecionado */
.bitrix-card-preview {
  width: 100%;
  background: var(--bg-2);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 4px;
  animation: bcp-in 0.2s ease;
}
@keyframes bcp-in {
  from { opacity:0; transform:translateY(4px); }
  to   { opacity:1; transform:translateY(0); }
}
.bcp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.bcp-icon { font-size: 16px; flex-shrink: 0; }
.bcp-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.bcp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.bcp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.bcp-meta-stage {
  background: #ede9fe;
  color: #6d28d9;
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 600;
}
.bcp-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3px;
}

/* ── Seletor de fluxo ──────────────────────────────────────────── */
.flow-selector-section {
  width: 100%;
}
.flow-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.flow-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Poppins', sans-serif;
  width: 100%;
}
.flow-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.flow-btn.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}
.flow-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color var(--transition);
}
.flow-btn-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
  transition: color var(--transition);
}
.flow-btn:hover .flow-btn-icon,
.flow-btn:hover .flow-btn-label  { color: var(--accent); }
.flow-btn.active .flow-btn-icon,
.flow-btn.active .flow-btn-label { color: var(--accent); }

/* separador entre fluxo e negócio */
.bitrix-deal-section-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

/* ações */
.bitrix-step-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}
.btn-bitrix-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
}
.btn-bitrix-confirm:hover:not(:disabled) { background: var(--accent-light); }
.btn-bitrix-confirm:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-bitrix-skip {
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'Poppins', sans-serif;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s;
}
.btn-bitrix-skip:hover { color: var(--text-muted); }

/* ── Share Modal ───────────────────────────────────────────────── */
.share-privacy-row { display: flex; flex-direction: column; gap: 10px; }
.share-privacy-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  color: var(--text-muted);
}
.share-privacy-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text);
}
.share-link-row {
  display: flex;
  gap: 8px;
}
.share-link-row .input-field {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Mock Viewer Modal ─────────────────────────────────────────── */
.mv-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  flex-wrap: wrap;
}

/* ── Success Overlay ───────────────────────────────────────────── */
.success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  animation: success-fade-in 0.35s ease;
}
@keyframes success-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  position: relative;
}

.success-checkmark {
  width: 100px;
  height: 100px;
  position: relative;
}
.success-svg { width: 100%; height: 100%; overflow: visible; }

.success-circle {
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  animation: draw-circle 0.6s cubic-bezier(.4,0,.2,1) 0.1s forwards;
  transform-origin: center;
  transform: rotate(-90deg);
}
@keyframes draw-circle {
  to { stroke-dashoffset: 0; }
}

.success-tick {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw-tick 0.4s cubic-bezier(.4,0,.2,1) 0.65s forwards;
}
@keyframes draw-tick {
  to { stroke-dashoffset: 0; }
}

.success-title {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
  animation: success-rise 0.5s ease 0.7s both;
}
.success-sub {
  font-size: 14px;
  color: #64748b;
  animation: success-rise 0.5s ease 0.85s both;
}
@keyframes success-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Confetti sparks */
.success-sparks {
  position: absolute;
  inset: -80px;
  pointer-events: none;
  overflow: visible;
}
.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: spark-fly 0.9s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes spark-fly {
  0%   { transform: translate(0,0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) rotate(var(--tr)) scale(0.3); opacity: 0; }
}

/* ── Countdown Overlay ─────────────────────────────────────────── */
.countdown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  gap: 12px;
}
.countdown-number {
  font-size: 120px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 50px rgba(202,153,30,0.30);
  animation: countdown-pop 1s ease;
}
@keyframes countdown-pop {
  0%   { transform: scale(1.3); opacity: 0.5; }
  40%  { transform: scale(1);   opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}
.countdown-pop {
  animation: countdown-pop 0.9s ease;
}
.countdown-label {
  font-size: 15px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.3px;
}

/* ── Recorder: type badge ──────────────────────────────────────── */
.rec-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  color: var(--accent);
}

/* ── Tipo badge no título ──────────────────────────────────────── */
.vtype-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 2px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  vertical-align: middle;
}

/* ── Insight items — novo formato (card com título + desc + impacto) ── */
.insight-card {
  display: flex !important;
  gap: 10px !important;
  padding: 12px !important;
  background: var(--bg-2) !important;
  border: 1px solid var(--border-soft) !important;
  border-left: 3px solid var(--accent) !important;
}
.insight-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  padding-top: 1px;
  min-width: 20px;
}
.insight-body  { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.insight-title { font-size: 12px; font-weight: 700; color: var(--text); }
.insight-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.insight-impact {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 11px;
  color: #16a34a;
  margin-top: 2px;
  line-height: 1.5;
}
.insight-impact svg { flex-shrink: 0; margin-top: 1px; }

/* ── Análise Detalhada (dentro do panel-metrics) ───────────────── */
.analise-deep-section { margin-bottom: 4px; }

.analise-clareza {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border-left: 3px solid transparent;
}
.clareza-excelente { background: rgba(34,197,94,0.10);  border-left-color: #16a34a; }
.clareza-boa       { background: rgba(59,130,246,0.09); border-left-color: #3b82f6; }
.clareza-regular   { background: rgba(234,179,8,0.12);  border-left-color: #ca8a04; }
.clareza-confusa   { background: rgba(239,68,68,0.09);  border-left-color: #dc2626; }

.analise-clareza-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.analise-clareza-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.analise-clareza-badge { font-size: 11px; font-weight: 700; color: var(--text); }
.analise-clareza-comment { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

.analise-org {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.analise-org strong { color: var(--text); }

.analise-group { margin-bottom: 10px; }
.analise-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin-bottom: 6px;
  padding-left: 2px;
}
.analise-pf-list, .analise-pa-list { display: flex; flex-direction: column; gap: 5px; }
.analise-pf-item, .analise-pa-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.analise-pf-item { background: rgba(34,197,94,0.09); }
.analise-pa-item { background: rgba(249,115,22,0.09); }
.pf-icon, .pa-icon { flex-shrink: 0; font-size: 13px; }

.analise-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  padding: 8px 10px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
}

.prio-list  { display: flex; flex-direction: column; gap: 6px; }
.prio-item  { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); border-left: 3px solid transparent; }
.prio-alta  { background: rgba(239,68,68,0.09);  border-left-color: #dc2626; }
.prio-media { background: rgba(234,179,8,0.10);  border-left-color: #ca8a04; }
.prio-baixa { background: rgba(34,197,94,0.09);  border-left-color: #16a34a; }
.prio-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; padding-top: 1px; }
.prio-desc  { font-size: 12px; color: var(--text); line-height: 1.5; }

/* ── Capítulo com resumo ───────────────────────────────────────── */
.chapter-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 6px;
}
.chapter-item:hover { border-color: var(--accent); }
.chapter-header { display: flex; align-items: center; gap: 8px; }
.chapter-content { display: flex; flex-direction: column; gap: 3px; padding-left: 30px; }
.chapter-resumo  { font-size: 11px; color: var(--text-dim); line-height: 1.5; }

/* ── Ações Recomendadas — novo formato completo ────────────────── */
.na-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  transition: var(--transition);
}
.na-item:hover { filter: brightness(1.06); }
.na-item.action-high { background: rgba(248,113,113,0.22); border-left-color: #f87171; }
.na-item.action-med  { background: rgba(250,204,21,0.20);  border-left-color: #facc15; }
.na-item.action-low  { background: rgba(74,222,128,0.18);  border-left-color: #4ade80; }

.na-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.na-prio-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}
.na-motivo {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 4px 0 0;
}
.na-resultado {
  font-size: 11px;
  color: #16a34a;
  line-height: 1.5;
}

/* ── Insight items (positivo / atenção / neutro) ───────────────── */
.insights-list, .actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  font-size: 12px;
  line-height: 1.6;
  transition: var(--transition);
}
.insight-item:hover { filter: brightness(1.06); }

.insight-pos {
  background: rgba(34,197,94,0.09);
  border-left-color: #16a34a;
}
.insight-warn {
  background: rgba(249,115,22,0.10);
  border-left-color: #ea580c;
}
.insight-neu {
  background: rgba(202,153,30,0.10);
  border-left-color: var(--accent);
}

.insight-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.insight-text { color: var(--text); }

/* ── Action items (alta / média / baixa) ───────────────────────── */
.action-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  font-size: 12px;
  transition: var(--transition);
}
.action-item:hover { filter: brightness(1.06); }

.action-high {
  background: rgba(239,68,68,0.09);
  border-left-color: #dc2626;
}
.action-med {
  background: rgba(234,179,8,0.10);
  border-left-color: #ca8a04;
}
.action-low {
  background: rgba(34,197,94,0.09);
  border-left-color: #16a34a;
}

.action-prio-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.action-text { color: var(--text); line-height: 1.6; }

/* ── Analysis: Transcript Panel ────────────────────────────────── */
.transcript-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.input-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  flex: 1;
}
.transcript-panel-text {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.transcript-placeholder {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}
.transcript-full-text {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-muted);
  white-space: pre-wrap;
}
mark.transcript-highlight {
  background: rgba(202,153,30,0.22);
  color: #92610a;
  border-radius: 2px;
}

/* ── Analysis: Next Actions Panel ──────────────────────────────── */
.nextactions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}
.na-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.na-item:hover { border-color: var(--border); }
.na-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}
.na-content { flex: 1; min-width: 0; }
.na-acao {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.na-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.na-resp, .na-prazo, .na-supervisor {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-3);
  padding: 1px 7px;
  border-radius: 4px;
}
.na-empty {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

.btn-copy-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Analysis: "Nova gravação" button ──────────────────────────── */
.btn-new-from-analysis {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.btn-new-from-analysis:hover { border-color: var(--accent); color: var(--accent); }

/* ── Dashboard Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .rec-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .dash-metrics-row { gap: 8px; }
}

@media (max-width: 640px) {
  .dash-header   { padding: 10px 16px; gap: 8px; }
  .dash-search-wrap { display: none; }
  .rec-grid { grid-template-columns: 1fr; }
  .dash-metrics-row { padding: 12px 14px 0; }
  .type-options-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════
   TYPE-SPECIFIC FIELDS  (renderTypeSpecificFields)
   ═══════════════════════════════════════════════════════════════ */

.ts-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* ── Block wrapper ─────────────────────────────────────────────── */
.ts-block {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.ts-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-soft);
}
.ts-block-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.ts-collapse-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: var(--transition);
  line-height: 1;
}
.ts-collapse-btn:hover { background: var(--bg-3); color: var(--accent); }
.ts-block-body {
  padding: 12px 14px;
}

/* ── Generic text block ────────────────────────────────────────── */
.ts-text-block {
  font-size: 12px;
  color: var(--text);
  line-height: 1.65;
  margin: 0;
}

/* ── Simple list ───────────────────────────────────────────────── */
.ts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ts-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}
.ts-icon {
  flex-shrink: 0;
  font-size: 13px;
  margin-top: 1px;
}

/* ── Ata / mensagem copyable box ───────────────────────────────── */
.ts-ata-wrap, .ts-msg-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ts-ata-text, .ts-msg-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.7;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.ts-copy-btn {
  align-self: flex-start;
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: var(--transition);
}
.ts-copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Tarefa / pendência rows ───────────────────────────────────── */
.ts-tarefa-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ts-tarefa-row {
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  padding: 8px 10px;
}
.ts-pendencia-row {
  border-left: 3px solid #f59e0b;
}
.ts-tarefa-acao {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.4;
}
.ts-tarefa-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ts-meta-chip {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-3);
  border-radius: 4px;
  padding: 2px 7px;
  line-height: 1.5;
}
.ts-prio-chip { font-weight: 700; }
.ts-prio-alta  { background: rgba(220,38,38,0.10); color: #dc2626; }
.ts-prio-media { background: rgba(245,158,11,0.12); color: #b45309; }
.ts-prio-baixa { background: rgba(22,163,74,0.10);  color: #16a34a; }

/* ── Passo a passo ─────────────────────────────────────────────── */
.ts-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ts-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ts-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.ts-step-body { flex: 1; }
.ts-step-acao {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
.ts-step-obs {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-style: italic;
  line-height: 1.4;
}

/* ── Checklist ─────────────────────────────────────────────────── */
.ts-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ts-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.5;
}
.ts-checkbox {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.ts-check-item:has(.ts-checkbox:checked) span {
  text-decoration: line-through;
  color: var(--text-dim);
}

/* ── Métricas avançadas (barras) ───────────────────────────────── */
.ts-metric-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ts-metric-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ts-metric-bar-label {
  font-size: 11px;
  color: var(--text-muted);
  width: 90px;
  flex-shrink: 0;
}
.ts-metric-bar-bg {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-3);
  overflow: hidden;
}
.ts-metric-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}
.ts-bar-high { background: #16a34a; }
.ts-bar-med  { background: var(--accent); }
.ts-bar-low  { background: #dc2626; }
.ts-metric-bar-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   SUPABASE CLOUD — avisos, badges, loading, toast
   ═══════════════════════════════════════════════════════════════ */

/* ── Banner de setup incompleto (tabela / bucket faltando) ────── */
.sb-setup-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e3a5f;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 11px;
  color: #bfdbfe;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  max-width: 520px;
}
.sb-setup-banner code {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: monospace;
}
.sb-setup-banner button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #93c5fd;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
  margin-left: 4px;
}

/* ── Aviso de modo local (bottom notice) ───────────────────────── */
.sb-local-notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 11px;
  color: #713f12;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  white-space: nowrap;
}
.sb-notice-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #713f12;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

/* ── Cloud Toast (notificações de upload/erro) ─────────────────── */
.cloud-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  z-index: 9998;
  box-shadow: 0 4px 16px rgba(0,0,0,0.14);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: 420px;
  line-height: 1.5;
  word-break: break-word;
}
.cloud-toast-show {
  opacity: 1;
  transform: translateY(0);
}
.cloud-toast-info    { background: #1e3a8a; color: #dbeafe; }
.cloud-toast-success { background: #14532d; color: #dcfce7; }
.cloud-toast-error   { background: #7f1d1d; color: #fee2e2; }
.cloud-toast-warning { background: #78350f; color: #fef3c7; }

/* ── Grid loading state ────────────────────────────────────────── */
.rec-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.rec-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--bg-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Card do lead Bitrix na análise ───────────────────────────── */
.bitrix-lead-card {
  border: 1.5px solid #c4b5fd;
  border-radius: 10px;
  background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 100%);
  margin-bottom: 16px;
  overflow: hidden;
}
.blc-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ede9fe;
  font-size: 10px;
  font-weight: 700;
  color: #7c3aed;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid #ddd6fe;
}
.blc-category {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #7c3aed;
  border-radius: 4px;
  padding: 2px 8px;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
.blc-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  gap: 12px;
}
.blc-info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.blc-deal-title {
  font-size: 14px;
  font-weight: 700;
  color: #3b0764;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blc-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #6b21a8;
  opacity: 0.85;
}
.blc-row svg { flex-shrink: 0; opacity: 0.6; }
.blc-value { font-weight: 600; opacity: 1; }
.blc-stage { display: inline-flex; align-items: center; gap: 4px; background: #ede9fe; color: #6d28d9; border-radius: 4px; padding: 2px 7px; font-weight: 600; width: fit-content; }
.blc-stage svg { opacity: 0.8; }
.blc-id-row { margin-top: 2px; }
.blc-id {
  font-size: 10px;
  color: #a78bfa;
  font-weight: 500;
  background: #ede9fe;
  border-radius: 4px;
  padding: 1px 6px;
}
.blc-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  color: #7c3aed;
  background: #fff;
  border: 1.5px solid #c4b5fd;
  border-radius: 6px;
  padding: 6px 12px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.blc-link:hover { background: #ede9fe; border-color: #a78bfa; }

/* ── Cloud badge nos cards ─────────────────────────────────────── */
.rc-cloud-badge {
  font-size: 9px;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.02em;
}

/* ── Cloud badge na análise (topbar) ───────────────────────────── */
.cloud-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #1e40af;
  background: #dbeafe;
  border-radius: 4px;
  padding: 2px 7px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Badge Bitrix ID na análise ────────────────────────────────── */
.bitrix-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #7c3aed;
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  border-radius: 4px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
}
.bitrix-id-badge:hover { background: #ddd6fe; }
.bitrix-id-badge .bib-label { font-weight: 700; }
.bitrix-id-badge .bib-company,
.bitrix-id-badge .bib-value   { font-weight: 500; opacity: 0.85; font-size: 9px; }
.bitrix-id-badge .bib-stage   { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; opacity: 0.85; font-size: 9px; background: #ede9fe; border-radius: 3px; padding: 1px 5px; }
.bitrix-id-badge .bib-category { font-weight: 700; font-size: 9px; color: #fff; background: #7c3aed; border-radius: 3px; padding: 1px 6px; }

/* ── Lead Bitrix nos cards do dashboard ────────────────────────── */
.rc-bitrix-lead {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 4px;
  padding: 3px 7px;
  margin: 4px 0 2px;
  line-height: 1.3;
  overflow: hidden;
}
.rc-bitrix-lead svg { flex-shrink: 0; opacity: 0.7; }
.rc-bitrix-name    { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.rc-bitrix-sep     { opacity: 0.4; flex-shrink: 0; }
.rc-bitrix-company { opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.rc-bitrix-value   { font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.rc-bitrix-stage   { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; opacity: 0.9; white-space: nowrap; background: #ede9fe; border-radius: 3px; padding: 1px 5px; flex-shrink: 0; }

/* ── Processing notice na análise ──────────────────────────────── */
.processing-notice {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #92400e;
  margin: 0 0 16px;
  font-weight: 600;
}

/* ── Teams ─────────────────────────────────────────────────── */
.teams-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.team-card {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: border-color var(--transition);
}
.team-card:hover { border-color: var(--border); }
.team-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.team-icon {
  width: 38px; height: 38px;
  background: var(--accent-dim);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.team-info { flex: 1; min-width: 0; }
.team-name { font-weight: 700; font-size: 14px; color: var(--text); }
.team-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.team-actions { display: flex; gap: 6px; }
.team-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}
.team-members-list {
  display: flex;
  align-items: center;
  flex: 1;
}
.team-member-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: var(--accent);
  margin-left: -6px;
}
.team-member-avatar:first-child { margin-left: 0; }
.team-members-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}
.team-shared-badge {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(202,153,30,0.12);
  color: var(--accent);
  white-space: nowrap;
}
.team-shared-badge.off {
  background: var(--bg-3);
  color: var(--text-dim);
}

/* ── Agrupamento de usuários por equipe ──────────────────── */
.team-group-header td {
  background: var(--bg-2);
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}
.team-group-separator td {
  border-top: 2px solid var(--border);
}
.team-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.team-group-title strong {
  color: var(--text);
  font-size: 13px;
}
.team-member-count {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-3);
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── Toggle switch (usado no modal de equipe) ─────────────── */
.toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 8px 0 4px;
}
.toggle-wrap { position: relative; flex-shrink: 0; margin-top: 2px; }
.toggle-input {
  position: absolute;
  opacity: 0; width: 0; height: 0;
}
.toggle-track {
  display: block;
  width: 40px; height: 22px;
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}
.toggle-input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}
.toggle-text { flex: 1; }
.toggle-title { display: block; font-size: 13px; font-weight: 600; color: var(--text); }

/* ── Face spinner — loadings do app ─────────────────────────── */
@keyframes face-spin { to { transform: rotate(360deg); } }

.bitrix-spinner,
.rec-loading-spinner,
.stage-spinner {
  background-image: url('loading-face.png') !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  border: none !important;
  border-radius: 50% !important;
  overflow: hidden;
  animation: face-spin 1s linear infinite !important;
}

.bitrix-spinner     { width: 48px !important; height: 48px !important; }
.rec-loading-spinner{ width: 36px !important; height: 36px !important; }
.stage-spinner      { width: 16px !important; height: 16px !important; border: none !important; }
.toggle-sub   { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
