/**
 * Swagger UI — tema Nimbus modernizado (inspirado en Scalar)
 * Requiere styles.css cargado antes para variables de tema.
 */

#swagger-ui,
#swagger-modal-ui {
  --sw-get: #3d8b6e;
  --sw-get-bg: rgba(61, 139, 110, 0.12);
  --sw-get-border: rgba(61, 139, 110, 0.28);
  --sw-post: #9a7c2e;
  --sw-post-bg: rgba(154, 124, 46, 0.12);
  --sw-post-border: rgba(154, 124, 46, 0.32);
  --sw-put: #56586e;
  --sw-put-bg: rgba(86, 88, 110, 0.1);
  --sw-put-border: rgba(86, 88, 110, 0.24);
  --sw-delete: #c45c5c;
  --sw-delete-bg: rgba(196, 92, 92, 0.1);
  --sw-delete-border: rgba(196, 92, 92, 0.28);
  --sw-patch: #6e7082;
  --sw-patch-bg: rgba(110, 112, 130, 0.12);
  --sw-patch-border: rgba(110, 112, 130, 0.24);
  --sw-head: #8b8d9e;
  --sw-head-bg: rgba(139, 141, 158, 0.1);
  --sw-radius: 10px;
  --sw-radius-sm: 6px;
  --sw-code-bg: var(--nimbus-navy-deep);
  --sw-code-text: #e8ebf2;
  --sw-transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#swagger-ui {
  padding: 1.25rem 1.5rem 2.5rem;
  font-family: var(--font);
  color: var(--text-primary);
}

#swagger-modal-ui {
  font-family: var(--font);
  color: var(--text-primary);
  padding: 0.25rem 0.5rem 1rem;
}

#swagger-ui .swagger-ui,
#swagger-modal-ui .swagger-ui {
  font-family: var(--font);
  color: var(--text-primary);
}

#swagger-ui .swagger-ui .wrapper,
#swagger-ui .swagger-ui section.block,
#swagger-modal-ui .swagger-ui .wrapper,
#swagger-modal-ui .swagger-ui section.block {
  padding: 0;
  max-width: none;
}

/* Ocultar topbar nativo */
#swagger-ui .swagger-ui .topbar,
#swagger-modal-ui .swagger-ui .topbar {
  display: none;
}

/* ── Info header (Scalar: título limpio + meta) ── */
#swagger-ui .swagger-ui .information-container,
#swagger-modal-ui .swagger-ui .information-container {
  margin: 0 0 1.5rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid var(--border);
}

#swagger-ui .swagger-ui .info,
#swagger-modal-ui .swagger-ui .info {
  margin: 0;
}

#swagger-ui .swagger-ui .info .title,
#swagger-modal-ui .swagger-ui .info .title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

#swagger-ui .swagger-ui .info .title small,
#swagger-modal-ui .swagger-ui .info .title small {
  display: inline-flex;
  align-items: center;
  margin-left: 0.55rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--tag-bg);
  color: var(--accent);
  border: 1px solid var(--tag-border);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

#swagger-ui .swagger-ui .info .title small pre,
#swagger-modal-ui .swagger-ui .info .title small pre {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font-family: var(--font);
}

#swagger-ui .swagger-ui .info .base-url,
#swagger-ui .swagger-ui .info hgroup.main a,
#swagger-modal-ui .swagger-ui .info .base-url,
#swagger-modal-ui .swagger-ui .info hgroup.main a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

#swagger-ui .swagger-ui .info .description,
#swagger-ui .swagger-ui .info .markdown p,
#swagger-modal-ui .swagger-ui .info .description,
#swagger-modal-ui .swagger-ui .info .markdown p {
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.9rem;
  max-width: 72ch;
}

/* ── Toolbar servers + auth (Scalar: barra sticky) ── */
#swagger-ui .swagger-ui .scheme-container,
#swagger-modal-ui .swagger-ui .scheme-container {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--sw-radius);
  box-shadow: 0 4px 18px rgba(26, 28, 44, 0.06);
  padding: 0.85rem 1.1rem;
  margin: 0 0 1.25rem;
}

html[data-theme="dark"] #swagger-ui .swagger-ui .scheme-container,
html[data-theme="dark"] #swagger-modal-ui .swagger-ui .scheme-container {
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

#swagger-ui .swagger-ui .schemes.wrapper,
#swagger-ui .swagger-ui .auth-wrapper,
#swagger-modal-ui .swagger-ui .schemes.wrapper,
#swagger-modal-ui .swagger-ui .auth-wrapper {
  padding: 0;
}

