/* ─── Admin Page ────────────────────────────────────────────── */
.admin-page { background: var(--slate-pale); }
.hidden { display: none !important; }

/* ─── Login ─────────────────────────────────────────────────── */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-pale), #f0fdf4);
  padding: 24px;
}
.login-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.login-card h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.login-card > p { font-size: 14px; color: var(--text-3); }

/* ─── Top Bar ────────────────────────────────────────────────── */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.admin-topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-member-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-pale);
  border: 1px solid var(--blue-mid);
  padding: 4px 12px;
  border-radius: 20px;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ─── Layout ─────────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 60px);
  max-width: 1400px;
  margin: 0 auto;
}

/* ─── Side Nav ───────────────────────────────────────────────── */
.admin-sidenav {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
  width: 100%;
}
.admin-nav-btn:hover { background: var(--slate-pale); color: var(--text); }
.admin-nav-btn.active { background: var(--blue-pale); color: var(--blue); font-weight: 600; }
.anb-icon { font-size: 16px; }
.anb-badge {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.anb-badge:empty { display: none; }
.admin-nav-divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ─── Main Content ───────────────────────────────────────────── */
.admin-main { padding: 32px; overflow-y: auto; }
.admin-tab-header { margin-bottom: 24px; }
.admin-tab-header h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.admin-tab-header p { font-size: 14px; color: var(--text-3); }

.admin-search-bar { margin-bottom: 16px; }
.admin-search-bar input {
  width: 100%;
  max-width: 400px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-2);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s;
}
.admin-search-bar input:focus { border-color: var(--blue); }

/* ─── Entity List ────────────────────────────────────────────── */
.entity-list { display: flex; flex-direction: column; gap: 12px; }

.entity-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
  cursor: pointer;
}
.entity-card:hover { box-shadow: var(--shadow); }

.entity-card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--slate-pale);
}
.entity-card-body { flex: 1; min-width: 0; }
.entity-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-card-meta {
  font-size: 13px;
  color: var(--text-3);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.entity-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.entity-card-actions { display: flex; gap: 8px; flex-shrink: 0; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.status-pill.pending  { background: #fef3c7; color: #92400e; }
.status-pill.approved { background: var(--emerald-pale); color: var(--emerald); }
.status-pill.declined { background: #fee2e2; color: #991b1b; }
.status-pill.suspended { background: var(--slate-pale); color: var(--slate); }

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h4 { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.loading-state { padding: 40px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ─── Metrics ────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.metric-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.metric-card-icon { font-size: 28px; margin-bottom: 10px; }
.metric-val {
  font-size: 36px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 6px;
}
.metric-label { font-size: 13px; color: var(--text-3); font-weight: 500; }

/* ─── Entity Modal ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 200;
  backdrop-filter: blur(3px);
}
.entity-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90vw;
  max-width: 760px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.entity-modal-inner { display: flex; flex-direction: column; overflow: hidden; flex: 1; }
.entity-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.entity-modal-header h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
#modal-meta { font-size: 13px; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; }
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--slate-pale); }

.entity-modal-body {
  overflow-y: auto;
  padding: 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dna-section {}
.dna-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--blue-mid);
}
.dna-rows { display: flex; flex-direction: column; gap: 8px; }
.dna-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; font-size: 14px; }
.dna-row dt { color: var(--text-3); font-weight: 500; }
.dna-row dd { color: var(--text); white-space: pre-wrap; line-height: 1.55; }

.entity-modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--slate-pale);
  flex-shrink: 0;
  gap: 10px;
}

.btn-success { background: var(--emerald); color: #fff; border-color: var(--emerald); }
.btn-success:hover { background: var(--emerald-light); border-color: var(--emerald-light); }
.btn-danger  { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover  { background: #b91c1c; border-color: #b91c1c; }
.btn-warning { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-warning:hover { background: #c05621; border-color: #c05621; }

/* Responsive */
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidenav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .admin-main { padding: 20px 16px; }
  .entity-card { flex-direction: column; align-items: flex-start; }
  .dna-row { grid-template-columns: 1fr; gap: 2px; }
}
