/* Admin-område: bygger oven på styles.css */
body.admin { --max: 1000px; background: var(--bg); }
.admin-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; justify-content: flex-end; }
.admin-nav a, .link-button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.75rem; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 650; background: none; border: 0; font: inherit; cursor: pointer;
}
.admin-nav a:hover, .link-button:hover { background: var(--surface); }
.admin-nav a[aria-current="page"] { background: var(--surface-2); }
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .admin-nav { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
}

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: space-between; margin: 0.5rem 0 1rem; }
.toolbar h1 { margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.row {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center;
  padding: 0.75rem 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.row .row-main { flex: 1 1 260px; min-width: 0; }
.row .row-title { font-weight: 750; font-size: 1.08rem; color: var(--text); }
.row .row-meta { color: var(--muted); font-size: 0.95rem; }
.row .row-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.btn {
  min-height: 44px; min-width: 44px; padding: 0.4rem 0.8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { background: #352f72; color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #0d0b24; }
.btn.danger, .button.danger { background: #c62845; border-color: #c62845; color: #fff; }
.btn.small { min-height: 40px; padding: 0.25rem 0.6rem; font-size: 0.95rem; }

.status { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.85rem; font-weight: 750; margin-left: 0.4rem; vertical-align: middle; }
.status.published { background: #1f6b3d; }
.status.draft { background: #6b5a1f; }
.status.archived { background: #555; }
.status.changes { background: #1f4f6b; }

.form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.3rem; }
.field label, .field .label { font-weight: 700; }
.field .hint { color: var(--muted); font-size: 0.92rem; margin: 0; }
input[type="text"], input[type="url"], input[type="number"], input[type="password"], input[type="search"], textarea, select {
  width: 100%; min-height: 48px; padding: 0.6rem 0.75rem; border-radius: 10px;
  border: 1px solid #5d579a; background: #110e2e; color: var(--text); font: inherit;
}
textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
input[type="color"] { width: 64px; height: 48px; border: 1px solid #5d579a; border-radius: 10px; background: #110e2e; }
.checkbox { display: flex; gap: 0.6rem; align-items: center; min-height: 44px; }
.checkbox input { width: 22px; height: 22px; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem; margin: 0; }
legend { font-weight: 800; padding: 0 0.4rem; }
.subrow { display: grid; gap: 0.5rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 0.6rem; background: #15123a; }
.subrow .row-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  padding: 0.75rem; margin: 1.5rem -0.75rem 0; background: rgba(13, 11, 36, 0.96); border-top: 1px solid var(--line);
}
.savebar .spacer { flex: 1; }
.notice { padding: 0.75rem 1rem; border-radius: 10px; background: #1f4f6b; margin: 0 0 1rem; }
.notice.warn { background: #6b5a1f; }
.error-box { padding: 0.75rem 1rem; border-radius: 10px; background: #7a1d30; margin: 0 0 1rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; text-decoration: none; color: var(--text); }
.stat strong { display: block; font-size: 2rem; line-height: 1.1; }

.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 50;
  background: #fff; color: #000; padding: 0.7rem 1.1rem; border-radius: 10px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); max-width: calc(100vw - 2rem);
}
.toast:empty { display: none; }
.dialog { max-width: 520px; width: calc(100vw - 2rem); border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); color: var(--text); padding: 1.25rem; }
.dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
.login { max-width: 420px; margin: 3rem auto; }
