:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-solid: #0f172a;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --violet: #8b5cf6;
  --violet-light: #c4b5fd;
  --fuchsia: #d946ef;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(139, 92, 246, 0.22), transparent 34rem),
    radial-gradient(circle at 88% 8%, rgba(217, 70, 239, 0.13), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #030712 55%, #020617 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.body-centered {
  display: flex;
  flex-direction: column;
}

a {
  color: var(--violet-light);
  text-decoration: none;
}

a:hover {
  color: #ede9fe;
}

code {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.7);
  padding: 0.1rem 0.35rem;
  color: var(--muted-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

.background-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(2, 6, 23, 0.55), rgba(2, 6, 23, 0.92)),
    radial-gradient(circle at 50% -10%, rgba(139, 92, 246, 0.25), transparent 48rem);
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), var(--fuchsia));
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.28);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
}

.brand-text {
  font-size: 1rem;
}

.brand-text span {
  color: var(--muted);
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.main {
  padding-block: 2.5rem 4rem;
  flex: 1;
}

.main-centered {
  display: grid;
  place-items: center;
  padding-block: 4rem;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0.2rem 0 0;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.page-desc {
  max-width: 46rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.section-kicker {
  margin: 0;
  color: var(--violet-light);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  padding: 1.4rem;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-title {
  margin: 0.15rem 0 0;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.card-desc {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

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

.mt-6 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.28rem 0.65rem;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-ok {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.1);
  color: #a7f3d0;
}

.badge-warn {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
}

.stack {
  display: grid;
  gap: 1rem;
}

.form-compact {
  gap: 0.9rem;
}

.field-label {
  display: block;
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 600;
}

.field {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(2, 6, 23, 0.72);
  padding: 0.68rem 0.85rem;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field::placeholder {
  color: #64748b;
}

.field:focus {
  border-color: rgba(167, 139, 250, 0.85);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.field-hint {
  display: block;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.field-inline {
  flex: 1;
  min-width: 12rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap .field {
  padding-right: 4rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-15%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0.35rem 0.55rem;
  color: var(--muted-strong);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
}

.password-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.62rem 0.95rem;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.btn:hover {
  color: white;
}

.btn:focus-visible {
  outline: 2px solid var(--violet-light);
  outline-offset: 2px;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--fuchsia));
  box-shadow: 0 10px 28px rgba(139, 92, 246, 0.24);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted-strong);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-danger-ghost {
  border-color: rgba(251, 113, 133, 0.22);
  background: rgba(251, 113, 133, 0.05);
  color: #fecdd3;
}

.btn-danger-ghost:hover {
  background: rgba(251, 113, 133, 0.13);
}

.btn-small {
  border-radius: 8px;
  padding: 0.38rem 0.6rem;
  font-size: 0.76rem;
}

.btn-block {
  width: 100%;
}

.stat-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.steps {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.steps li {
  margin-block: 0.45rem;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.code-block {
  flex: 1;
  min-width: 12rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(2, 6, 23, 0.72);
  padding: 0.55rem 0.7rem;
  color: var(--muted-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.84rem;
}

.link {
  text-decoration: underline;
  text-decoration-color: rgba(196, 181, 253, 0.4);
  text-underline-offset: 3px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.86rem;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.8rem;
  text-align: left;
  vertical-align: middle;
}

.table th {
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.table tr:last-child td {
  border-bottom: 0;
}

.align-right {
  text-align: right !important;
}

.nowrap {
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.text-danger {
  color: var(--danger);
}

.token-label {
  color: var(--text);
  font-weight: 600;
}

.token-masked,
.token-value {
  margin-top: 0.15rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.token-value {
  max-width: 34rem;
  color: var(--violet-light);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.empty-cell {
  padding: 1.5rem !important;
  color: var(--muted);
  text-align: center !important;
}

.alert {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.84rem;
}

.alert-error {
  border-color: rgba(251, 113, 133, 0.32);
  background: rgba(251, 113, 133, 0.1);
  color: #fecdd3;
}

.alert-success {
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(52, 211, 153, 0.1);
  color: #a7f3d0;
}

.alert-info {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.08);
  color: var(--muted-strong);
}

.alert-warn {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
}

.pill-warn {
  background: rgba(251, 191, 36, 0.15);
  color: #fde68a;
}

.auth-card {
  width: min(460px, 100%);
}

.auth-title {
  margin: 0.3rem 0 0;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.auth-desc {
  margin: 0.6rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-footnote {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.empty-state .card-desc {
  max-width: 36rem;
  margin-inline: auto;
}

.empty-state .btn {
  margin-top: 1rem;
}

.file-name {
  font-weight: 600;
}

.file-path {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.files-table {
  min-width: 760px;
}

/* Diálogo simples para exibir o token recém-criado. */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.8);
  padding: 1rem;
  backdrop-filter: blur(6px);
}

.dialog {
  width: min(640px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  padding: 1.25rem;
}

.dialog-title {
  margin: 0;
  font-size: 1.1rem;
}

.dialog-text {
  color: var(--muted);
  font-size: 0.86rem;
}

.dialog-token {
  max-height: 8rem;
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.7);
  padding: 0.7rem;
  color: var(--violet-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 1.2rem, 1180px);
  }

  .topbar-inner {
    min-height: 3.8rem;
  }

  .brand-text span {
    display: none;
  }

  .main {
    padding-block: 1.5rem 3rem;
  }

  .card {
    padding: 1.1rem;
  }

  .nav-link {
    padding: 0.45rem 0.55rem;
    font-size: 0.82rem;
  }

  .footer {
    flex-direction: column;
  }
}