#swagger-ui .swagger-ui .scheme-container .schemes > label,
#swagger-modal-ui .swagger-ui .scheme-container .schemes > label {
  color: var(--text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* ── Filter (Scalar: search pill) ── */
#swagger-ui .swagger-ui .filter-container {
  margin: 0 0 1rem;
}

#swagger-ui .swagger-ui .filter .operation-filter-input {
  width: 100%;
  max-width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.65rem;
  border-radius: var(--sw-radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  box-shadow: inset 0 1px 2px rgba(26, 28, 44, 0.04);
  transition: var(--sw-transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%238b8d9e' d='M7 2a5 5 0 1 0 3.09 8.94l2.52 2.52.71-.71-2.52-2.52A5 5 0 0 0 7 2zm0 1.25a3.75 3.75 0 1 1 0 7.5 3.75 3.75 0 0 1 0-7.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.95rem center;
}

#swagger-ui .swagger-ui .filter .operation-filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), inset 0 1px 2px rgba(26, 28, 44, 0.04);
  outline: none;
}

#swagger-ui .swagger-ui .filter .operation-filter-input::placeholder {
  color: var(--text-muted);
}

/* ── Tag sections (Scalar: encabezado de grupo) ── */
#swagger-ui .swagger-ui .opblock-tag-section,
#swagger-modal-ui .swagger-ui .opblock-tag-section {
  margin-bottom: 0.5rem;
}

#swagger-ui .swagger-ui .opblock-tag,
#swagger-modal-ui .swagger-ui .opblock-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  margin: 1.75rem 0 0.65rem;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease;
}

#swagger-ui .swagger-ui .opblock-tag:first-of-type,
#swagger-modal-ui .swagger-ui .opblock-tag:first-of-type {
  margin-top: 0.5rem;
}

#swagger-ui .swagger-ui .opblock-tag:hover,
#swagger-modal-ui .swagger-ui .opblock-tag:hover {
  color: var(--accent);
}

#swagger-ui .swagger-ui .opblock-tag small,
#swagger-modal-ui .swagger-ui .opblock-tag small {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

#swagger-ui .swagger-ui .opblock-tag svg,
#swagger-modal-ui .swagger-ui .opblock-tag svg {
  fill: var(--text-muted);
  width: 12px;
  height: 12px;
}

/* ── Operation cards (Scalar: fila limpia, sin franja lateral) ── */
#swagger-ui .swagger-ui .opblock,
#swagger-modal-ui .swagger-ui .opblock {
  margin: 0 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--sw-radius);
  box-shadow: none;
  overflow: hidden;
  background: var(--bg-surface);
  transition: var(--sw-transition);
}

#swagger-ui .swagger-ui .opblock:hover,
#swagger-modal-ui .swagger-ui .opblock:hover {
  border-color: var(--border-strong);
  box-shadow: 0 6px 20px rgba(26, 28, 44, 0.07);
}

#swagger-ui .swagger-ui .opblock.is-open,
#swagger-modal-ui .swagger-ui .opblock.is-open {
  border-color: var(--border-strong);
  box-shadow: 0 8px 28px rgba(26, 28, 44, 0.09);
}

#swagger-ui .swagger-ui .opblock .opblock-summary,
#swagger-modal-ui .swagger-ui .opblock .opblock-summary {
  border: none;
  padding: 0.75rem 0.95rem;
  align-items: center;
  gap: 0.65rem;
  min-height: 3rem;
}

#swagger-ui .swagger-ui .opblock .opblock-summary-method,
#swagger-modal-ui .swagger-ui .opblock .opblock-summary-method {
  min-width: 4.25rem;
  padding: 0.32rem 0.55rem;
  border-radius: var(--sw-radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  box-shadow: none;
  flex-shrink: 0;
}

#swagger-ui .swagger-ui .opblock .opblock-summary-path,
#swagger-ui .swagger-ui .opblock .opblock-summary-path__deprecated,
#swagger-modal-ui .swagger-ui .opblock .opblock-summary-path,
#swagger-modal-ui .swagger-ui .opblock .opblock-summary-path__deprecated {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}

#swagger-ui .swagger-ui .opblock .opblock-summary-description,
#swagger-modal-ui .swagger-ui .opblock .opblock-summary-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-right: 0.5rem;
}

#swagger-ui .swagger-ui .opblock .opblock-summary-control svg,
#swagger-modal-ui .swagger-ui .opblock .opblock-summary-control svg {
  fill: var(--text-muted);
}

/* Métodos HTTP — pills Nimbus */
#swagger-ui .swagger-ui .opblock.opblock-get,
#swagger-modal-ui .swagger-ui .opblock.opblock-get {
  border-color: var(--sw-get-border);
}

