/* CyberZ.dk – admin-panel */

:root {
  --bg: #0a0e1a;
  --bg-raised: #111729;
  --bg-card: #141c33;
  --border: #223052;
  --text: #d7deed;
  --text-dim: #8b96b0;
  --accent: #4d8dff;
  --accent-soft: #6ea3ff;
  --danger: #e74c3c;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: #9dc1ff; }

.muted { color: var(--text-dim); }
.mono { font-family: var(--mono); font-size: 0.85em; }

h1 { font-size: 1.75rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 0.6rem; }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-card);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Header */

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.admin-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.admin-logo span { color: var(--accent); }
.admin-logo small { color: var(--text-dim); font-weight: 400; }

.admin-nav { display: flex; flex-wrap: wrap; gap: 0.15rem; }

.admin-nav a {
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.admin-nav a:hover { color: var(--text); background: var(--bg-card); }
.admin-nav a.logout { color: #f1948a; }

/* Main */

.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

.breadcrumb { font-size: 0.9rem; margin-bottom: 0.5rem; }

/* Kort og statistik */

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.admin-card h2 { margin-top: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  color: var(--text);
  transition: border-color 0.15s;
}

.stat-card:hover { border-color: var(--accent); color: var(--text); }

.stat-number { display: block; font-size: 2rem; font-weight: 800; color: var(--accent-soft); }
.stat-label { color: var(--text-dim); font-size: 0.9rem; }

.quick-links { list-style: none; }
.quick-links li { margin-bottom: 0.5rem; }
.tips { margin-left: 1.25rem; }
.tips li { margin-bottom: 0.4rem; }

/* Tabeller */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.admin-table th { font-size: 0.85rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.admin-table tr:last-child td { border-bottom: 0; }
.col-narrow { width: 70px; text-align: center; }

/* Formularer */

.edit-form { display: flex; flex-direction: column; gap: 1.1rem; margin-top: 1rem; }
.edit-form.narrow { max-width: 420px; }

.edit-form label, .album-desc-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
}

.edit-form input[type="text"],
.edit-form input[type="email"],
.edit-form input[type="url"],
.edit-form input[type="number"],
.edit-form input[type="password"],
.edit-form textarea,
.inline-form input[type="text"],
.album-desc-label input,
.login-box input {
  font: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

.edit-form textarea {
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 300px;
}

.edit-form input:focus, .edit-form textarea:focus,
.inline-form input:focus, .login-box input:focus,
.album-desc-label input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 141, 255, 0.18);
}

.checkbox-label { flex-direction: row !important; align-items: center; gap: 0.6rem !important; font-weight: 400 !important; }
.checkbox-label input { width: 18px; height: 18px; accent-color: var(--accent); }

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

.inline-form { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.inline-form input { flex: 1; min-width: 200px; }

.social-rows { display: flex; flex-direction: column; gap: 0.6rem; }
.social-row { display: grid; grid-template-columns: 1fr 2fr; gap: 0.6rem; }

.menu-link-rows { display: flex; flex-direction: column; gap: 0.6rem; }

.menu-link-row {
  display: grid;
  grid-template-columns: 1fr 2fr 90px 60px;
  gap: 0.6rem;
  align-items: center;
}

.menu-link-head {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.menu-link-head span:last-child { text-align: center; }

.menu-link-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  justify-self: center;
}

.md-help summary { cursor: pointer; color: var(--accent-soft); font-size: 0.9rem; }
.md-help pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  overflow-x: auto;
}

/* Knapper */

.btn {
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #3567d6);
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  cursor: pointer;
  display: inline-block;
}

.btn:hover { filter: brightness(1.12); }

.btn-small { padding: 0.35rem 0.9rem; font-size: 0.85rem; font-weight: 600; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.btn-danger { background: linear-gradient(120deg, #c0392b, #922b21); }

.link-btn {
  background: none;
  border: 0;
  color: var(--accent-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 0;
}

.link-btn.danger { color: #f1948a; }

/* Galleri-admin */

.upload-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; }

.upload-form input[type="file"] {
  color: var(--text-dim);
  flex: 1;
  min-width: 220px;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.admin-photo {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }

.admin-photo input {
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg-raised);
  border: 0;
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
}

.admin-photo input:focus { outline: none; background: var(--bg); }

.photo-actions {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0.7rem;
  border-top: 1px solid var(--border);
}

.page-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.page-img-grid figure {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 0;
}

.page-img-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.page-img-grid .img-actions {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-top: 1px solid var(--border);
}

.danger-zone {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px dashed rgba(231, 76, 60, 0.4);
}

/* Beskeder */

.alert {
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.alert-ok { background: rgba(46, 204, 113, 0.12); border: 1px solid rgba(46, 204, 113, 0.4); color: #7ee2a8; }
.alert-error { background: rgba(231, 76, 60, 0.12); border: 1px solid rgba(231, 76, 60, 0.4); color: #f1948a; }

/* Login */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.25rem;
}

.login-box {
  width: min(400px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
}

.login-box .admin-logo { display: block; margin-bottom: 1.25rem; font-size: 1.3rem; }
.login-box h1 { font-size: 1.3rem; }
.login-hint { color: var(--text-dim); font-size: 0.92rem; margin: 0.5rem 0 0.75rem; }

.login-box form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.login-box label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; font-weight: 600; color: var(--text-dim); }

/* Mobil */

@media (max-width: 640px) {
  .social-row { grid-template-columns: 1fr; }
  .menu-link-row { grid-template-columns: 1fr 1fr; }
  .menu-link-head { display: none; }
  .admin-table th:nth-child(2), .admin-table td:nth-child(2) { display: none; }
}
