/* Szerkesztőfelület */

body.admin { background: #eef5f3; font-size: 1rem; }

.admin-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-head__inner {
  max-width: 76rem; margin: 0 auto; padding: .6rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem;
}
.admin-brand { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.admin-brand span { font-family: var(--sans); font-size: .85rem; color: var(--ink-2); margin-left: .3rem; }
.admin-nav { display: flex; flex-wrap: wrap; gap: .2rem; flex: 1; }
.admin-nav a { padding: .4rem .8rem; border-radius: 999px; color: var(--ink-2); text-decoration: none; }
.admin-nav a:hover { background: var(--mint); color: var(--ink); }
.admin-nav a[aria-current="page"] { background: var(--sage); color: var(--ink); }
.admin-head__side { display: flex; gap: 1rem; align-items: center; font-size: .92rem; }
.admin-head__side form { margin: 0; }

.linklike { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.linklike.danger { color: var(--danger); }

.admin-main { max-width: 76rem; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.admin-main h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 1.25rem 1.4rem; margin-bottom: 1.25rem;
}
.panel h2 { font-size: 1.35rem; margin-bottom: .8rem; }
.panel h3 { font-size: 1.1rem; margin-top: 1.2rem; }

.alert { padding: .7rem 1rem; border-radius: 10px; margin: 0 0 1rem; border: 1px solid; }
.alert--ok { background: #e6f4ec; border-color: #9fcdb1; }
.alert--error { background: #fbeceb; border-color: #e0a9a6; color: #6f2320; }

/* űrlapok */
.form label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .95rem; }
.form label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.form .hint { font-weight: 400; color: var(--ink-2); font-size: .85rem; }
.form .req { color: var(--danger); }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]),
.form select,
.form textarea {
  display: block; width: 100%; margin-top: .3rem;
  padding: .55rem .75rem; min-height: 2.6rem;
  border: 1px solid #c5d9d4; border-radius: 8px; background: #fbfdfd;
  font: 400 1rem/1.4 var(--sans); color: var(--ink);
}
.form textarea { resize: vertical; line-height: 1.55; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--mint);
}
.form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem .2rem; margin: 0 0 1rem; }
.form legend { padding: 0 .4rem; font-weight: 600; }
.form label.narrow input { max-width: 8rem; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 0 1.25rem; align-items: start; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1rem; align-items: end; }

.format-help { margin: -.4rem 0 1rem; font-size: .88rem; color: var(--ink-2); }
.format-help summary { cursor: pointer; }
.format-help code { background: var(--paper); padding: .05rem .3rem; border-radius: 4px; }