#swagger-ui .swagger-ui .opblock.opblock-get .opblock-summary-method,
#swagger-modal-ui .swagger-ui .opblock.opblock-get .opblock-summary-method {
  background: var(--sw-get-bg);
  color: var(--sw-get);
}

#swagger-ui .swagger-ui .opblock.opblock-get.is-open,
#swagger-modal-ui .swagger-ui .opblock.opblock-get.is-open {
  background: color-mix(in srgb, var(--sw-get-bg) 35%, var(--bg-surface));
}

#swagger-ui .swagger-ui .opblock.opblock-post,
#swagger-modal-ui .swagger-ui .opblock.opblock-post {
  border-color: var(--sw-post-border);
}

#swagger-ui .swagger-ui .opblock.opblock-post .opblock-summary-method,
#swagger-modal-ui .swagger-ui .opblock.opblock-post .opblock-summary-method {
  background: var(--sw-post-bg);
  color: var(--sw-post);
}

#swagger-ui .swagger-ui .opblock.opblock-post.is-open,
#swagger-modal-ui .swagger-ui .opblock.opblock-post.is-open {
  background: color-mix(in srgb, var(--sw-post-bg) 40%, var(--bg-surface));
}

#swagger-ui .swagger-ui .opblock.opblock-put,
#swagger-modal-ui .swagger-ui .opblock.opblock-put {
  border-color: var(--sw-put-border);
}

#swagger-ui .swagger-ui .opblock.opblock-put .opblock-summary-method,
#swagger-modal-ui .swagger-ui .opblock.opblock-put .opblock-summary-method {
  background: var(--sw-put-bg);
  color: var(--sw-put);
}

#swagger-ui .swagger-ui .opblock.opblock-delete,
#swagger-modal-ui .swagger-ui .opblock.opblock-delete {
  border-color: var(--sw-delete-border);
}

#swagger-ui .swagger-ui .opblock.opblock-delete .opblock-summary-method,
#swagger-modal-ui .swagger-ui .opblock.opblock-delete .opblock-summary-method {
  background: var(--sw-delete-bg);
  color: var(--sw-delete);
}

#swagger-ui .swagger-ui .opblock.opblock-patch,
#swagger-modal-ui .swagger-ui .opblock.opblock-patch {
  border-color: var(--sw-patch-border);
}

#swagger-ui .swagger-ui .opblock.opblock-patch .opblock-summary-method,
#swagger-modal-ui .swagger-ui .opblock.opblock-patch .opblock-summary-method {
  background: var(--sw-patch-bg);
  color: var(--sw-patch);
}

#swagger-ui .swagger-ui .opblock.opblock-head .opblock-summary-method,
#swagger-ui .swagger-ui .opblock.opblock-options .opblock-summary-method,
#swagger-modal-ui .swagger-ui .opblock.opblock-head .opblock-summary-method,
#swagger-modal-ui .swagger-ui .opblock.opblock-options .opblock-summary-method {
  background: var(--sw-head-bg);
  color: var(--sw-head);
}

/* Anular verdes/bordes default de Swagger UI */
html[data-theme="light"] #swagger-ui .swagger-ui .opblock,
html[data-theme="light"] #swagger-modal-ui .swagger-ui .opblock {
  background: var(--bg-surface) !important;
}

html[data-theme="light"] #swagger-ui .swagger-ui .opblock .opblock-summary,
html[data-theme="light"] #swagger-modal-ui .swagger-ui .opblock .opblock-summary {
  background: transparent !important;
  border: none !important;
}

html[data-theme="light"] #swagger-ui .swagger-ui .opblock.opblock-get .opblock-summary-method,
html[data-theme="light"] #swagger-modal-ui .swagger-ui .opblock.opblock-get .opblock-summary-method {
  background: var(--sw-get-bg) !important;
  color: var(--sw-get) !important;
}

html[data-theme="light"] #swagger-ui .swagger-ui .opblock.opblock-post .opblock-summary-method,
html[data-theme="light"] #swagger-modal-ui .swagger-ui .opblock.opblock-post .opblock-summary-method {
  background: var(--sw-post-bg) !important;
  color: var(--sw-post) !important;
}

/* Expanded body */
#swagger-ui .swagger-ui .opblock .opblock-section-header,
#swagger-modal-ui .swagger-ui .opblock .opblock-section-header {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 0.55rem 0.95rem;
  min-height: auto;
}

#swagger-ui .swagger-ui .opblock .opblock-section-header h4,
#swagger-modal-ui .swagger-ui .opblock .opblock-section-header h4 {
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#swagger-ui .swagger-ui .opblock-body,
#swagger-modal-ui .swagger-ui .opblock-body {
  padding: 0.85rem 0.95rem 1rem;
}

