/* Card admin — builds on ../styles.css (colours, buttons, eyebrow) */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.admin h1 {
  margin: 0 0 20px;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

/* ---------- Top bar ---------- */

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(0 26 20 / 0.96);
  color: #fff;
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.admin-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}

.admin-bar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.admin-bar__brand img {
  width: 128px;
  height: auto;
}

.admin-bar__brand span {
  padding-left: 12px;
  border-left: 1px solid rgb(255 255 255 / 0.2);
  font-size: 0.9rem;
  color: var(--brand-light);
}

.admin-bar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-bar__nav form {
  margin: 0;
}

.admin-bar__nav a,
.admin-bar__nav button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgb(255 255 255 / 0.85);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.admin-bar__nav a:hover,
.admin-bar__nav button:hover {
  background: rgb(255 255 255 / 0.1);
  color: #fff;
}

/* ---------- Layout ---------- */

.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 16px 120px;
}

.flash {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.flash--ok {
  background: #e7f0da;
  color: #2f4718;
  box-shadow: inset 0 0 0 1px #c6d9a8;
}

.flash--error {
  background: #fbe9e7;
  color: #8a1f11;
  box-shadow: inset 0 0 0 1px #f2c4bd;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--brand-ink);
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* ---------- Sign in ---------- */

.auth-card {
  max-width: 440px;
  margin: 24px auto 0;
  padding: 32px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.auth-card h1 {
  font-size: 1.5rem;
}

.stack {
  display: grid;
  gap: 16px;
}

.stack .btn {
  width: 100%;
}

/* ---------- Fields ---------- */

.field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.field__label small,
.eyebrow small {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.field__hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.field__error {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a3271a;
}

.admin input[type="text"],
.admin input:not([type]),
.admin input[type="tel"],
.admin input[type="email"],
.admin input[type="url"],
.admin input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--mist);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.admin input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 4px rgb(127 163 71 / 0.2);
}

.admin input[aria-invalid="true"] {
  border-color: #c2412f;
  background: #fff8f7;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--forest);
}

.prefix-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--mist);
  overflow: hidden;
}

.prefix-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgb(127 163 71 / 0.2);
}

.prefix-input__prefix {
  display: flex;
  align-items: center;
  padding: 0 4px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.admin .prefix-input input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding-left: 2px;
  box-shadow: none;
  background: transparent;
  font-weight: 600;
}

.link-box {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--mist);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.link-box a {
  color: var(--forest);
}

/* ---------- Staff list ---------- */

.list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.list-head .eyebrow {
  margin-bottom: 6px;
}

.list-head h1 {
  margin: 0;
}

.btn--add {
  width: auto;
  min-height: 52px;
  padding-inline: 22px;
}

.btn--sm {
  min-height: 44px;
  padding: 8px 18px;
  font-size: 0.875rem;
}

.empty {
  padding: 48px 24px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--muted);
}

.staff-list {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.staff-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.staff-row.is-new {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgb(127 163 71 / 0.18), var(--shadow-card);
}

.staff-row__avatar {
  display: block;
  overflow: hidden;
  width: 64px;
  height: 64px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--brand), var(--brand-light), var(--deep), var(--brand));
}

.staff-row__avatar img,
.staff-row__avatar span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  background: var(--forest-deep);
  color: var(--brand-light);
  font-weight: 700;
}

.staff-row__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.staff-row__text strong {
  font-size: 1.05rem;
}

.staff-row__text > span {
  color: var(--muted);
  font-size: 0.9rem;
}

.staff-row__link {
  color: var(--brand-ink);
  font-size: 0.85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tag {
  justify-self: start;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff4dc;
  color: #7a5200 !important;
  font-size: 0.75rem !important;
  font-weight: 600;
}

.staff-row__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.staff-row__more {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.staff-row__more form {
  margin: 0;
}

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--brand);
}

.icon-btn--danger {
  color: #a3271a;
}

.icon-btn--danger:hover {
  border-color: #c2412f;
  background: #fff4f2;
}

@media (min-width: 720px) {
  .staff-row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
  }
  .staff-row__actions {
    grid-column: auto;
  }
}

/* ---------- Person form ---------- */

.person-form {
  display: grid;
  gap: 16px;
}

.form-card {
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.grid-2 {
  display: grid;
  gap: 16px;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-card {
    padding: 28px;
  }
}

.photo-editor {
  display: grid;
  gap: 20px;
  justify-items: center;
  text-align: center;
}

@media (min-width: 720px) {
  .photo-editor {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    text-align: left;
    gap: 32px;
  }
}

.photo-drop {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 24px;
  border: 2px dashed transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.photo-drop.is-dragging {
  border-color: var(--brand);
  background: rgb(127 163 71 / 0.08);
}

.photo-circle {
  position: relative;
  width: 168px;
  height: 168px;
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--brand), var(--brand-light), var(--deep), var(--brand));
  touch-action: none;
  user-select: none;
}

.photo-circle.has-photo {
  cursor: grab;
}

.photo-circle.is-moving {
  cursor: grabbing;
}

.photo-circle__clip {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border: 4px solid var(--forest-deep);
  border-radius: 50%;
  background: var(--forest);
  box-sizing: border-box;
}

.photo-circle img {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  max-width: none;
  border: 0;
  border-radius: 0;
  object-fit: fill;
  pointer-events: none;
  -webkit-user-drag: none;
}

.photo-circle__empty {
  position: absolute;
  inset: 4px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 4px solid var(--forest-deep);
  border-radius: 50%;
  background: var(--forest);
  color: var(--brand-light);
  font-size: 0.85rem;
  font-weight: 600;
}

.photo-circle__empty .icon {
  width: 28px;
  height: 28px;
  color: var(--brand);
}

.photo-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.photo-controls {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

.photo-pick {
  width: 100%;
  cursor: pointer;
}

.photo-pick:focus-within {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}

.photo-controls .muted {
  margin: 0;
}

.sliders {
  display: grid;
  gap: 10px;
}

.slider {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
}

.slider input,
.zoom__row input {
  width: 100%;
  min-height: 32px;
  accent-color: var(--forest);
}

.slider__label {
  font-size: 0.85rem;
  font-weight: 600;
}

.zoom {
  display: grid;
  gap: 6px;
  text-align: left;
}

.zoom__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom__btn {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.zoom__btn:hover {
  background: var(--forest-deep);
}

.zoom__hint {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-actions .btn {
  min-width: 140px;
}

.form-actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 0 -16px;
  padding: 14px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--mist) 70%, rgb(243 246 241 / 0));
}

@media (max-width: 480px) {
  .admin-bar__brand span {
    display: none;
  }
  .form-actions .btn {
    flex: 1;
    min-width: 0;
  }
  .btn--add {
    padding-inline: 16px;
  }
}
