/* Paleta y tokens de tema -------------------------------------------------
   Modo claro por defecto; modo oscuro vía `prefers-color-scheme` y,
   cuando el usuario elige manualmente con el toggle del encabezado,
   vía `[data-theme]` en <html> (que siempre gana sobre la preferencia
   del sistema). Todos los pares texto/fondo de contenido (cuerpo,
   progreso, resumen de calidad) están calibrados para WCAG AAA
   (>= 7:1) en ambos modos, tal como exige la legibilidad "a un vistazo"
   desde el atril. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-border: #e2e8f0;
  --surface-alt: #f1f5f9;
  /* Modo claro: sin borde en tarjetas/modal, solo sombra sutil (mas limpio). */
  --card-border: transparent;

  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #475569;

  --header-bg: #0f2942;
  --header-text: #ffffff;

  --brand-accent: #c9a13b;

  --btn-primary-bg: #1e40af;
  --btn-primary-bg-hover: #1e3a8a;
  --btn-primary-text: #ffffff;
  --btn-secondary-border: #1e40af;
  --btn-secondary-text: #1e40af;
  --btn-secondary-bg-hover: #eff6ff;

  --focus-ring: #1d4ed8;

  --success-600: #15803d;
  --success-border: #86efac;
  --success-bg: #f0fdf4;
  --error-600: #b91c1c;
  --error-border: #fca5a5;
  --error-bg: #fef2f2;

  --progress-track: #e2e8f0;
  --progress-fill-start: #2563eb;
  --progress-fill-end: #0f2942;

  --modal-overlay: rgba(15, 23, 42, 0.6);

  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-card: 0 1px 2px rgba(15, 41, 66, 0.06), 0 8px 24px rgba(15, 41, 66, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1f2937;
    --surface-border: #334155;
    --surface-alt: #111827;
    /* Modo oscuro: borde fino y continuo (las sombras casi no se ven aqui). */
    --card-border: #334155;

    --text-primary: #ffffff;
    --text-secondary: #f3f4f6;
    --text-muted: #cbd5e1;

    --header-bg: #0a1e30;
    --header-text: #ffffff;

    --btn-primary-bg: #2563eb;
    --btn-primary-bg-hover: #1d4ed8;
    --btn-primary-text: #ffffff;
    --btn-secondary-border: #60a5fa;
    --btn-secondary-text: #93c5fd;
    --btn-secondary-bg-hover: #1e2b3f;

    --focus-ring: #60a5fa;

    --success-600: #4ade80;
    --success-border: #166534;
    --success-bg: #14251b;
    --error-600: #f87171;
    --error-border: #7f1d1d;
    --error-bg: #2a1414;

    --progress-track: #334155;
    --progress-fill-start: #3b82f6;
    --progress-fill-end: #93c5fd;

    --modal-overlay: rgba(0, 0, 0, 0.7);

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-border: #e2e8f0;
  --surface-alt: #f1f5f9;
  --card-border: transparent;
  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --header-bg: #0f2942;
  --header-text: #ffffff;
  --btn-primary-bg: #1e40af;
  --btn-primary-bg-hover: #1e3a8a;
  --btn-primary-text: #ffffff;
  --btn-secondary-border: #1e40af;
  --btn-secondary-text: #1e40af;
  --btn-secondary-bg-hover: #eff6ff;
  --focus-ring: #1d4ed8;
  --success-600: #15803d;
  --success-border: #86efac;
  --success-bg: #f0fdf4;
  --error-600: #b91c1c;
  --error-border: #fca5a5;
  --error-bg: #fef2f2;
  --progress-track: #e2e8f0;
  --progress-fill-start: #2563eb;
  --progress-fill-end: #0f2942;
  --modal-overlay: rgba(15, 23, 42, 0.6);
  --shadow-card: 0 1px 2px rgba(15, 41, 66, 0.06), 0 8px 24px rgba(15, 41, 66, 0.08);
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1f2937;
  --surface-border: #334155;
  --surface-alt: #111827;
  --card-border: #334155;
  --text-primary: #ffffff;
  --text-secondary: #f3f4f6;
  --text-muted: #cbd5e1;
  --header-bg: #0a1e30;
  --header-text: #ffffff;
  --btn-primary-bg: #2563eb;
  --btn-primary-bg-hover: #1d4ed8;
  --btn-primary-text: #ffffff;
  --btn-secondary-border: #60a5fa;
  --btn-secondary-text: #93c5fd;
  --btn-secondary-bg-hover: #1e2b3f;
  --focus-ring: #60a5fa;
  --success-600: #4ade80;
  --success-border: #166534;
  --success-bg: #14251b;
  --error-600: #f87171;
  --error-border: #7f1d1d;
  --error-bg: #2a1414;
  --progress-track: #334155;
  --progress-fill-start: #3b82f6;
  --progress-fill-end: #93c5fd;
  --modal-overlay: rgba(0, 0, 0, 0.7);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Encabezado institucional -------------------------------------------- */

.app-header {
  background: var(--header-bg);
  padding: 0.9rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-mark {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  color: var(--brand-accent);
}

.brand-text {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--header-text);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand .subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-actions .btn-ghost {
  color: rgba(255, 255, 255, 0.85);
}

.header-actions .btn-ghost:hover {
  color: #ffffff;
}

.theme-toggle {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--header-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .theme-toggle .icon-sun {
    display: none;
  }
  .theme-toggle .icon-moon {
    display: block;
  }
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

/* Contenido y tarjetas --------------------------------------------------- */

.content {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.card-eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dropzone {
  border: 2px dashed var(--surface-border);
  border-radius: var(--radius-md);
  padding: 2.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--focus-ring);
  outline: none;
}

.dropzone.dragover {
  border-color: var(--focus-ring);
  background: var(--surface-alt);
}

.dropzone.has-file {
  border-color: var(--success-600);
  background: var(--success-bg);
}

.dropzone-icon {
  margin-bottom: 0.65rem;
  color: var(--text-muted);
}

.dropzone-icon svg {
  width: 40px;
  height: 40px;
}

.dropzone-text {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 700;
}

.dropzone-hint {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
}

.dropzone-hint button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--btn-secondary-text);
  cursor: pointer;
  text-decoration: underline;
}

.file-name {
  margin: 0.6rem 0 0;
  font-weight: 700;
  color: var(--success-600);
  font-size: 0.9rem;
  word-break: break-all;
}

/* Imágenes del bosquejo (Image Slots) --------------------------------------- */

.media-card {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--surface-border);
}

