
.admin-console { max-width: 1180px; }

.admin-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin: 24px 0 0;
  padding-bottom: 0;
}
.admin-tab {
  appearance: none;
  background: none;
  border: 0;
  color: var(--tx-lo);
  font: 700 12px/1 'Space Grotesk', sans-serif;
  letter-spacing: .4px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
}
.admin-tab:hover { color: var(--tx-hi); background: var(--ov-1); }
.admin-tab.is-active { color: var(--tx-hi); border-bottom-color: var(--cyan); }
.admin-panel { display: none; padding-top: 22px; }
.admin-panel.is-active { display: block; }

.admin-wide { max-width: none !important; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.admin-table th {
  text-align: left;
  color: var(--tx-faint);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: .6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--tx-mid);
}
.admin-table tr:last-child td { border-bottom: 0; }

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.admin-badge.role-admin { background: rgba(242,56,121,.15); color: var(--pink); }
.admin-badge.role-moderator { background: rgba(32,185,239,.15); color: var(--cyan); }
.admin-badge.role-user { background: var(--ov-2); color: var(--tx-lo); }
.admin-badge.status-good { background: rgba(76,219,138,.15); color: var(--green); }
.admin-badge.status-needs-review { background: rgba(255,138,48,.15); color: var(--orange); }
.admin-badge.status-reported { background: rgba(242,56,121,.15); color: var(--pink); }
.admin-badge.status-suspended { background: rgba(242,56,121,.15); color: var(--pink); }

.admin-editrow { display: none; background: var(--ov-1); }
.admin-editrow.is-open { display: table-row; }
.admin-editrow td { padding: 16px 10px; }
.admin-edit-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.admin-edit-form label { display: grid; gap: 5px; font-size: 11px; color: var(--tx-lo); min-width: 140px; }
.admin-edit-form input[type="text"],
.admin-edit-form input[type="email"],
.admin-edit-form select,
.admin-edit-form textarea {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--tx-hi);
  padding: 7px 9px;
  font: inherit;
  min-width: 180px;
}
.admin-edit-form textarea { min-height: 70px; width: 100%; resize: vertical; }
.admin-edit-form .full-width { flex: 1 1 100%; min-width: 0; }
.admin-edit-form .checkbox-field { flex-direction: row; align-items: center; gap: 8px; min-width: auto; }
.admin-edit-form .checkbox-field input { width: auto; }
.admin-edit-form-actions { display: flex; gap: 8px; margin-left: auto; }

.admin-row-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--tx-mid);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
}
.admin-row-toggle:hover { background: var(--ov-1); }

.admin-diff {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--tx-mid);
  margin: 8px 0;
  white-space: pre-wrap;
}
.admin-diff strong { color: var(--cyan); display: block; margin-bottom: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; }

.admin-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.admin-search { background: var(--ink); border: 1px solid var(--line); border-radius: 8px; color: var(--tx-hi); padding: 7px 10px; font-size: 12px; min-width: 220px; }

/* The admin stylesheet is loaded after the shared theme layer, so keep its
   table and form controls aligned with light and pink surfaces here. */
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-console {
  color: var(--theme-fg);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-tabs {
  border-color: var(--theme-border);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-tab {
  color: var(--theme-muted);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-tab:hover {
  color: var(--theme-fg);
  background: var(--theme-soft);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-tab.is-active {
  color: var(--theme-accent);
  border-bottom-color: var(--theme-accent);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-table th {
  color: var(--theme-muted);
  border-color: var(--theme-border);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-table td,
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-row-toggle,
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-diff {
  color: var(--theme-fg);
  border-color: var(--theme-border);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-editrow {
  background: var(--theme-soft);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-edit-form label {
  color: var(--theme-muted);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-edit-form input[type="text"],
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-edit-form input[type="email"],
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-edit-form select,
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-edit-form textarea,
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-search {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  color: var(--theme-fg);
  color-scheme: light;
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-table td::before {
  color: var(--theme-muted);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-badge.role-admin,
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-badge.status-reported,
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-badge.status-suspended {
  background: #fce9ed;
  color: #8a2438;
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-badge.role-moderator {
  background: #e5f5f8;
  color: #126173;
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-badge.role-user {
  background: var(--theme-soft);
  color: var(--theme-muted);
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-badge.status-good {
  background: #e5f5ee;
  color: #246345;
}
:is(body[data-theme="light"], body[data-theme="pink"]) .admin-badge.status-needs-review {
  background: #fff2df;
  color: #814500;
}

@media (max-width: 700px) {
  .admin-table, .admin-table thead, .admin-table tbody, .admin-table th, .admin-table td, .admin-table tr { display: block; }
  .admin-table thead { display: none; }
  .admin-table tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .admin-table td { border-bottom: 0; padding: 4px 0; }
  .admin-table td::before { content: attr(data-label); display: block; color: var(--tx-faint); font-size: 10px; text-transform: uppercase; margin-bottom: 2px; }
}
