:root {
  --docs-accent: #0284c7;
  --docs-accent-dark: #0369a1;
  --docs-accent-soft: #e0f2fe;
  --docs-header-bg: #0f172a;
  --docs-header-text: #f8fafc;
  --docs-header-muted: #94a3b8;
  --docs-border: #dbeafe;
  --docs-surface: #ffffff;
  --docs-muted-text: #475569;
  --docs-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.docs-portal,
body.docs-console {
  margin: 0;
  font-family: var(--docs-font);
  background: #f8fafc;
  color: #0f172a;
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
  padding: 0 1.5rem;
  background: var(--docs-header-bg);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.18);
}

.docs-header__brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
}

.docs-header__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--docs-accent) 0%, #38bdf8 100%);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.docs-header__title {
  display: block;
  color: var(--docs-header-text);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.25;
}

.docs-header__subtitle {
  display: block;
  margin-top: 0.125rem;
  color: var(--docs-header-muted);
  font-size: 0.875rem;
  line-height: 1.3;
}

.docs-header__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.docs-header__link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  color: var(--docs-header-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.docs-header__link-icon {
  font-size: 0.875rem;
  line-height: 1;
}

.docs-header__link:hover {
  color: var(--docs-header-text);
  background: rgba(148, 163, 184, 0.12);
}

.docs-header__link.is-active {
  color: #fff;
  background: rgba(2, 132, 199, 0.22);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.docs-header__more {
  position: relative;
}

.docs-header__link--more {
  list-style: none;
  cursor: pointer;
}

.docs-header__link--more::-webkit-details-marker {
  display: none;
}

.docs-header__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 240px;
  padding: 0.375rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.75rem;
  background: #1e293b;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
}

.docs-header__dropdown-link {
  display: block;
  padding: 0.75rem 0.875rem;
  border-radius: 0.5rem;
  color: #e2e8f0;
  font-size: 0.875rem;
  text-decoration: none;
}

.docs-header__dropdown-link:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #fff;
}

.docs-welcome,
.docs-console-guide {
  border-bottom: 1px solid var(--docs-border);
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}

.docs-welcome.is-hidden,
.docs-console-guide.is-hidden {
  display: none;
}

.docs-welcome__inner,
.docs-console-guide {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem;
}

.docs-welcome__head,
.docs-console-guide__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.docs-welcome__eyebrow {
  margin: 0 0 0.375rem;
  color: var(--docs-accent);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-welcome__title,
.docs-console-guide__title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
}

.docs-welcome__lead,
.docs-console-guide__lead {
  margin: 0;
  max-width: 52rem;
  color: var(--docs-muted-text);
  font-size: 1rem;
  line-height: 1.65;
}

.docs-welcome__dismiss {
  flex-shrink: 0;
  padding: 0.625rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.docs-welcome__dismiss:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.docs-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.docs-steps--compact {
  grid-template-columns: 1fr;
  max-width: 760px;
}

.docs-step {
  display: flex;
  gap: 0.875rem;
  padding: 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  background: #fff;
}

.docs-step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--docs-accent-soft);
  color: var(--docs-accent-dark);
  font-size: 0.9375rem;
  font-weight: 700;
  flex-shrink: 0;
}

.docs-step strong {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 1rem;
}

.docs-step p {
  margin: 0;
  color: var(--docs-muted-text);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.docs-services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.docs-service-card {
  padding: 1rem 1.125rem;
  border-radius: 1rem;
  border: 1px solid transparent;
}

.docs-service-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
}

.docs-service-card p {
  margin: 0 0 0.75rem;
  color: var(--docs-muted-text);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.docs-service-card--seg {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.docs-service-card--tac {
  background: #fff7ed;
  border-color: #fed7aa;
}

.docs-service-card__tag {
  display: inline-block;
  padding: 0.375rem 0.625rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
}

.docs-welcome__help,
.docs-console-guide__note {
  margin: 0;
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  background: #fff;
  border: 1px solid #cbd5e1;
  color: var(--docs-muted-text);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.docs-console-guide__note {
  margin-top: 1rem;
  background: #fffbeb;
  border-color: #fde68a;
}

#redoc-container {
  min-height: calc(100vh - 72px);
}

body.docs-welcome-hidden #redoc-container {
  min-height: calc(100vh - 72px);
}

.docs-console-body {
  padding: 1.5rem;
}

#swagger-ui {
  max-width: 1120px;
  margin: 0 auto;
}

#swagger-ui .swagger-ui {
  font-family: var(--docs-font);
}

#swagger-ui .topbar {
  display: none;
}

#swagger-ui .information-container.wrapper {
  padding-top: 0;
}

#swagger-ui .info .title {
  color: #0f172a;
  font-family: var(--docs-font);
  font-size: 1.75rem;
  font-weight: 700;
}

#swagger-ui .info .description,
#swagger-ui .info p,
#swagger-ui .opblock-tag,
#swagger-ui .opblock .opblock-summary-description,
#swagger-ui table thead tr td,
#swagger-ui table thead tr th,
#swagger-ui .parameter__name,
#swagger-ui .response-col_status,
#swagger-ui label,
#swagger-ui .tab li,
#swagger-ui .opblock-summary-method {
  font-family: var(--docs-font);
}

#swagger-ui .info .description {
  font-size: 1rem;
  line-height: 1.65;
}

#swagger-ui .opblock-tag {
  border-bottom: 1px solid #dbeafe;
  color: #0f172a;
  font-size: 1.125rem;
  font-weight: 600;
}

