/* ============================================================
   RESET & BASE
   ============================================================ */
html {
  box-sizing: border-box;
  overflow-y: scroll;
  color-scheme: light;
}

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

:root {
  --topbar-h: 58px;   /* altura do topbar — usada para hero overlap */

  /* Brand — extraídos do logo CrisduLabs */
  --brand-purple:       #26106b;   /* "crisdu" — roxo profundo */
  --brand-purple-mid:   #3d2090;   /* tom intermediário */
  --brand-blue:         #4899e3;   /* "labs" — azul */
  --brand-blue-dark:    #2c6fc7;
  --brand-blue-light:   #e8f2fb;
  --brand-blue-soft:    #d4e8f8;
  --brand-teal:         #5ec4cc;   /* diamante — ponta teal */

  /* Surfaces */
  --bg:        #f2f5f9;
  --surface:   #ffffff;
  --surface-2: #f8fafc;

  /* Text */
  --text:       #0d1117;
  --text-2:     #3d4f61;
  --text-muted: #6b7e90;

  /* Borders */
  --border:      #dde4ec;
  --border-soft: #edf1f5;

  /* Radius */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Shadow */
  --shadow-xs:   0 1px 2px rgba(13,17,23,.06);
  --shadow-sm:   0 1px 4px rgba(13,17,23,.08), 0 1px 2px rgba(13,17,23,.04);
  --shadow-card: 0 2px 8px rgba(13,17,23,.06), 0 0 0 1px var(--border-soft);
  --shadow-hover:0 8px 28px rgba(72,153,227,.2), 0 0 0 1px rgba(72,153,227,.28);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
  font-family: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.dark-mode,
html.dark-mode body {
  color-scheme: light;
  background: #fff;
}

/* ── Shared container ──────────────────── */
.page-container {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #0e0530;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 350ms ease, border-color 350ms ease;
}

/* No topo da home: transparente — o vídeo do hero passa por baixo */
.app-topbar.at-top {
  background: transparent;
  border-bottom-color: transparent;
}

.app-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  height: var(--topbar-h);
}

/* ── Brand filter tabs (acima do grid de módulos) ───── */
.brand-filter {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.brand-filter__tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px 13px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 180ms;
  white-space: nowrap;
  outline: none;
}

.brand-filter__tab::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-blue);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 200ms ease;
}

.brand-filter__tab:hover {
  color: var(--text);
}

.brand-filter__tab--active {
  color: var(--brand-blue);
  font-weight: 600;
}

.brand-filter__tab--active::after {
  transform: scaleX(1);
}

.brand-filter__tab:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: -2px;
  border-radius: var(--r-xs) var(--r-xs) 0 0;
}

.brand-filter__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  transition: opacity 180ms;
}

.brand-filter__tab--active .brand-filter__dot {
  opacity: 1;
}

.brand-filter__badge {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--r-full);
  background: var(--border);
  color: var(--text-muted);
  line-height: 1.4;
}

/* Módulo switcher desabilitado (Favorita sem módulos) */
.mod-switcher--disabled .mod-switcher__trigger {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.app-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  border-radius: var(--r-xs);
  outline-offset: 3px;
}

.app-brand__logo {
  display: block;
  height: 32px;
  width: auto;
  object-fit: contain;
}

/* ── Custom module dropdown ─────────────── */
.mod-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.mod-switcher__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  user-select: none;
}

.mod-switcher__ctrl {
  position: relative;
}

.mod-switcher__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 36px;
  min-width: 230px;
  padding: 0 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.88);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: background 150ms, border-color 150ms, box-shadow 150ms;
  white-space: nowrap;
}

.mod-switcher__trigger:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.26);
}

.mod-switcher[data-open] .mod-switcher__trigger {
  background: rgba(255,255,255,0.16);
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px rgba(94,196,204,0.18);
}

.mod-switcher__chevron {
  width: 14px;
  height: 14px;
  color: rgba(255,255,255,0.45);
  flex-shrink: 0;
  transition: transform 220ms ease;
}

