/* Panel admin (S9b) — CSS vanilla, sin frameworks. No reusa template/assets/css/tokens.css
   directamente (es una app aparte de la plantilla de sitios, sin build step), pero SÍ usa los
   mismos valores de marca que schema/example.brand.whynot.json (tokens.colores): este panel
   lo van a usar franquiciados de Why Not, no tiene sentido que se vea genérico. Paleta fija
   (no depende de prefers-color-scheme): la identidad de marca no es "modo oscuro", es la marca. */

:root {
  --bg: #000000;
  --surface: #111111;
  --surface-raised: #1a1a1a;
  --border: #2c2c2c;
  --text: #ffffff;
  --text-muted: #b3b3b3;
  --primary: #fb0f0c;
  --primary-hover: #d90d0a;
  --ok-bg: #0f2a17;
  --ok-text: #6fd99a;
  --error-bg: #3a1414;
  --error-text: #ff8b89;
  --radius: 999px;
  --radius-box: 14px;
  --font-impacto: Impact, 'Arial Narrow Bold', sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 3rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  font-family: var(--font-impacto);
  font-weight: normal;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 1.2rem;
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.current-site-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

.screen h2 {
  margin-top: 0;
}

.hint {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hint code {
  background: var(--surface-raised);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 460px;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

input,
textarea {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  background: var(--surface);
  color: var(--text);
  width: 100%;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

textarea {
  resize: vertical;
  font-weight: normal;
}

.btn {
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--primary-hover);
}

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

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

.status {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-box);
  font-size: 0.9rem;
}

.status--error {
  background: var(--error-bg);
  color: var(--error-text);
}

.status--ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.sites-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-item {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.site-item:hover {
  border-color: var(--primary);
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
}

.login-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab-btn {
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.tab-btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

h3 {
  font-family: var(--font-impacto);
  font-weight: normal;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  font-size: 1rem;
  margin: 1.5rem 0 0.75rem;
}

.form--edit fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  padding: 1rem;
  margin: 0 0 1rem;
}

.form--edit legend {
  padding: 0 0.4rem;
  font-weight: 600;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.field-label:last-child {
  margin-bottom: 0;
}

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

.edit-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 0.75rem 0;
}

.save-result {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
}

.save-summary {
  margin-top: 0;
  font-weight: 600;
}

.diff-list,
.error-details {
  padding-left: 1.2rem;
  font-size: 0.9rem;
}

.error-details {
  color: var(--error-text);
}

@media (max-width: 480px) {
  main {
    padding: 1rem 1rem;
  }

  .topbar {
    padding: 0.85rem 1rem;
  }
}