.media-slots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 640px) {
  .media-slots {
    grid-template-columns: repeat(2, 1fr);
  }
}

.media-slot-card {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.media-slot-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--surface);
}

.media-slot-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--error-600);
  border: 1px dashed var(--error-border);
}

.media-slot-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.media-slot-status {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.media-slot-actions {
  flex-wrap: wrap;
}

.media-slot-upload {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}

.reference-blocks {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.reference-block-card {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reference-block-card input[type="text"],
.reference-block-card textarea {
  font: inherit;
  font-weight: 400;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--surface);
  width: 100%;
  resize: vertical;
}

.reference-block-card input[type="text"]:focus,
.reference-block-card textarea:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--focus-ring);
}

/* Fase 18: botón compacto para insertar un bloque manual en un punto
   concreto de la lista (ej. entre dos referencias ya detectadas), distinto
   del "+ Añadir bloque" de tamaño completo al final de la tarjeta. */
.reference-insert-btn {
  width: 100%;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  opacity: 0.7;
}

.reference-insert-btn:hover {
  opacity: 1;
}

.reference-block-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.field input[type="number"],
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select {
  font: inherit;
  font-weight: 400;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--surface-alt);
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--focus-ring);
}

.field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.field-checkbox input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--btn-primary-bg);
}

.error-text {
  margin: 1rem 0 0;
  color: var(--error-600);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Botones ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.btn-block {
  width: 100%;
  margin-top: 1.5rem;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.btn-primary:hover {
  background: var(--btn-primary-bg-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--btn-secondary-text);
  border-color: var(--btn-secondary-border);
}

.btn-secondary:hover {
  background: var(--btn-secondary-bg-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  min-height: auto;
  padding: 0.5rem 0.75rem;
}

.btn-ghost:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* Progreso ---------------------------------------------------------------- */

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--progress-track);
  overflow: hidden;
}

.progress-bar-fill {
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--progress-fill-start), var(--progress-fill-end));
  animation: progress-slide 1.4s ease-in-out infinite;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(60%);
  }
  100% {
    transform: translateX(250%);
  }
}

.progress-text {
  margin: 1.15rem 0 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 700;
}