.mod-switcher[data-open] .mod-switcher__chevron {
  transform: rotate(180deg);
}

/* ── Dropdown panel ─────────────────────── */
.mod-switcher__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
  background: #160b3e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-md);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.3);
  z-index: 200;
  padding: 6px;
  animation: panel-in 160ms cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.mod-switcher__panel::-webkit-scrollbar {
  width: 4px;
}
.mod-switcher__panel::-webkit-scrollbar-track {
  background: transparent;
}
.mod-switcher__panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 99px;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Panel items ────────────────────────── */
.mod-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.7);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 120ms, color 120ms;
}

.mod-item:hover {
  background: rgba(94,196,204,0.14);
  color: #ffffff;
}

.mod-item--active {
  background: rgba(72,153,227,0.22);
  color: #ffffff;
}

.mod-item--home {
  color: rgba(255,255,255,0.5);
  font-style: italic;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 4px;
  padding-bottom: 10px;
}

.mod-item--home:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}

.mod-item__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
}

.mod-item--active .mod-item__icon,
.mod-item:hover .mod-item__icon {
  color: rgba(255,255,255,0.9);
}

.mod-item__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* ============================================================
   HOME VIEW
   ============================================================ */
.home-view {
  flex: 1;
}

.home-view[hidden] {
  display: none;
}

/* ============================================================
   HERO — full viewport width
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  /*
   * margin-top negativo = puxa o hero para trás/sob o topbar.
   * padding-top compensado = conteúdo visual fica no mesmo lugar.
   * Quando topbar está transparente, o vídeo de fundo aparece por baixo.
   */
  margin-top: calc(-1 * var(--topbar-h));
  padding: calc(64px + var(--topbar-h)) 32px 60px;
  /*
   * Gradiente vertical: topo = exata cor do topbar (#0e0530)
   * → vai abrindo para azul vivo na base.
   */
  background: linear-gradient(
    to bottom,
    #0e0530 0%,
    #1d0f5e 28%,
    #1b3f8c 65%,
    #1a6ab0 100%
  );
  overflow: hidden;
  text-align: center;
}

/* Background video */
.hero__bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.18;
  mix-blend-mode: overlay;
  pointer-events: none;
  user-select: none;
}

/* Dot-grid texture */
.hero__grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.09) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

/* Glow orbs */
.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
}

.hero__orb--a {
  width: 480px;
  height: 480px;
  top: -140px;
  right: -80px;
  background: rgba(94, 196, 204, 0.18); /* teal do diamante */
}

.hero__orb--b {
  width: 360px;
  height: 360px;
  bottom: -100px;
  left: -60px;
  background: rgba(72, 153, 227, 0.2); /* azul labs */
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

/* ── Badge ──────────────────────────────── */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 5px 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r-full);
  color: rgba(255,255,255,0.85);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 22px;
  backdrop-filter: blur(6px);
}

.hero__badge svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  color: #ffd166;
}

/* ── Title & copy ───────────────────────── */
.hero__title {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -0.03em;
}

.hero__subtitle {
  margin: 0 0 36px;
  color: rgba(255,255,255,0.68);
  font-size: 1rem;
  line-height: 1.72;
  max-width: 510px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 36px;
}

/* ── Search ─────────────────────────────── */
.search-wrapper {
  position: relative;
  max-width: 460px;
  margin: 0 auto 26px;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.search-input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border: none;
  border-radius: var(--r-full);
  background: #ffffff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: 0 6px 24px rgba(0,0,0,0.24);
  transition: box-shadow 150ms;
  outline: none;
}

.search-input::placeholder {
  color: #a0b0c0;
  font-weight: 400;
}

.search-input:focus {
  box-shadow: 0 6px 24px rgba(0,0,0,0.26), 0 0 0 3px rgba(72,153,227,0.45);
}

/* ── Stats bar ──────────────────────────── */
.hero__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255,255,255,0.5);
  font-size: 0.8125rem;
  font-weight: 500;
}