#swagger-ui .swagger-ui .opblock-description-wrapper,
#swagger-ui .swagger-ui .opblock-external-docs-wrapper,
#swagger-modal-ui .swagger-ui .opblock-description-wrapper,
#swagger-modal-ui .swagger-ui .opblock-external-docs-wrapper {
  padding: 0.5rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ── Parámetros y tablas (Scalar: tabla en card) ── */
#swagger-ui .swagger-ui table,
#swagger-modal-ui .swagger-ui table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
  border: 1px solid var(--border);
  border-radius: var(--sw-radius-sm);
  overflow: hidden;
}

#swagger-ui .swagger-ui table thead tr th,
#swagger-ui .swagger-ui table thead tr td,
#swagger-modal-ui .swagger-ui table thead tr th,
#swagger-modal-ui .swagger-ui table thead tr td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-elevated);
}

#swagger-ui .swagger-ui table tbody tr td,
#swagger-modal-ui .swagger-ui table tbody tr td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
  background: var(--bg-surface);
}

#swagger-ui .swagger-ui table tbody tr:last-child td,
#swagger-modal-ui .swagger-ui table tbody tr:last-child td {
  border-bottom: none;
}

#swagger-ui .swagger-ui .parameter__name,
#swagger-modal-ui .swagger-ui .parameter__name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}

#swagger-ui .swagger-ui .parameter__name.required span,
#swagger-ui .swagger-ui .parameter__name.required::after,
#swagger-modal-ui .swagger-ui .parameter__name.required span,
#swagger-modal-ui .swagger-ui .parameter__name.required::after {
  color: var(--accent);
}

#swagger-ui .swagger-ui .parameter__type,
#swagger-ui .swagger-ui .parameter__in,
#swagger-modal-ui .swagger-ui .parameter__type,
#swagger-modal-ui .swagger-ui .parameter__in {
  font-size: 0.74rem;
  color: var(--text-muted);
}

#swagger-ui .swagger-ui .response-col_status,
#swagger-modal-ui .swagger-ui .response-col_status {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 600;
}

#swagger-ui .swagger-ui .response-col_description,
#swagger-modal-ui .swagger-ui .response-col_description {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

/* ── Formularios ── */
#swagger-ui .swagger-ui input[type="text"],
#swagger-ui .swagger-ui input[type="password"],
#swagger-ui .swagger-ui input[type="search"],
#swagger-ui .swagger-ui input[type="email"],
#swagger-ui .swagger-ui input[type="file"],
#swagger-ui .swagger-ui textarea,
#swagger-ui .swagger-ui select,
#swagger-modal-ui .swagger-ui input[type="text"],
#swagger-modal-ui .swagger-ui input[type="password"],
#swagger-modal-ui .swagger-ui input[type="search"],
#swagger-modal-ui .swagger-ui input[type="email"],
#swagger-modal-ui .swagger-ui input[type="file"],
#swagger-modal-ui .swagger-ui textarea,
#swagger-modal-ui .swagger-ui select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-primary);
  border-radius: var(--sw-radius-sm);
  padding: 0.52rem 0.75rem;
  font-size: 0.84rem;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(26, 28, 44, 0.03);
  transition: var(--sw-transition);
}

#swagger-ui .swagger-ui input:focus,
#swagger-ui .swagger-ui textarea:focus,
#swagger-ui .swagger-ui select:focus,
#swagger-modal-ui .swagger-ui input:focus,
#swagger-modal-ui .swagger-ui textarea:focus,
#swagger-modal-ui .swagger-ui select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#swagger-ui .swagger-ui label,
#swagger-modal-ui .swagger-ui label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
}

#swagger-ui .swagger-ui select,
#swagger-modal-ui .swagger-ui select {
  cursor: pointer;
  padding-right: 2rem;
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2356586e' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
}

html[data-theme="dark"] #swagger-ui .swagger-ui select,
html[data-theme="dark"] #swagger-modal-ui .swagger-ui select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239698a8' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
}

#swagger-ui .swagger-ui input[type="checkbox"],
#swagger-ui .swagger-ui input[type="radio"],
#swagger-modal-ui .swagger-ui input[type="checkbox"],
#swagger-modal-ui .swagger-ui input[type="radio"] {
  width: 1rem;
  height: 1rem;
  margin: 0 0.35rem 0 0;
  accent-color: var(--accent);
  border: 1px solid var(--input-border) !important;
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
  box-shadow: none;
  appearance: auto;
}

#swagger-ui .swagger-ui .checkbox label,
#swagger-ui .swagger-ui .radio label,
#swagger-modal-ui .swagger-ui .checkbox label,
#swagger-modal-ui .swagger-ui .radio label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
}

