.admin-main {
  padding-block: 42px 60px;
}

.login-view {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - var(--header-height) - 160px);
  padding-block: 24px;
}

.login-panel {
  position: relative;
  width: min(460px, 100%);
  padding: 36px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(28, 32, 43, 0.96), rgba(12, 14, 20, 0.98));
  box-shadow: var(--shadow);
}

.login-glow {
  position: absolute;
  top: -120px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(199, 255, 74, 0.14);
  filter: blur(60px);
  pointer-events: none;
}

.login-panel > * {
  position: relative;
  z-index: 1;
}

.login-panel > .login-glow {
  position: absolute;
  z-index: 0;
}

.login-panel h1 {
  margin-bottom: 10px;
  font-family: var(--display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.login-lede {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.login-panel form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.login-panel .field input {
  padding: 14px;
  font-size: 16px;
  letter-spacing: 0.12em;
}

.login-hint {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.6;
}

.login-hint code,
.config-note code,
.admin-footer code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font-size: 0.95em;
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.back-link:hover {
  color: var(--ink);
}

.dashboard {
  animation: fade-up 0.4s ease both;
}

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

.dashboard-head h1 {
  font-family: var(--display);
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
}

.dashboard-sub {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.summary-grid article {
  position: relative;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(25, 28, 38, 0.9), rgba(13, 15, 21, 0.95));
}

.summary-grid article:first-child {
  border-color: rgba(199, 255, 74, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(199, 255, 74, 0.1), transparent 60%),
    linear-gradient(160deg, rgba(25, 28, 38, 0.9), rgba(13, 15, 21, 0.95));
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.summary-grid strong {
  display: block;
  margin-top: 9px;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.summary-grid small {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 9px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.add-panel {
  position: sticky;
  top: calc(var(--header-height) + 18px);
}

.add-panel .panel-head {
  margin-bottom: 18px;
}

.add-panel .panel-head h2 {
  font-size: 26px;
}

#add-person-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.photo-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-dropzone {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 30%, rgba(199, 255, 74, 0.07), transparent 60%),
    rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.photo-dropzone:hover,
.photo-dropzone.is-dragging {
  border-color: rgba(199, 255, 74, 0.5);
  background: rgba(199, 255, 74, 0.045);
}

.photo-preview {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}

.photo-placeholder svg {
  width: 32px;
  height: 32px;
  margin-bottom: 5px;
  color: var(--muted);
}

.photo-placeholder b {
  color: var(--ink-soft);
  font-size: 11px;
}

.photo-placeholder small {
  color: var(--muted-2);
  font-size: 9px;
}

.field-hint {
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.45;
}

.people-panel {
  min-height: 420px;
}

.admin-people-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-person {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.admin-person:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.022);
}

.admin-person.is-passive {
  opacity: 0.56;
}

.admin-person-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.admin-person-info {
  min-width: 0;
  flex: 1;
}

.admin-person-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-person-name strong {
  overflow: hidden;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-person-bio {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-person-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 9px;
}

.admin-person-stats b {
  color: var(--ink-soft);
  font-weight: 800;
}

.admin-person-stats .live-stat {
  color: var(--lime);
}

.admin-login-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.admin-login-label {
  margin-right: 2px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.admin-login-row .mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-login-row .mini-btn svg {
  width: 11px;
  height: 11px;
}

.mini-btn.subtle {
  border-color: transparent;
  background: transparent;
  color: var(--muted-2);
}

.mini-btn.subtle:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.admin-person-actions {
  display: flex;
  flex: none;
  gap: 4px;
  align-self: flex-start;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.icon-btn.danger:hover {
  border-color: rgba(255, 107, 95, 0.35);
  background: var(--coral-soft);
  color: #ff9a91;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.active,
.status-pill.open {
  border-color: rgba(199, 255, 74, 0.25);
  background: var(--lime-soft);
  color: var(--lime);
}

.status-pill.approved {
  border-color: rgba(199, 255, 74, 0.25);
  background: var(--lime-soft);
  color: var(--lime);
}

.status-pill.rejected {
  border-color: rgba(255, 107, 95, 0.25);
  background: var(--coral-soft);
  color: #ff9a91;
}

.status-pill.inactive {
  color: var(--muted-2);
}

.status-pill.defense {
  border-color: rgba(255, 209, 102, 0.25);
  background: var(--gold-soft);
  color: var(--gold);
}

.status-pill.voting {
  border-color: rgba(183, 156, 255, 0.25);
  background: var(--violet-soft);
  color: var(--violet);
}

.status-pill.dismissed {
  color: var(--muted);
}

.status-pill.iftira {
  border-color: rgba(255, 107, 95, 0.25);
  background: var(--coral-soft);
  color: #ff9a91;
}

.sessions-panel {
  margin-top: 16px;
}

.admin-session-list {
  display: flex;
  flex-direction: column;
}

.admin-session {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1.5fr) auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}

.admin-session:last-child {
  border-bottom: 0;
}

.admin-session-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.admin-session-person-info {
  min-width: 0;
}

.admin-session-person-info strong {
  display: block;
  overflow: hidden;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-session-person-info span {
  display: block;
  color: var(--muted-2);
  font-size: 8px;
}

.admin-session-desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-session-votes {
  display: flex;
  gap: 4px;
  flex: none;
}

.vote-count {
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.vote-count.approve {
  background: var(--lime-soft);
  color: var(--lime);
}

.vote-count.reject {
  background: var(--coral-soft);
  color: #ff9a91;
}

.vote-count.missed {
  background: var(--gold-soft);
  color: var(--gold);
}

.admin-session-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: none;
}

.admin-session-state time {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-session-actions {
  display: flex;
  gap: 4px;
  flex: none;
}

.mini-btn {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.mini-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.mini-btn.danger:hover {
  border-color: rgba(255, 107, 95, 0.35);
  background: var(--coral-soft);
  color: #ff9a91;
}

.config-note {
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 9px;
  text-align: right;
}

.admin-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9px;
}

.edit-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.photo-preview.small {
  position: relative;
  inset: auto;
  flex: none;
  width: 92px;
  height: 92px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 20%, rgba(199, 255, 74, 0.2), transparent 58%),
    linear-gradient(145deg, #252a36, #14171e);
}

.photo-preview.small .avatar {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 18px;
}

.photo-preview.small .avatar span {
  font-size: 28px;
}

#edit-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
}

.check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--lime);
}

#edit-dialog .modal-shell {
  padding-top: 34px;
}

#edit-dialog h2 {
  margin-bottom: 20px;
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: -0.04em;
}

@media (max-width: 1100px) {
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .add-panel {
    position: static;
  }

  .add-panel #add-person-form {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: 13px 18px;
    align-items: start;
  }

  .add-panel .photo-field {
    grid-row: 1 / span 4;
  }

  .add-panel .photo-dropzone {
    aspect-ratio: 1;
  }

  .add-panel .field,
  .add-panel .form-error,
  .add-panel #add-submit {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .admin-main {
    padding-block: 28px 44px;
  }

  .dashboard-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-grid article:last-child {
    grid-column: auto;
  }

  .add-panel #add-person-form {
    display: flex;
    flex-direction: column;
  }

  .add-panel .photo-dropzone {
    aspect-ratio: 16 / 9;
    max-height: 240px;
  }

  .admin-session {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding: 14px 2px;
  }

  .admin-session-person {
    grid-column: 1 / 2;
  }

  .admin-session-desc {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .admin-session-votes {
    grid-column: 1 / 2;
    grid-row: 3;
  }

  .admin-session-state {
    grid-column: 2 / 3;
    grid-row: 3;
    align-items: flex-end;
  }

  .admin-session-actions {
    grid-column: 2 / 3;
    grid-row: 1;
  }

  .admin-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .login-panel {
    padding: 26px 20px;
  }

  .login-view {
    min-height: calc(100dvh - var(--header-height) - 100px);
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-person {
    align-items: flex-start;
    padding: 10px 6px;
  }

  .admin-person-actions {
    flex-direction: column;
  }

  .admin-person-bio {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }

  .admin-person-stats {
    gap: 7px;
  }

  .edit-photo-row {
    align-items: flex-start;
  }

  .photo-preview.small {
    width: 76px;
    height: 76px;
  }
}

@media (max-width: 430px) {
  .summary-grid strong {
    font-size: 26px;
  }

  .admin-person {
    flex-wrap: wrap;
  }

  .admin-person-actions {
    flex-direction: row;
    width: 100%;
    padding-left: 68px;
  }
}