.hero__stats strong {
  color: rgba(255,255,255,0.88);
  font-weight: 700;
}

.hero__stats-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  display: inline-block;
  flex-shrink: 0;
}

/* ============================================================
   MODULES SECTION
   ============================================================ */
.modules-section {
  padding: 40px 0 48px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* Fix: swagger-ui.css pode sobrescrever [hidden] */
.module-card[hidden] {
  display: none !important;
}

#swagger-view[hidden],
#swagger-status[hidden],
.swagger-loader[hidden],
.swagger-error[hidden],
.brand-empty[hidden],
.no-results[hidden] {
  display: none !important;
}

#swagger-status[data-state="loading"] .swagger-error,
#swagger-status[data-state="error"] .swagger-loader,
#swagger-status[data-state="idle"] .swagger-loader,
#swagger-status[data-state="idle"] .swagger-error {
  display: none !important;
}

/* ============================================================
   MODULE CARD
   ============================================================ */
.module-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 14px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  will-change: transform;
}

.module-card:hover,
.module-card:focus-visible {
  border-color: rgba(72,153,227,0.4);
  box-shadow: var(--shadow-hover);
  outline: none;
  transform: translateY(-2px);
}

.module-card__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  color: var(--brand-purple);
  transition: background 160ms, color 160ms;
}

.module-card:hover .module-card__icon {
  background: var(--brand-blue-light);
  color: var(--brand-blue-dark);
}

.module-card__body {
  flex: 1;
  min-width: 0;
}

.module-card__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.module-card__description {
  display: block;
  font-size: 0.775rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-card__arrow {
  flex-shrink: 0;
  color: var(--border);
  display: flex;
  align-items: center;
  transition: color 160ms, transform 160ms;
}

.module-card:hover .module-card__arrow {
  color: var(--brand-blue);
  transform: translateX(3px);
}

/* No-results */
.no-results {
  text-align: center;
  padding: 56px 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.no-results span {
  font-weight: 600;
  color: var(--text-2);
}

/* ── Brand empty (Favorita sem módulos) ── */
.brand-empty {
  text-align: center;
  padding: 72px 24px;
}

.brand-empty__icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 20px;
  display: block;
  filter: grayscale(0.3);
}

.brand-empty__title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand-empty__text {
  margin: 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* ============================================================
   SWAGGER VIEW
   ============================================================ */
#swagger-view {
  flex: 1;
  padding-bottom: 56px;
}

#swagger-view[hidden] {
  display: none;
}

.swagger-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms, border-color 140ms, color 140ms, box-shadow 140ms;
  flex-shrink: 0;
  outline: none;
}

.back-btn svg {
  width: 15px;
  height: 15px;
}

.back-btn:hover {
  background: var(--brand-blue-light);
  border-color: var(--brand-blue);
  color: var(--brand-blue-dark);
  box-shadow: 0 0 0 3px rgba(72,153,227,0.12);
}

.back-btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  min-width: 0;
}

.breadcrumb__link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: color 140ms;
}

.breadcrumb__link:hover {
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb__sep {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--border);
}

