/* PRAEMETOR · CMS UI – schlicht, dunkel, eigenständig (greift NICHT in die
   Website-Styles ein, da nur unter /admin geladen). */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #0b1018;
  color: #e7ecf3;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

.view[hidden] { display: none !important; }

/* ── Login ────────────────────────────────────────────────────────────── */
#view-login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #121a26;
  border: 1px solid #1f2a3a;
  border-radius: 10px;
  padding: 2rem 1.75rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.login-card .brand {
  display: flex; flex-direction: column; gap: 0.15rem;
  margin-bottom: 0.75rem;
}
.brand-mark {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #8aa1bf;
}
.brand-sub {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e7ecf3;
}
.login-card label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8aa1bf;
  margin-top: 0.25rem;
}
.login-card input[type="password"],
.login-card input[type="text"] {
  background: #0b1018;
  border: 1px solid #2a3a52;
  color: #e7ecf3;
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.login-card input[type="password"]:focus,
.login-card input[type="text"]:focus { border-color: #4a90c4; }

.btn {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  font-weight: 500;
  background: transparent;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn-primary {
  background: #3a7bd5;
  border-color: #3a7bd5;
  color: #fff;
}
.btn-primary:hover { background: #4a90c4; border-color: #4a90c4; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  border-color: #2a3a52;
  color: #cfd8e3;
}
.btn-ghost:hover { border-color: #4a90c4; color: #fff; }

.msg {
  min-height: 1.2em;
  font-size: 0.8rem;
  color: #ff8b8b;
}
.msg.ok { color: #7ed3a1; }

/* ── Editor ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1.25rem;
  background: #0e1521;
  border-bottom: 1px solid #1f2a3a;
}
.topbar-left { display: flex; align-items: center; gap: 0.6rem; }
.topbar-sep { color: #4a5a72; }
.topbar-title { font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 0.6rem; }
.topbar-link {
  color: #8aa1bf; text-decoration: none; font-size: 0.8rem;
  margin-right: 0.5rem;
}
.topbar-link:hover { color: #fff; }

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 56px);
}
.sidebar {
  background: #0e1521;
  border-right: 1px solid #1f2a3a;
  padding: 1rem 0.5rem;
  position: sticky; top: 56px;
  align-self: start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}
.sidebar a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 5px;
  color: #cfd8e3;
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}
.sidebar a:hover { background: #1a2436; color: #fff; }
.sidebar a.active { background: #1f2e47; color: #fff; }
.sidebar .sidebar-group {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #5a6f8a;
  padding: 0.85rem 0.85rem 0.4rem;
}

.content {
  padding: 1.5rem 2rem 4rem;
  max-width: 920px;
}
.loading { color: #8aa1bf; }

.section-block { margin-bottom: 2.5rem; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid #1f2a3a;
  padding-bottom: 0.5rem; margin-bottom: 1rem;
}
.section-title { font-size: 1.1rem; font-weight: 600; }
.section-page {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  color: #5a6f8a;
}

.field {
  display: flex; flex-direction: column; gap: 0.35rem;
  margin-bottom: 1.1rem;
}
.field-label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: #cfd8e3;
  font-weight: 500;
}
.field-key {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.65rem;
  color: #5a6f8a;
  margin-left: 0.5rem;
}
.field-hint {
  font-size: 0.72rem;
  color: #6a7d96;
}
.field input[type="text"],
.field textarea {
  width: 100%;
  background: #0b1018;
  border: 1px solid #1f2a3a;
  color: #e7ecf3;
  padding: 0.55rem 0.7rem;
  border-radius: 5px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.field input[type="text"]:focus,
.field textarea:focus { border-color: #4a90c4; }
.field textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
.field.dirty input,
.field.dirty textarea { border-color: #d8a23a; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 1.25rem; bottom: 1.25rem;
  background: #1d3b2a;
  border: 1px solid #2a5a3f;
  color: #cfeeda;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 100;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #3b1d1d; border-color: #5a2a2a; color: #ffcdcd; }

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; max-height: none;
    border-right: none; border-bottom: 1px solid #1f2a3a;
    display: flex; flex-wrap: wrap; gap: 0.25rem;
    padding: 0.6rem;
  }
  .sidebar a { padding: 0.35rem 0.6rem; font-size: 0.78rem; }
  .sidebar .sidebar-group { display: none; }
  .content { padding: 1rem; }
  .topbar { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .topbar-link { display: none; }
}