/* ── Botones (Scalar: rect redondeado; primario Nimbus gold) ── */
#swagger-ui .swagger-ui .btn,
#swagger-modal-ui .swagger-ui .btn {
  border-radius: var(--sw-radius-sm) !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  padding: 0.48rem 0.95rem !important;
  box-shadow: none !important;
  transition: var(--sw-transition) !important;
  font-family: var(--font) !important;
  line-height: 1.2 !important;
  min-height: auto !important;
}

#swagger-ui .swagger-ui .btn.cancel,
#swagger-modal-ui .swagger-ui .btn.cancel {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
}

#swagger-ui .swagger-ui .btn.cancel:hover,
#swagger-modal-ui .swagger-ui .btn.cancel:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-strong) !important;
}

#swagger-ui .swagger-ui .try-out__btn,
#swagger-ui .swagger-ui .btn.authorize,
#swagger-ui .swagger-ui .btn.done,
#swagger-modal-ui .swagger-ui .try-out__btn,
#swagger-modal-ui .swagger-ui .btn.authorize,
#swagger-modal-ui .swagger-ui .btn.done {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}

#swagger-ui .swagger-ui .try-out__btn:hover,
#swagger-ui .swagger-ui .btn.authorize:hover,
#swagger-ui .swagger-ui .btn.done:hover,
#swagger-modal-ui .swagger-ui .try-out__btn:hover,
#swagger-modal-ui .swagger-ui .btn.authorize:hover,
#swagger-modal-ui .swagger-ui .btn.done:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

#swagger-ui .swagger-ui .btn.execute,
#swagger-ui .swagger-ui .btn.authorize.button,
#swagger-modal-ui .swagger-ui .btn.execute,
#swagger-modal-ui .swagger-ui .btn.authorize.button {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
}

#swagger-ui .swagger-ui .btn.execute:hover,
#swagger-ui .swagger-ui .btn.authorize.button:hover,
#swagger-modal-ui .swagger-ui .btn.execute:hover,
#swagger-modal-ui .swagger-ui .btn.authorize.button:hover {
  background: var(--nimbus-gold-hover) !important;
  border-color: var(--nimbus-gold-hover) !important;
  color: #ffffff !important;
}

#swagger-ui .swagger-ui .authorization__btn,
#swagger-modal-ui .swagger-ui .authorization__btn {
  border-radius: var(--sw-radius-sm) !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-surface) !important;
  padding: 0.35rem 0.55rem !important;
}

#swagger-ui .swagger-ui .authorization__btn:hover,
#swagger-ui .swagger-ui .authorization__btn.locked,
#swagger-modal-ui .swagger-ui .authorization__btn:hover,
#swagger-modal-ui .swagger-ui .authorization__btn.locked {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

#swagger-ui .swagger-ui .authorization__btn svg,
#swagger-ui .swagger-ui .btn.authorize svg,
#swagger-modal-ui .swagger-ui .authorization__btn svg,
#swagger-modal-ui .swagger-ui .btn.authorize svg {
  fill: var(--text-muted) !important;
}

#swagger-ui .swagger-ui .authorization__btn.locked svg,
#swagger-ui .swagger-ui .authorization__btn:hover svg,
#swagger-ui .swagger-ui .btn.authorize:hover svg,
#swagger-modal-ui .swagger-ui .authorization__btn.locked svg,
#swagger-modal-ui .swagger-ui .authorization__btn:hover svg,
#swagger-modal-ui .swagger-ui .btn.authorize:hover svg {
  fill: var(--accent) !important;
}

#swagger-ui .swagger-ui .try-out.btn-group,
#swagger-modal-ui .swagger-ui .try-out.btn-group {
  align-items: center;
  gap: 0.5rem;
}

/* ── Iconos SVG ── */
#swagger-ui .swagger-ui svg,
#swagger-modal-ui .swagger-ui svg {
  transition: fill 0.15s ease, transform 0.2s ease;
}

#swagger-ui .swagger-ui .opblock-tag svg,
#swagger-ui .swagger-ui .opblock-summary-control svg,
#swagger-ui .swagger-ui .opblock-control-arrow svg,
#swagger-ui .swagger-ui section.models h4 svg,
#swagger-ui .swagger-ui .model-toggle svg,
#swagger-modal-ui .swagger-ui .opblock-tag svg,
#swagger-modal-ui .swagger-ui .opblock-summary-control svg,
#swagger-modal-ui .swagger-ui .opblock-control-arrow svg,
#swagger-modal-ui .swagger-ui section.models h4 svg,
#swagger-modal-ui .swagger-ui .model-toggle svg {
  fill: var(--text-muted) !important;
}