.breadcrumb__current {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

/* ============================================================
   SWAGGER UI OVERRIDES
   ============================================================ */
.swagger-ui .topbar { display: none; }

.swagger-ui,
.swagger-ui * { font-family: "DM Sans", "Segoe UI", system-ui, sans-serif; }

.swagger-ui .wrapper  { max-width: none; padding: 0; }
.swagger-ui           { max-width: none; }

/* ── Info / título ──────────────────────────────────────── */
.swagger-ui .info {
  margin: 32px 0 0;
}

.swagger-ui .info .title {
  font-family: "DM Sans", sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

.swagger-ui .info .description,
.swagger-ui .info .description p,
.swagger-ui .info .description * {
  font-size: 0.875rem;
  color: var(--text-2) !important;
  line-height: 1.6;
}

/* ocultar tudo em hgroup exceto o título */
.swagger-ui .info hgroup.main > *:not(.title) { display: none; }

/* ── Servidor ───────────────────────────────────────────── */
.swagger-ui .scheme-container {
  margin: 16px 0 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
}
.swagger-ui .scheme-container .wrapper { padding: 0; }
.swagger-ui .scheme-container .schemes {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.swagger-ui .scheme-container label,
.swagger-ui .servers-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0;
}

/* select estilizado igual ao mod-switcher da página */
.swagger-ui .servers > label select {
  -webkit-appearance: none;
  appearance: none;
  font-family: "DM Sans", sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b7e90'%3E%3Cpath fill-rule='evenodd' d='M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 34px 7px 12px;
  box-shadow: var(--shadow-xs);
  outline: none;
  cursor: pointer;
  min-width: 280px;
  transition: border-color 150ms;
}

.swagger-ui .servers > label select:hover {
  border-color: rgba(72,153,227,0.4);
}

.swagger-ui .servers > label select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(72,153,227,0.15);
}

/* ── Tag / seção ────────────────────────────────────────── */
.swagger-ui .opblock-tag-section { margin-top: 28px; }

.swagger-ui .opblock-tag {
  padding: 10px 0 10px;
  border-bottom: 2px solid var(--border-soft);
  font-family: "DM Sans", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.swagger-ui .opblock-tag small {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 10px;
  letter-spacing: 0;
}

.swagger-ui .opblock-tag svg {
  display: block;
  margin-left: auto;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  opacity: 0.9;
  transition: color 140ms ease;
}

.swagger-ui .opblock-tag svg path {
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.swagger-ui .opblock-tag[data-expanded="true"] svg,
.swagger-ui .opblock-tag[aria-expanded="true"] svg,
.swagger-ui .opblock-tag-section.is-open > .opblock-tag svg {
  color: var(--text);
}

.swagger-ui .opblock-tag[data-expanded="true"] svg path,
.swagger-ui .opblock-tag[aria-expanded="true"] svg path,
.swagger-ui .opblock-tag-section.is-open > .opblock-tag svg path {
  transform: rotate(180deg);
}

/* ── Operation blocks ───────────────────────────────────── */
.swagger-ui .opblock {
  margin-bottom: 4px;
  border-radius: var(--r-sm) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  transition: border-color 140ms ease;
}

.swagger-ui .opblock:hover {
  border-color: rgba(72,153,227,0.35) !important;
}

.swagger-ui .opblock.is-open {
  border-color: rgba(72,153,227,0.3) !important;
}

.swagger-ui .opblock .opblock-summary-control {
  border-radius: calc(var(--r-sm) - 2px);
  outline: none;
  margin-right: 10px;
}

.swagger-ui .opblock .opblock-summary-control:focus,
.swagger-ui .opblock .opblock-summary-control:focus-visible {
  outline: 2px solid rgba(72,153,227,0.45);
  outline-offset: 4px;
  box-shadow: none;
  border-radius: calc(var(--r-sm) - 2px);
}

.swagger-ui .opblock .opblock-summary {
  padding: 9px 14px;
  border-radius: var(--r-sm);
  align-items: center;
}

/* separador interno só quando expandido */
.swagger-ui .opblock.is-open .opblock-summary {
  border-bottom: 1px solid var(--border-soft);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.swagger-ui .opblock .opblock-summary-method {
  font-family: "DM Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--r-full);
  min-width: 62px;
  padding: 4px 0;
  text-shadow: none;
  box-shadow: none;
  color: #fff !important;
}

.swagger-ui .opblock .opblock-summary-path,
.swagger-ui .opblock .opblock-summary-path__deprecated {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text);
}

.swagger-ui .opblock .opblock-summary-description {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* método GET */
.swagger-ui .opblock.opblock-get {
  background: rgba(72,153,227,.04) !important;
  border-color: rgba(72,153,227,.22) !important;
}
.swagger-ui .opblock.opblock-get .opblock-summary-method {
  background: var(--brand-blue) !important;
}

/* método POST */
.swagger-ui .opblock.opblock-post {
  background: rgba(34,197,94,.04) !important;
  border-color: rgba(34,197,94,.22) !important;
}
.swagger-ui .opblock.opblock-post .opblock-summary-method {
  background: #16a34a !important;
}

/* método PUT */
.swagger-ui .opblock.opblock-put {
  background: rgba(245,158,11,.04) !important;
  border-color: rgba(245,158,11,.22) !important;
}
.swagger-ui .opblock.opblock-put .opblock-summary-method {
  background: #d97706 !important;
}

/* método DELETE */
.swagger-ui .opblock.opblock-delete {
  background: rgba(239,68,68,.04) !important;
  border-color: rgba(239,68,68,.22) !important;
}
.swagger-ui .opblock.opblock-delete .opblock-summary-method {
  background: #dc2626 !important;
}

/* método PATCH */
.swagger-ui .opblock.opblock-patch {
  background: rgba(139,92,246,.04) !important;
  border-color: rgba(139,92,246,.22) !important;
}
.swagger-ui .opblock.opblock-patch .opblock-summary-method {
  background: #7c3aed !important;
}

/* conteúdo interno expandido */
.swagger-ui .opblock-body {
  border-top: 1px solid var(--border-soft);
}

.swagger-ui .opblock-description-wrapper p,
.swagger-ui .opblock-external-docs-wrapper p,
.swagger-ui .opblock-title_normal p {
  font-size: 0.8375rem;
  color: var(--text-2);
}

/* parâmetros */
.swagger-ui table thead tr th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.swagger-ui .parameters-col_name { font-size: 0.8rem; }
.swagger-ui .parameter__name      { font-weight: 600; color: var(--text); }
.swagger-ui .parameter__type      { font-size: 0.75rem; color: var(--text-muted); }
.swagger-ui .parameter__in        { font-size: 0.68rem; font-style: normal; color: var(--brand-blue-dark); }

/* required badge */
.swagger-ui .parameter__name.required::after {
  color: #dc2626;
  font-size: 0.7rem;
}

/* botão Execute */
.swagger-ui .btn.execute {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  border-radius: var(--r-sm);
  font-family: "DM Sans", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 7px 20px;
  box-shadow: none;
  text-shadow: none;
  transition: background 160ms, border-color 160ms;
}
.swagger-ui .btn.execute:hover {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
}

/* botões secundários */
.swagger-ui .btn {
  font-family: "DM Sans", sans-serif;
  border-radius: var(--r-sm);
  box-shadow: none;
  text-shadow: none;
}

/* response codes */
.swagger-ui .response-col_status { font-size: 0.8375rem; font-weight: 600; }
.swagger-ui .response-col_description { font-size: 0.8rem; }

/* models / schema */
.swagger-ui section.models { margin-top: 32px; }
.swagger-ui section.models h4 {
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ============================================================
   SWAGGER LOADER & ERROR STATE
   ============================================================ */
.swagger-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-muted);
}

.swagger-loader__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

.swagger-loader__text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.swagger-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 80px 0;
  color: var(--text-muted);
}

.swagger-error svg {
  width: 40px;
  height: 40px;
  color: #dc2626;
  opacity: 0.7;
}

.swagger-error__text {
  margin: 0;
  font-size: 0.875rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  background: #0d0728;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.app-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding-top: 30px;
  padding-bottom: 30px;
}

.app-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-footer__logo {
  display: block;
  width: 160px;
  height: 36px;
  object-fit: contain;
  object-position: left center;
  max-width: 100%;
}

.app-footer__tagline {
  margin: 0;
  font-size: 0.775rem;
  color: rgba(255,255,255,0.35);
}

.app-footer__right {
  text-align: right;
}

.app-footer__copy {
  margin: 0 0 5px;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

.app-footer__tech {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
}

.app-footer__tech a {
  color: var(--brand-teal);
  text-decoration: none;
  font-weight: 500;
}

.app-footer__tech a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .page-container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    padding: 52px 20px 48px;
  }
}

@media (max-width: 640px) {
  .app-topbar__inner {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 8px;
  }

  .mod-switcher {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding-bottom: 4px;
  }

  .mod-switcher__ctrl {
    width: 100%;
  }

  .mod-switcher__trigger {
    width: 100%;
    min-width: 0;
  }

  .mod-switcher__panel {
    right: auto;
    left: 0;
    width: 100%;
    min-width: 0;
  }

  .hero {
    /* No mobile o topbar é mais alto (stacked) — desativa o overlap */
    margin-top: 0;
    padding: 40px 16px 40px;
  }

  .hero__title {
    font-size: 2.1rem;
  }

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

  .swagger-nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .app-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-footer__right {
    text-align: left;
  }
}

/* ============================================================
   AUTH — Login overlay, logout button, user info
   ============================================================ */

/* ── Login overlay ──────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0620;
  padding: 24px;
  /* fade-in on show */
  animation: login-fadein 0.3s ease;
}

