:root {
  --bg: #ffffff;
  --bg-alt: #fcfcfc;
  --bg-hover: #f5f5f5;
  --text: #111111;
  --muted: #888888;
  --border: #e5e5e5;
  --border-dark: #cccccc;
  --accent: #000000;
  --sidebar: 220px;
  --radius: 4px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  min-width: 0;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Ubuntu Mono', monospace;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 13px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

code,
pre {
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 4px;
}

#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 40;
  backdrop-filter: blur(2px);
}

#overlay.show {
  display: block;
  animation: fade 0.2s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-alt);
  z-index: 50;
  transition: transform 0.3s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.nav {
  padding: 12px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  transition: all 0.15s;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-btn.active {
  background: var(--border);
  color: var(--text);
  font-weight: 700;
}

.sidebar-foot {
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
}

.meta-note {
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.base-url {
  color: var(--text);
  margin-top: 4px;
  word-break: break-all;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-footer {
  padding: 12px 24px 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
}

.topbar {
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 20;
}

.menu-btn {
  display: none;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.search-wrap i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 11px;
}

.search-input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--text);
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.05);
  outline: none;
}

.content {
  flex: 1;
  padding: 24px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.intro-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.intro-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.intro-logo-wrap {
  width: fit-content;
  padding: 6px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.intro-logo {
  display: block;
  width: min(100%, 124px);
  height: auto;
  border-radius: 2px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.stat-lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-val {
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
}

.endpoint-list {
  display: grid;
  gap: 16px;
}

.category-group {
  display: grid;
  gap: 8px;
}

.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.category-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.category-count {
  font-size: 10px;
  color: var(--muted);
}

.category-list {
  display: grid;
  gap: 8px;
}

.endpoint-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.2s;
}

.endpoint-card:hover {
  border-color: var(--border-dark);
}

.endpoint-card[open] {
  border-color: var(--text);
}

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

.endpoint-head {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}

.endpoint-head::-webkit-details-marker {
  display: none;
}

.endpoint-card[open] .endpoint-head {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.endpoint-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.endpoint-copy {
  display: grid;
  gap: 2px;
}

.endpoint-copy-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.method-text {
  font-size: 11px;
  font-weight: 700;
  width: 42px;
  text-transform: uppercase;
}

.method-text[data-method='get'] {
  color: #059669;
}

.method-text[data-method='post'] {
  color: #2563eb;
}

.method-text[data-method='put'],
.method-text[data-method='patch'] {
  color: #d97706;
}

.method-text[data-method='delete'] {
  color: #dc2626;
}

.endpoint-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.endpoint-desc-head {
  font-size: 11px;
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 0 6px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge[data-status='Funcionando'] {
  color: #15803d;
  border-color: #86efac;
  background: #f0fdf4;
}

.status-badge[data-status='Fallido'] {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.status-badge[data-status='En Mantenimiento'] {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}

.endpoint-toggle {
  color: var(--muted);
  font-size: 10px;
  transition: transform 0.2s;
}

.endpoint-card[open] .endpoint-toggle {
  transform: rotate(180deg);
  color: var(--text);
}

.endpoint-body {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.endpoint-desc {
  font-size: 12px;
  color: var(--muted);
}

.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.param-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.param-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.param-top label {
  font-size: 11px;
  font-weight: 700;
}

.required-pill {
  font-size: 9px;
  color: #dc2626;
  font-weight: 700;
}

.param-input {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  transition: all 0.2s;
}

.param-input:focus {
  border-color: var(--text);
  outline: none;
}

.param-help {
  font-size: 10px;
  color: var(--muted);
}

.param-empty {
  font-size: 11px;
  color: var(--muted);
}

.preview-box {
  padding: 8px 12px;
  background: var(--bg-alt);
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius);
}

.endpoint-url {
  font-size: 11px;
  word-break: break-all;
  color: var(--muted);
}

.endpoint-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  opacity: 0.85;
}

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

.btn-secondary:hover {
  background: var(--bg-alt);
  border-color: var(--text);
}

.btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.response-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.response-top {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.response-code {
  padding: 12px;
  font-size: 11px;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  background: var(--bg);
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.05);
  }

  .menu-btn {
    display: flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 16px;
  }

  .app-footer {
    padding: 12px 16px 16px;
  }

  .endpoint-main {
    flex-direction: column;
    gap: 4px;
  }

  .btn {
    width: 100%;
  }
}