#swagger-ui .swagger-ui .opblock-tag:hover svg,
#swagger-ui .swagger-ui .opblock.is-open .opblock-tag svg,
#swagger-modal-ui .swagger-ui .opblock-tag:hover svg,
#swagger-modal-ui .swagger-ui .opblock.is-open .opblock-tag svg {
  fill: var(--accent) !important;
}

#swagger-ui .swagger-ui .opblock-control-arrow,
#swagger-modal-ui .swagger-ui .opblock-control-arrow {
  background: transparent !important;
  border: none !important;
  padding: 0.25rem !important;
  border-radius: var(--sw-radius-sm);
}

#swagger-ui .swagger-ui .opblock-control-arrow:hover,
#swagger-modal-ui .swagger-ui .opblock-control-arrow:hover {
  background: var(--bg-hover) !important;
}

#swagger-ui .swagger-ui .opblock-control-arrow:hover svg,
#swagger-modal-ui .swagger-ui .opblock-control-arrow:hover svg {
  fill: var(--accent) !important;
}

/* Copy + Download */
#swagger-ui .swagger-ui .highlight-code,
#swagger-modal-ui .swagger-ui .highlight-code {
  position: relative;
}

#swagger-ui .swagger-ui .copy-to-clipboard,
#swagger-modal-ui .swagger-ui .copy-to-clipboard {
  align-items: center !important;
  display: flex !important;
  justify-content: center !important;
  position: absolute !important;
  bottom: 10px !important;
  right: 6.5rem !important;
  width: 2rem !important;
  height: 2rem !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

#swagger-ui .swagger-ui .copy-to-clipboard button,
#swagger-modal-ui .swagger-ui .copy-to-clipboard button {
  background-color: rgba(255, 255, 255, 0.12) !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='15' aria-hidden='true'%3E%3Cpath fill='%23e8ebf2' fill-rule='evenodd' d='M4 12h4v1H4zm5-6H4v1h5zm2 3V7l-3 3 3 3v-2h5V9zM6.5 8H4v1h2.5zM4 11h2.5v-1H4zm9 1h1v2c-.02.28-.11.52-.3.7s-.42.28-.7.3H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3c0-1.11.89-2 2-2s2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V5H3v9h10zM4 4h8c0-.55-.45-1-1-1h-1c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H5c-.55 0-1 .45-1 1'/%3E%3C/svg%3E") !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: 15px 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: var(--sw-radius-sm) !important;
  padding: 0 !important;
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem !important;
  min-height: 2rem !important;
  cursor: pointer;
  transition: var(--sw-transition);
}

#swagger-ui .swagger-ui .copy-to-clipboard button:hover,
#swagger-modal-ui .swagger-ui .copy-to-clipboard button:hover {
  border-color: var(--accent) !important;
  background-color: rgba(154, 124, 46, 0.25) !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='15' aria-hidden='true'%3E%3Cpath fill='%23faf6ec' fill-rule='evenodd' d='M4 12h4v1H4zm5-6H4v1h5zm2 3V7l-3 3 3 3v-2h5V9zM6.5 8H4v1h2.5zM4 11h2.5v-1H4zm9 1h1v2c-.02.28-.11.52-.3.7s-.42.28-.7.3H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3c0-1.11.89-2 2-2s2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V5H3v9h10zM4 4h8c0-.55-.45-1-1-1h-1c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H5c-.55 0-1 .45-1 1'/%3E%3C/svg%3E") !important;
}

#swagger-ui .swagger-ui .download-contents,
#swagger-modal-ui .swagger-ui .download-contents {
  align-items: center !important;
  display: inline-flex !important;
  gap: 0.35rem !important;
  position: absolute !important;
  bottom: 10px !important;
  right: 10px !important;
  height: 2rem !important;
  padding: 0 0.65rem 0 0.5rem !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: var(--sw-radius-sm) !important;
  color: #e8ebf2 !important;
  font-family: var(--font) !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  cursor: pointer;
  transition: var(--sw-transition);
}

#swagger-ui .swagger-ui .download-contents::before,
#swagger-modal-ui .swagger-ui .download-contents::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23e8ebf2' d='M8 11.5 4.5 8H6.75V3h2.5v5H11.5L8 11.5zM3 13.5v1h10v-1H3z'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

#swagger-ui .swagger-ui .download-contents:hover,
#swagger-modal-ui .swagger-ui .download-contents:hover {
  border-color: var(--accent) !important;
  background: rgba(154, 124, 46, 0.28) !important;
  color: #faf6ec !important;
}