.login-overlay[data-hiding] {
  animation: login-fadeout 0.35s ease forwards;
  pointer-events: none;
}

@keyframes login-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes login-fadeout {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── Card ───────────────────────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: login-slideup 0.35s cubic-bezier(.22,.61,.36,1);
}

@keyframes login-slideup {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.login-card__header {
  text-align: center;
  margin-bottom: 32px;
}

.login-card__logo {
  height: 36px;
  width: auto;
  margin-bottom: 20px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.login-card__title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.login-card__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.50);
}

/* ── Form ───────────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
}

.login-field__wrap {
  position: relative;
}

.login-field__input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-sm);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.login-field__wrap .login-field__input {
  padding-right: 44px;
}

.login-field__input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.login-field__input:focus {
  border-color: var(--brand-blue);
  background: rgba(72, 153, 227, 0.07);
}

/* eye button */
.login-field__eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.40);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.login-field__eye:hover { color: rgba(255, 255, 255, 0.75); }

/* ── Submit button ──────────────────────────────────────── */
.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--brand-purple-mid), var(--brand-blue));
  border: none;
  border-radius: var(--r-sm);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.login-submit:hover:not(:disabled) { opacity: 0.9; }
.login-submit:active:not(:disabled) { transform: scale(0.98); }
.login-submit:disabled { opacity: 0.6; cursor: default; }