.actions {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: .8rem 0; background: linear-gradient(transparent, #eef5f3 30%);
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn--small { min-height: 2rem; padding: .2rem .7rem; font-size: .85rem; }
.btn--danger { background: transparent; color: var(--danger); border-color: #d9a3a1; }
.btn--danger:hover { background: #fbeceb; color: var(--danger); }
.danger-zone { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px dashed #d9c6c5; }

/* képek */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.photo-card { border: 1px solid var(--line); border-radius: 10px; padding: .5rem; background: #fbfdfd; }
.photo-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; margin-bottom: .5rem; }
.photo-card label { font-size: .82rem; margin-bottom: .45rem; }
.photo-card input:not([type=checkbox]):not([type=radio]) { min-height: 2.1rem; padding: .3rem .5rem; font-size: .9rem; }
.photo-card__main, .photo-card__del { display: flex !important; align-items: center; gap: .4rem; font-weight: 500 !important; }
.photo-card__del { color: var(--danger); }

.upload__drop {
  display: grid !important; place-items: center; gap: .5rem; text-align: center;
  padding: 1.4rem 1rem; border: 2px dashed #b5d3cc; border-radius: 12px; background: #f6fbfa;
  cursor: pointer; font-weight: 400 !important;
}
.upload__drop.is-over { border-color: var(--accent); background: var(--mint); }
.upload__drop input { max-width: 100%; }
.upload__preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .6rem; margin-top: .8rem; }
.upload__preview figure { margin: 0; font-size: .75rem; color: var(--ink-2); word-break: break-all; }
.upload__preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.upload__preview .too-big { color: var(--danger); font-weight: 600; }

/* áttekintés */
.stat-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.stat {
  flex: 1 1 12rem; padding: 1rem 1.2rem; border-radius: var(--radius-m);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none;
}
.stat strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 2.2rem; color: var(--ink); line-height: 1.1; }
a.stat:hover { border-color: var(--accent); }
.quick { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: .4rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .75rem; justify-content: space-between; flex-wrap: wrap; }
.plain-list li:last-child { border-bottom: 0; }
.user-row form { margin: 0; }

/* személylista */
.filter { display: block; max-width: 24rem; margin-bottom: 1rem; font-weight: 600; font-size: .95rem; }
.filter input { display: block; width: 100%; margin-top: .3rem; padding: .5rem .8rem; border: 1px solid #c5d9d4; border-radius: 999px; font: inherit; }
.people-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.people-row {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .5rem 1rem; border-bottom: 1px solid #e6efed;
}
.people-row:last-child { border-bottom: 0; }
.people-row[hidden] { display: none; }
.people-row:hover { background: #f5faf9; }
.people-row[data-depth="1"] { padding-left: 2.4rem; }
.people-row[data-depth="2"] { padding-left: 3.8rem; }
.people-row[data-depth="3"] { padding-left: 5.2rem; }
.people-row[data-depth="4"] { padding-left: 6.6rem; }
.people-row[data-depth="5"] { padding-left: 8rem; }
.people-row[data-depth="6"] { padding-left: 9.4rem; }
.people-row[data-depth="7"],
.people-row[data-depth="8"] { padding-left: 10.8rem; }
.people-row__gen {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  font-size: .78rem; font-weight: 600; background: var(--gen0-fill); border: 1px solid var(--gen0-line);
}
.people-row[data-depth="1"] .people-row__gen { background: var(--gen1-fill); border-color: var(--gen1-line); }
.people-row[data-depth="2"] .people-row__gen { background: var(--gen2-fill); border-color: var(--gen2-line); }
.people-row[data-depth="3"] .people-row__gen { background: var(--gen3-fill); border-color: var(--gen3-line); }
.people-row[data-depth="4"] .people-row__gen { background: var(--gen4-fill); border-color: var(--gen4-line); }
.people-row__name { font-weight: 600; }
.people-row__meta { font-size: .88rem; flex: 1; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.table th, .table td { text-align: left; padding: .6rem 1rem; border-bottom: 1px solid #e6efed; }
.table th { font-size: .85rem; color: var(--ink-2); font-weight: 600; background: #f6fbfa; }

/* belépés, telepítés */
.admin--center { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card {
  width: min(100%, 28rem); background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 2rem; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 2rem; }
.auth-card .btn { width: 100%; }
.checks { list-style: none; padding: 0; margin: 0 0 1.25rem; font-size: .92rem; }
.checks li { display: flex; gap: .5rem; padding: .2rem 0; }
.checks .is-ok span { color: #2f7d4f; }
.checks .is-bad { color: var(--danger); font-weight: 600; }
.checks .is-warn span { color: #9a6b12; }

@media (max-width: 640px) {
  .people-row[data-depth] { padding-left: 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}

.upload-slots { margin-bottom: 1rem; }
.upload-slots input[type=file] { display: block; margin-top: .4rem; font-weight: 400; max-width: 100%; }
.photo-card--portrait { border-color: var(--accent); box-shadow: 0 0 0 2px var(--mint); }
.photo-card--family { border-color: var(--blue); box-shadow: 0 0 0 2px var(--glass); }
.photo-card select { display: block; width: 100%; margin-top: .2rem; padding: .3rem .4rem; min-height: 2.1rem; font-size: .9rem; }

.deceased-check { align-self: center; }