#swagger-ui .opblock-tag small {
  display: block;
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.9375rem;
  font-weight: 400;
}

#swagger-ui .opblock {
  border-radius: 0.875rem;
  margin-bottom: 0.875rem;
  box-shadow: none;
}

#swagger-ui .opblock.opblock-get {
  border-color: rgba(2, 132, 199, 0.35);
  background: rgba(224, 242, 254, 0.55);
}

#swagger-ui .opblock.opblock-post {
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(209, 250, 229, 0.55);
}

#swagger-ui .opblock.opblock-put,
#swagger-ui .opblock.opblock-patch {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(254, 243, 199, 0.55);
}

#swagger-ui .opblock.opblock-delete {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(254, 226, 226, 0.55);
}

#swagger-ui .btn.authorize,
#swagger-ui .btn.execute {
  background: var(--docs-accent);
  border-color: var(--docs-accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
}

#swagger-ui .btn.authorize:hover,
#swagger-ui .btn.execute:hover {
  background: var(--docs-accent-dark);
  border-color: var(--docs-accent-dark);
}

#swagger-ui .scheme-container {
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: #fff;
  box-shadow: none;
}

#swagger-ui .filter-container input {
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  font-size: 1rem;
}

#swagger-ui section.models {
  border: 1px solid #dbeafe;
  border-radius: 1rem;
  background: #fff;
}

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

@media (max-width: 960px) {
  .docs-steps,
  .docs-services {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .docs-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.875rem 1rem;
  }

  .docs-header__nav {
    width: 100%;
  }

  .docs-welcome__head,
  .docs-console-guide__head {
    flex-direction: column;
  }

  .docs-console-body,
  .docs-welcome__inner,
  .docs-console-guide {
    padding: 1rem;
  }
}

/* Página guía middleware */
.docs-guide {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.docs-guide__hero {
  margin-bottom: 2rem;
}

.docs-guide__title {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.docs-guide__lead {
  margin: 0;
  color: var(--docs-muted-text);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.docs-guide__section {
  margin-bottom: 2.25rem;
}

.docs-guide__section h2 {
  margin: 0 0 0.875rem;
  font-size: 1.375rem;
  font-weight: 700;
}

.docs-guide__section p,
.docs-guide__section li {
  color: var(--docs-muted-text);
  font-size: 1rem;
  line-height: 1.65;
}

.docs-guide__section p {
  margin: 0 0 0.875rem;
}

.docs-guide__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.docs-guide__card {
  padding: 1rem 1.125rem;
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  background: #fff;
}

.docs-guide__card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.docs-guide__card p {
  margin: 0;
  font-size: 0.9375rem;
}

.docs-code {
  margin: 0 0 1rem;
  padding: 1rem 1.125rem;
  overflow-x: auto;
  border: 1px solid #cbd5e1;
  border-radius: 0.875rem;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.docs-code code {
  white-space: pre;
}

.docs-guide__note {
  margin: 0;
  padding: 0.875rem 1rem;
  border-radius: 0.875rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.9375rem;
}

.docs-guide__table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.docs-guide__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.docs-guide__table th,
.docs-guide__table td {
  padding: 0.75rem 1rem;
  border: 1px solid #dbeafe;
  text-align: left;
  vertical-align: top;
}

.docs-guide__table th {
  background: #eff6ff;
  font-weight: 600;
}

.docs-guide__table code {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.8125rem;
}

.docs-guide__list,
.docs-guide__checklist-plain {
  margin: 0;
  padding-left: 1.25rem;
}

.docs-guide__list li,
.docs-guide__checklist-plain li {
  margin-bottom: 0.5rem;
}

.docs-guide__checklist {
  max-width: none;
}

.docs-guide__section--muted {
  padding: 1.25rem;
  border-radius: 1rem;
  background: #f1f5f9;
}

.docs-guide__footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #dbeafe;
  color: var(--docs-muted-text);
  font-size: 0.9375rem;
}

.docs-guide__footer a {
  color: var(--docs-accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.docs-guide__footer a:hover {
  text-decoration: underline;
}

@media (max-width: 960px) {
  .docs-guide__cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .docs-guide {
    padding: 1rem 1rem 2rem;
  }

  .docs-guide__title {
    font-size: 1.625rem;
  }
}

body.docs-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f8fafc 0%, #e0f2fe 100%);
}

.docs-login {
  width: min(100%, 28rem);
  padding: 1.5rem;
}

.docs-login__card {
  background: var(--docs-surface);
  border: 1px solid var(--docs-border);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
}

.docs-login__brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.docs-login__title {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.3;
}

.docs-login__subtitle {
  margin: 0.375rem 0 0;
  color: var(--docs-muted-text);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.docs-login__error {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.875rem;
}

.docs-login__form {
  display: grid;
  gap: 0.75rem;
}

.docs-login__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.docs-login__input {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.625rem;
  font: inherit;
}

.docs-login__input:focus {
  outline: 2px solid rgba(2, 132, 199, 0.25);
  border-color: var(--docs-accent);
}

.docs-login__submit {
  margin-top: 0.5rem;
  padding: 0.8125rem 1rem;
  border: 0;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, var(--docs-accent) 0%, #38bdf8 100%);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.docs-login__submit:hover {
  filter: brightness(0.96);
}

.docs-header__logout {
  margin: 0;
}

.docs-header__dropdown-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