/* spinner inside submit */
.login-submit__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.login-submit[data-loading] .login-submit__text   { display: none; }
.login-submit[data-loading] .login-submit__spinner { display: block; }

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

/* ── Topbar: right side (auth info + logout) ────────────── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-right--admin {
  margin-left: auto;
}


.account-menu {
  position: relative;
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-full);
  color: rgba(255,255,255,0.82);
  font-family: inherit;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, box-shadow 150ms;
}

.account-trigger:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.2);
}

.account-menu[data-open] .account-trigger {
  background: rgba(255,255,255,0.16);
  border-color: rgba(94,196,204,0.45);
  box-shadow: 0 0 0 3px rgba(94,196,204,0.16);
}

.account-trigger__chevron {
  width: 14px;
  height: 14px;
  color: rgba(255,255,255,0.5);
  transition: transform 180ms ease;
}

.account-menu[data-open] .account-trigger__chevron {
  transform: rotate(180deg);
}

.account-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  background: #160b3e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--r-md);
  box-shadow: 0 16px 48px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.3);
  z-index: 220;
  animation: panel-in 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.account-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: rgba(255,255,255,0.84);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}

.account-menu__item:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.account-menu__item--danger:hover {
  background: rgba(239,68,68,0.16);
  color: #fca5a5;
}

.auth-info__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Logout button ──────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-info__name { max-width: 96px; }
  .account-trigger { padding: 0 10px; }
  .account-panel { min-width: 160px; }
}

/* ============================================================
   TOAST
   ============================================================ */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.06);
  pointer-events: all;
  animation: toast-in 0.28s cubic-bezier(.22,.61,.36,1);
  max-width: 360px;
}

