/* Team dashboard (/admin). Builds on site.css: the light sidebar is the
   extension's left nav panel, the dark main area its menu surface. */

.admin-body { background: var(--set2-color); }

/* ---------- sign-in gate ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 32px; box-sizing: border-box; }
.gate[hidden] { display: none; }
.gate__card {
  width: 100%; max-width: 440px; box-sizing: border-box; padding: 40px;
  border: 4px solid var(--set1-color); border-radius: var(--ui-radius); corner-shape: var(--ui-corner);
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
}
.gate__card .brand { margin-bottom: 8px; }
.gate__denied { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.gate__denied[hidden] { display: none; }

/* ---------- layout ---------- */
.admin { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.admin[hidden] { display: none; }
.admin__side {
  position: sticky; top: 0; height: 100vh; box-sizing: border-box;
  background: var(--set1-color); color: var(--set2-color);
  padding: 28px 24px; display: flex; flex-direction: column; gap: 28px;
}
.admin__side .brand { color: var(--set2-color); }
.admin__side .brand__mark path, .admin__side .brand__mark text { fill: var(--set2-color); }
.admin__brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; box-sizing: border-box;
  border: 2px solid currentColor; border-radius: calc(var(--ui-radius) - 14px); corner-shape: var(--ui-corner);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.admin__nav { display: flex; flex-direction: column; gap: 4px; }
.admin__nav a, .admin__nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  height: 44px; padding: 0 14px; box-sizing: border-box;
  border-radius: calc(var(--ui-radius) - 8px); corner-shape: var(--ui-corner);
  font-size: 14px; font-weight: 700; color: var(--set2-color);
}
.admin__nav a:hover { background: rgba(0, 0, 0, 0.07); text-decoration: none; }
.admin__nav a[aria-current="page"] { background: var(--set2-color); color: var(--set1-color); }
.admin__nav-heading { font-size: 12px; font-weight: 700; opacity: 0.7; padding: 16px 14px 4px; }
.admin__nav-item.is-disabled { opacity: 0.55; cursor: default; }
.admin__account {
  margin-top: auto; padding-top: 20px; border-top: 2px solid var(--set2-color);
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 13px;
}
.admin__account b { font-size: 14px; }
.admin__email { word-break: break-all; }
.admin__main { padding: 40px 40px 80px; min-width: 0; }

/* ---------- views ---------- */
.view { display: flex; flex-direction: column; gap: 28px; }
.view[hidden] { display: none; }
.view__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.view__head .section__intro { max-width: 620px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat {
  border: 3px solid var(--set1-color); border-radius: calc(var(--ui-radius) - 4px); corner-shape: var(--ui-corner);
  padding: 18px; display: flex; flex-direction: column; gap: 6px;
}
.stat__value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.stat__label { font-size: 13px; }

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; align-items: start; }
.panel {
  background: var(--set1-color); color: var(--set2-color);
  border-radius: var(--ui-radius); corner-shape: var(--ui-corner); padding: 20px 20px 8px;
  display: flex; flex-direction: column;
}
.panel h3 { font-size: 13px; font-weight: 700; padding-bottom: 10px; }
.panel__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%;
  padding: 10px 0; border: 0; border-top: 2px solid var(--set2-color); background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.panel__row:hover b { text-decoration: underline; }
.panel__row b { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; min-width: 0; }
.panel__row span { font-size: 12px; white-space: nowrap; }
.panel .rm-empty { padding: 10px 0 12px; }

/* ---------- community ---------- */
.add-form {
  border: 3px solid var(--set1-color); border-radius: var(--ui-radius); corner-shape: var(--ui-corner);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.add-form[hidden] { display: none; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.toolbar > .field { flex: 1 1 240px; width: auto; height: 44px; }
.toolbar > select.field { flex: 0 1 auto; }
.toolbar__summary { font-size: 13px; margin-left: auto; }

.table {
  display: flex; flex-direction: column; overflow: hidden;
  border: 3px solid var(--set1-color); border-radius: var(--ui-radius); corner-shape: var(--ui-corner);
}
.table__head, .table__row {
  display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) 150px 70px 90px 90px;
  gap: 12px; align-items: center; padding: 12px 18px; box-sizing: border-box;
}
.table__head { font-size: 12px; font-weight: 700; opacity: 0.75; border-bottom: 2px solid var(--set1-color); }
.table__body { display: flex; flex-direction: column; }
.table__row {
  width: 100%; border: 0; border-top: 2px solid rgba(255, 255, 255, 0.12);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.table__row:first-child { border-top: 0; }
.table__row:hover { background: rgba(255, 255, 255, 0.07); }
.table__title { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; font-weight: 700; }
.table__title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table__cell { font-size: 13px; min-width: 0; }
.table__cell--num { text-align: right; font-variant-numeric: tabular-nums; }
.table__empty { padding: 18px; }
.stage-badge--light { border-color: var(--set1-color); height: 26px; font-size: 11px; padding: 0 10px; }

/* ---------- drawer ---------- */
.drawer__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.drawer__form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.drawer__form[hidden] { display: none; }
.comment__likes { font-size: 12px; }
.drawer__danger { padding-top: 20px; border-top: 2px solid var(--set2-color); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .admin__side { position: static; height: auto; gap: 18px; }
  .admin__nav { flex-direction: row; flex-wrap: wrap; }
  .admin__nav-heading { width: 100%; padding: 8px 14px 0; }
  .admin__account { margin-top: 0; padding-top: 14px; }
  .admin__main { padding: 24px 20px 64px; }
  .table__head { display: none; }
  .table__row { grid-template-columns: 1fr auto; grid-template-areas: "title stage" "author likes"; gap: 6px 12px; }
  .table__row > :nth-child(1) { grid-area: title; }
  .table__row > :nth-child(2) { grid-area: author; }
  .table__row > :nth-child(3) { grid-area: stage; justify-self: end; }
  .table__row > :nth-child(4) { grid-area: likes; justify-self: end; }
  .table__row > :nth-child(5), .table__row > :nth-child(6) { display: none; }
}