/* Tabs */
#swagger-ui .swagger-ui .opblock .tab-header .tab-item h4,
#swagger-modal-ui .swagger-ui .opblock .tab-header .tab-item h4 {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

#swagger-ui .swagger-ui .opblock .tab-header .tab-item.active h4,
#swagger-modal-ui .swagger-ui .opblock .tab-header .tab-item.active h4 {
  color: var(--text-primary);
}

#swagger-ui .swagger-ui .opblock .tab-header .tab-item.active h4 span::after,
#swagger-modal-ui .swagger-ui .opblock .tab-header .tab-item.active h4 span::after {
  background: var(--accent) !important;
  height: 2px !important;
  border-radius: 2px;
  bottom: -10px !important;
}

/* ── Code blocks (Scalar: navy oscuro) ── */
#swagger-ui .swagger-ui pre,
#swagger-ui .swagger-ui .microlight,
#swagger-ui .swagger-ui .highlight-code,
#swagger-modal-ui .swagger-ui pre,
#swagger-modal-ui .swagger-ui .microlight,
#swagger-modal-ui .swagger-ui .highlight-code,
.nimbus-code-block {
  background: var(--sw-code-bg) !important;
  border: none;
  border-radius: var(--sw-radius-sm);
  color: var(--sw-code-text) !important;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
}

#swagger-ui .swagger-ui .opblock-body pre.microlight,
#swagger-modal-ui .swagger-ui .opblock-body pre.microlight {
  margin: 0.5rem 0;
  padding: 1rem 1.1rem;
}

#swagger-ui .swagger-ui .curl-command,
#swagger-modal-ui .swagger-ui .curl-command {
  background: var(--sw-code-bg);
  border-radius: var(--sw-radius-sm);
  padding: 0.25rem;
}

html[data-theme="light"] #swagger-ui .swagger-ui .hljs-string,
html[data-theme="light"] #swagger-ui .swagger-ui .microlight .hljs-string,
html[data-theme="light"] #swagger-ui .swagger-ui pre .hljs-string,
html[data-theme="light"] #swagger-modal-ui .swagger-ui .hljs-string,
html[data-theme="light"] #swagger-modal-ui .swagger-ui .microlight .hljs-string,
html[data-theme="light"] #swagger-ui .swagger-ui span[style*="a2fca2"],
html[data-theme="light"] #swagger-ui .swagger-ui span[style*="162, 252, 162"],
html[data-theme="light"] #swagger-ui .swagger-ui span[style*="162,252,162"],
html[data-theme="light"] #swagger-modal-ui .swagger-ui span[style*="a2fca2"],
html[data-theme="light"] #swagger-modal-ui .swagger-ui span[style*="162, 252, 162"] {
  color: #7ec89a !important;
}

html[data-theme="light"] #swagger-ui .swagger-ui .hljs-attr,
html[data-theme="light"] #swagger-ui .swagger-ui .hljs-number,
html[data-theme="light"] #swagger-modal-ui .swagger-ui .hljs-attr,
html[data-theme="light"] #swagger-modal-ui .swagger-ui .hljs-number {
  color: #d4b86a !important;
}

html[data-theme="light"] #swagger-ui .swagger-ui .hljs-literal,
html[data-theme="light"] #swagger-ui .swagger-ui .hljs-keyword,
html[data-theme="light"] #swagger-modal-ui .swagger-ui .hljs-literal,
html[data-theme="light"] #swagger-modal-ui .swagger-ui .hljs-keyword {
  color: #b8bcc8 !important;
}

html[data-theme="dark"] #swagger-ui,
html[data-theme="dark"] #swagger-modal-ui {
  --sw-code-bg: #0a0b10;
  --sw-code-text: #c8cad6;
}

/* ── Models ── */
#swagger-ui .swagger-ui section.models,
#swagger-modal-ui .swagger-ui section.models {
  margin-top: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--sw-radius);
  padding: 1rem 1.1rem;
  background: var(--bg-surface);
}

#swagger-ui .swagger-ui section.models h4,
#swagger-modal-ui .swagger-ui section.models h4 {
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  margin: 0;
}

#swagger-ui .swagger-ui section.models h4 span,
#swagger-modal-ui .swagger-ui section.models h4 span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

#swagger-ui .swagger-ui .model-box,
#swagger-ui .swagger-ui .model,
#swagger-modal-ui .swagger-ui .model-box,
#swagger-modal-ui .swagger-ui .model {
  background: var(--bg-elevated);
  border-radius: var(--sw-radius-sm);
  border: 1px solid var(--border);
}

#swagger-ui .swagger-ui .model-title,
#swagger-modal-ui .swagger-ui .model-title {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-primary);
}