.toast[data-leaving] {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0)    scale(1);    }
  to   { opacity: 0; transform: translateY(-6px) scale(0.95); }
}

/* variants */
.toast--error {
  background: #1f1315;
  border: 1px solid rgba(239,68,68,0.35);
  color: #fca5a5;
}

.toast--error .toast__icon { color: #f87171; }

.toast--info {
  background: #111827;
  border: 1px solid rgba(72,153,227,0.35);
  color: #93c5fd;
}

.toast--info .toast__icon { color: #60a5fa; }

.toast--success {
  background: #0f1f14;
  border: 1px solid rgba(34,197,94,0.35);
  color: #86efac;
}

.toast--success .toast__icon { color: #4ade80; }

.toast__icon {
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
}

.toast__msg {
  flex: 1;
}

.toast__close {
  flex-shrink: 0;
  margin-top: 1px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  display: flex;
  transition: opacity 0.15s;
}

/* ============================================================
   ADMIN LINK (topbar — visível só para GABRIELANDRIOLA)
   ============================================================ */
.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.82);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms, border-color 150ms, color 150ms;
  margin-right: 8px;
}

.admin-link:hover {
  background: rgba(94,196,204,0.18);
  border-color: rgba(94,196,204,0.4);
  color: #ffffff;
}

/* ============================================================
   ADMIN PAGE — layout geral
   ============================================================ */
.admin-layout[hidden] { display: none; }

.admin-layout {
  flex: 1;
  display: flex;
  gap: 0;
  min-height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* ── Topbar title (admin page) ─────────────────────── */
.admin-topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ── Painéis ─────────────────────────────────────── */
.admin-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-panel--users {
  width: 280px;
  min-width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: visible; /* permite o dropdown sair do painel */
}

.admin-panel--modules {
  flex: 1;
  background: var(--bg);
  overflow-y: auto;
}

/* ── Cabeçalho dos painéis ──────────────────────── */
.admin-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.admin-panel__head--modules {
  padding: 24px 28px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.admin-panel__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.admin-panel__subtitle {
  margin: 3px 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.admin-panel__user {
  color: var(--brand-blue);
}

.admin-panel__badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--brand-blue-light);
  color: var(--brand-blue-dark);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--r-full);
}

/* ── LOV — seleção de usuário ───────────────────── */
.user-lov {
  position: relative;
  padding: 16px 16px 0;
  flex-shrink: 0;
}

.user-lov__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.user-lov__wrap {
  position: relative;
}

.user-lov__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.user-lov__input {
  width: 100%;
  height: 38px;
  padding: 0 32px 0 34px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

.user-lov__input::placeholder { color: var(--text-muted); }

.user-lov__input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(72,153,227,0.14);
  background: var(--surface);
}

.user-lov__input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.user-lov__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--border);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 120ms, color 120ms;
  padding: 0;
}

.user-lov__clear:hover {
  background: var(--brand-blue-soft);
  color: var(--brand-blue-dark);
}

.user-lov__clear[hidden] { display: none; }

/* Dropdown de resultados */
.user-lov__dropdown {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(100% + 2px);
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(13,17,23,0.12), 0 2px 8px rgba(13,17,23,0.06);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.user-lov__dropdown[hidden] { display: none; }

.user-lov__dropdown::-webkit-scrollbar { width: 4px; }
.user-lov__dropdown::-webkit-scrollbar-track { background: transparent; }
.user-lov__dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.user-lov__option {
  display: block;
  width: 100%;
  padding: 9px 14px;
  background: transparent;
  border: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: background 100ms, color 100ms;
  letter-spacing: 0.01em;
}

.user-lov__option:hover {
  background: var(--brand-blue-light);
  color: var(--text);
}

.user-lov__option mark {
  background: transparent;
  color: var(--brand-blue-dark);
  font-weight: 700;
}

.user-lov__no-results {
  padding: 12px 14px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.user-lov__hint {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-lov__hint[hidden] { display: none; }

/* Card de usuário selecionado */
.user-selected-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 16px 0;
  padding: 14px;
  background: var(--brand-blue-light);
  border: 1px solid rgba(72,153,227,0.3);
  border-radius: var(--r-md);
}

.user-selected-card[hidden] { display: none; }

.user-selected-card__avatar {
  flex-shrink: 0;
  color: var(--brand-blue);
}

.user-selected-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-selected-card__label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand-blue-dark);
  opacity: 0.7;
}

