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

:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #9ca3af;
  --get: #16a34a;
  --post: #2563eb;
  --put: #d97706;
  --delete: #dc2626;
  --accent: #7c3aed;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.logo { font-weight: 600; font-size: 15px; letter-spacing: 0.5px; }
.base-url { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }

main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Panel izquierdo */
.panel-left {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
}

.model-section { margin-bottom: 4px; }

.model-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.model-title:hover { color: var(--text); }
.chevron { transition: transform 0.2s; }
.model-title.collapsed .chevron { transform: rotate(-90deg); }

.model-desc {
  padding: 0 20px 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.endpoints { padding: 4px 0; }
.endpoints.hidden { display: none; }

.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  transition: background 0.15s;
}
.endpoint:hover { background: var(--surface); }
.endpoint.active { background: #ffffff08; }

.badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 52px;
  text-align: center;
}
.badge.get    { background: #3fb95020; color: var(--get); }
.badge.post   { background: #58a6ff20; color: var(--post); }
.badge.put    { background: #d2992220; color: var(--put); }
.badge.delete { background: #f8514920; color: var(--delete); }

.endpoint-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.url { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.desc {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
}

/* Panel derecho */
.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
}
.status-badge.ok     { background: #3fb95020; color: var(--get); }
.status-badge.error  { background: #f8514920; color: var(--delete); }
.status-badge.warn   { background: #d2992220; color: var(--put); }

/* Formulario */
.form-area {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: #ffffff03;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.form-area input, .form-area textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}
.form-area input:focus, .form-area textarea:focus { border-color: var(--accent); }
.form-area textarea { min-height: 100px; resize: vertical; }

.send-btn {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.send-btn:hover { opacity: 0.85; }

/* JSON area */
.json-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.7;
}

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

.json-key    { color: #79b8ff; }
.json-string { color: #9ecbff; }
.json-number { color: #f8c555; }
.json-bool   { color: #56d364; }
.json-null   { color: var(--muted); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.2s ease; }

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