#swagger-ui .swagger-ui .model .prop-type,
#swagger-modal-ui .swagger-ui .model .prop-type {
  color: var(--accent);
}

#swagger-ui .swagger-ui .model-toggle:hover,
#swagger-modal-ui .swagger-ui .model-toggle:hover {
  background: var(--bg-hover);
}

#swagger-ui .swagger-ui .model-toggle::after,
#swagger-modal-ui .swagger-ui .model-toggle::after {
  background: var(--text-muted);
}

#swagger-ui .swagger-ui .model-toggle:hover::after,
#swagger-modal-ui .swagger-ui .model-toggle:hover::after {
  background: var(--accent);
}

/* ── Responses ── */
#swagger-ui .swagger-ui .responses-inner h4,
#swagger-ui .swagger-ui .responses-inner h5,
#swagger-modal-ui .swagger-ui .responses-inner h4,
#swagger-modal-ui .swagger-ui .responses-inner h5 {
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#swagger-ui .swagger-ui .live-responses-table .response,
#swagger-modal-ui .swagger-ui .live-responses-table .response {
  border: 1px solid var(--border);
  border-radius: var(--sw-radius-sm);
  overflow: hidden;
}

/* ── Auth modal ── */
#swagger-ui .swagger-ui .dialog-ux .modal-ux,
#swagger-modal-ui .swagger-ui .dialog-ux .modal-ux {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--sw-radius);
  box-shadow: var(--card-shadow);
}

#swagger-ui .swagger-ui .dialog-ux .modal-ux-header,
#swagger-modal-ui .swagger-ui .dialog-ux .modal-ux-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.15rem;
}

#swagger-ui .swagger-ui .dialog-ux .modal-ux-header h3,
#swagger-modal-ui .swagger-ui .dialog-ux .modal-ux-header h3 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
}

#swagger-ui .swagger-ui .dialog-ux .modal-ux-content,
#swagger-modal-ui .swagger-ui .dialog-ux .modal-ux-content {
  padding: 1.15rem;
  color: var(--text-secondary);
}

#swagger-ui .swagger-ui .close-modal,
#swagger-modal-ui .swagger-ui .close-modal {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--sw-radius-sm) !important;
  padding: 0.35rem 0.65rem !important;
  color: var(--text-secondary) !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
}

#swagger-ui .swagger-ui .close-modal:hover,
#swagger-modal-ui .swagger-ui .close-modal:hover {
  color: var(--text-primary) !important;
  border-color: var(--accent) !important;
}

/* ── Links ── */
#swagger-ui .swagger-ui .markdown a,
#swagger-ui .swagger-ui .info a,
#swagger-modal-ui .swagger-ui .markdown a,
#swagger-modal-ui .swagger-ui .info a {
  color: var(--accent);
  text-decoration: none;
}

#swagger-ui .swagger-ui .markdown a:hover,
#swagger-ui .swagger-ui .info a:hover,
#swagger-modal-ui .swagger-ui .markdown a:hover,
#swagger-modal-ui .swagger-ui .info a:hover {
  text-decoration: underline;
}

/* ── Loading ── */
#swagger-ui .swagger-ui .loading-container .loading,
#swagger-modal-ui .swagger-ui .loading-container .loading {
  color: var(--text-muted);
}

#swagger-ui .swagger-ui .loading-container .loading::after,
#swagger-modal-ui .swagger-ui .loading-container .loading::after {
  border-color: var(--border);
  border-top-color: var(--accent);
}

/* ── Aux ── */
#swagger-ui .swagger-ui .download-url-wrapper .btn,
#swagger-modal-ui .swagger-ui .download-url-wrapper .btn {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}

#swagger-ui .swagger-ui .download-url-wrapper .btn:hover,
#swagger-modal-ui .swagger-ui .download-url-wrapper .btn:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

html[data-theme="dark"] #swagger-ui .swagger-ui .opblock.is-open,
html[data-theme="dark"] #swagger-modal-ui .swagger-ui .opblock.is-open {
  background: var(--bg-elevated);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #swagger-ui {
    padding: 0.85rem 0.85rem 1.75rem;
  }

  #swagger-ui .swagger-ui .scheme-container,
  #swagger-modal-ui .swagger-ui .scheme-container {
    position: static;
  }

  #swagger-ui .swagger-ui .opblock .opblock-summary,
  #swagger-modal-ui .swagger-ui .opblock .opblock-summary {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  #swagger-ui .swagger-ui .opblock .opblock-summary-path,
  #swagger-modal-ui .swagger-ui .opblock .opblock-summary-path {
    font-size: 0.78rem;
  }
}