/* Resultado ---------------------------------------------------------------- */

.result-icon {
  display: flex;
  justify-content: center;
  color: var(--success-600);
}

.result-icon svg {
  width: 42px;
  height: 42px;
}

#result-card h2 {
  margin: 0.5rem 0 0;
  text-align: center;
  color: var(--text-primary);
}

.result-meta {
  margin: 0.4rem 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.6rem;
}

.result-actions .btn {
  flex: 1;
}

#reset-btn {
  display: block;
  margin: 1.1rem auto 0;
}

.app-footer {
  text-align: center;
  padding: 1rem 1.25rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Modal --------------------------------------------------------------------- */

.modal-overlay[hidden] {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 50;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.modal-wide {
  max-width: 720px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--surface-border);
  position: sticky;
  top: 0;
  background: var(--surface);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.modal-close {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.35rem;
  border-radius: 8px;
  display: flex;
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--surface-alt);
}

.modal-body {
  padding: 1.25rem;
}

.quality-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quality-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.quality-list li:last-child {
  border-bottom: none;
}

.quality-list strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.15rem;
}

/* Responsivo ---------------------------------------------------------------- */

@media (min-width: 640px) {
  .content {
    padding-top: 2.5rem;
  }

  .field-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .field-checkbox {
    grid-column: 1 / -1;
  }

  .result-actions {
    flex-direction: row;
  }
}

@media (min-width: 1024px) {
  .field-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .field-checkbox {
    grid-column: span 2;
  }

  .card {
    padding: 2rem;
  }
}

/* Autenticación (Fase 9.6) ------------------------------------------------ */

.field-grid-1 {
  grid-template-columns: 1fr;
}

.auth-switch {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--btn-secondary-text);
  cursor: pointer;
  text-decoration: underline;
}

#auth-view .card + .card {
  margin-top: 1.5rem;
}

.password-input {
  position: relative;
  display: flex;
}

.password-input input {
  flex: 1;
  padding-right: 2.6rem !important;
}

.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text-secondary);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.password-toggle .icon-eye-off {
  display: none;
}

.password-toggle.is-visible .icon-eye {
  display: none;
}

.password-toggle.is-visible .icon-eye-off {
  display: block;
}

.forgot-password-link {
  margin: 0.6rem 0 0;
  text-align: right;
}

.forgot-password-link button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--btn-secondary-text);
  cursor: pointer;
  text-decoration: underline;
}

/* Tabs (Fase 9.6) ---------------------------------------------------------- */

.tab-bar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--surface-border);
}

.tab-btn {
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.65rem 0.25rem;
  margin-bottom: -1px;
  color: var(--text-muted);
  cursor: pointer;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn.active {
  color: var(--btn-primary-bg);
  border-bottom-color: var(--btn-primary-bg);
}

.tab-panel > .card + .card {
  margin-top: 1.25rem;
}

/* Métricas del panel de Superadmin (Fase 9.6) ----------------------------- */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.metric-tile {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.metric-tile .metric-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-tile .metric-label {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .metrics-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Tabla de usuarios (Fase 9.6) --------------------------------------------- */

.table-scroll {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.users-table th,
.users-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--surface-border);
  white-space: nowrap;
}

.users-table th {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-pill.status-pending {
  background: var(--surface-alt);
  color: var(--text-muted);
}

.status-pill.status-active {
  background: var(--success-bg);
  color: var(--success-600);
}

.status-pill.status-banned {
  background: var(--error-bg);
  color: var(--error-600);
}

.row-actions {
  display: flex;
  gap: 0.4rem;
}

.row-actions button {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.row-actions button:hover {
  background: var(--surface-alt);
}

.row-actions .action-approve {
  color: var(--success-600);
  border-color: var(--success-border);
}

.row-actions .action-reject,
.row-actions .action-revoke {
  color: var(--error-600);
  border-color: var(--error-border);
}

/* Historial (Fase 9.6) ------------------------------------------------------ */

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--surface-border);
}

.history-list li:last-child {
  border-bottom: none;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.history-title {
  margin: 0;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.history-meta {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Edición del discurso (Fase 14) --------------------------------------------- */

.edit-textarea {
  width: 100%;
  min-height: 45vh;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  padding: 0.85rem 1rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: var(--surface-alt);
  resize: vertical;
}

.edit-textarea:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--focus-ring);
}

.edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