.user-selected-card__name {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-blue-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-selected-card__change {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid rgba(72,153,227,0.35);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-blue-dark);
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
  white-space: nowrap;
}

.user-selected-card__change:hover {
  background: var(--brand-blue-soft);
  border-color: var(--brand-blue);
}

/* ── Loading ────────────────────────────────────── */
.admin-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.admin-loading__spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ── Estado vazio (nenhum usuário selecionado) ─── */
.admin-empty-state[hidden] { display: none; }

.admin-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 32px;
  color: var(--text-muted);
  text-align: center;
}

.admin-empty-state svg { opacity: 0.25; }

.admin-empty-state p {
  margin: 0;
  font-size: 0.9rem;
  max-width: 320px;
  line-height: 1.6;
}

/* ── Barra de contagem ──────────────────────────── */
.module-count-bar {
  padding: 10px 28px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}

.module-count-bar__text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Toolbar de módulos ─────────────────────────── */
.module-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.module-toolbar__btn {
  height: 32px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms, border-color 150ms, color 150ms;
}

.module-toolbar__btn:hover {
  background: var(--brand-blue-light);
  border-color: rgba(72,153,227,0.35);
  color: var(--brand-blue-dark);
}

/* ── Grid de checkboxes de módulos ──────────────── */
.module-grid-check {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  padding: 20px 28px;
}

.module-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 150ms, background 150ms, box-shadow 150ms;
  user-select: none;
}

.module-check:hover {
  border-color: rgba(72,153,227,0.35);
  background: var(--brand-blue-light);
}

.module-check--checked {
  border-color: var(--brand-blue);
  background: var(--brand-blue-light);
}

.module-check__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.module-check__mark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, border-color 150ms;
  color: transparent;
}

.module-check--checked .module-check__mark {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
}

.module-check__name {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-check__uri {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

/* ── Barra de salvar ───────────────────────────── */
.module-save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 14px 28px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(13,17,23,0.06);
}

.save-status {
  font-size: 0.8125rem;
  font-weight: 500;
}

.save-status--success { color: #16a34a; }
.save-status--error   { color: #dc2626; }

.save-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 20px;
  background: var(--brand-blue);
  border: none;
  border-radius: var(--r-sm);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, box-shadow 150ms;
}

.save-btn:hover:not(:disabled) {
  background: var(--brand-blue-dark);
  box-shadow: 0 4px 12px rgba(72,153,227,0.35);
}

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

.save-btn__spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.save-btn[data-loading] .save-btn__spinner { display: inline-block; }
.save-btn[data-loading] .save-btn__text    { opacity: 0.6; }

/* ── Tela de acesso negado ──────────────────────── */
.admin-denied[hidden] { display: none; }

.admin-denied {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-h));
  padding: 32px;
}

.admin-denied__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  text-align: center;
  max-width: 380px;
}

.admin-denied__card svg { color: #dc2626; opacity: 0.8; }

.admin-denied__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.admin-denied__text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.admin-denied__link {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  background: var(--brand-blue);
  border-radius: var(--r-sm);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 150ms;
}

.admin-denied__link:hover { background: var(--brand-blue-dark); }

/* ── Responsivo ─────────────────────────────────── */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
    overflow: auto;
  }

  .admin-panel--users {
    width: 100%;
    max-height: 280px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .module-grid-check {
    grid-template-columns: 1fr 1fr;
    padding: 16px;
  }

  .admin-panel__head--modules {
    padding: 16px;
  }

  .module-save-bar { padding: 12px 16px; }
}

.toast__close:hover { opacity: 1; }
