/* ==========================================================================
   义乌AI圈 · 账房后台 / admin console
   Same paper-ink-vermilion system, denser. Built on styles.css.
   ========================================================================== */

/* ---------- admin shell ---------- */
.adm {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--paper);
}

/* ---------- sidebar ---------- */
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 18px 0 14px;
  overflow: hidden;
  z-index: 40;
}

.side::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.18;
  pointer-events: none;
}

.side__brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(242, 236, 221, 0.12);
}

.side__logo {
  display: block;
  height: 32px;
  width: auto;
}

.side__tag {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(242, 236, 221, 0.55);
  padding: 3px 7px;
  border: 1px solid rgba(242, 236, 221, 0.2);
  border-radius: var(--r-sm);
  white-space: nowrap;
}

.side__nav {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 236, 221, 0.2) transparent;
}

.side__group {
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 236, 221, 0.32);
  padding: 16px 10px 7px;
}

.side__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-left: 2px solid transparent;
  color: rgba(242, 236, 221, 0.68);
  font-size: 13px;
  border-radius: 0 2px 2px 0;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.side__link span.i {
  font-family: var(--f-mono);
  font-size: 8.5px;
  color: rgba(242, 236, 221, 0.3);
  letter-spacing: 0.06em;
}

.side__link:hover { background: rgba(242, 236, 221, 0.06); color: var(--paper); }

.side__link.is-on {
  background: rgba(242, 236, 221, 0.1);
  color: var(--paper);
  border-left-color: var(--red);
  font-weight: 500;
}

.side__link.is-on span.i { color: #e0806a; }

.side__badge {
  margin-left: auto;
  min-width: 17px;
  height: 16px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 8.5px;
  border-radius: 8px;
}

.side__foot {
  position: relative;
  margin-top: auto;
  padding: 12px 16px 0;
  border-top: 1px solid rgba(242, 236, 221, 0.12);
  display: flex;
  align-items: center;
  gap: 9px;
}

.side__foot .avatar { width: 30px; height: 30px; font-size: 13px; background: var(--paper); color: var(--ink); border-color: var(--paper); }
.side__who { min-width: 0; flex: 1; }
.side__who strong { display: block; font-size: 12px; font-weight: 500; }
.side__who span {
  display: block;
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: rgba(242, 236, 221, 0.4);
  text-transform: uppercase;
}

.side__out {
  background: none;
  border: 1px solid rgba(242, 236, 221, 0.2);
  color: rgba(242, 236, 221, 0.7);
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.side__out:hover { border-color: var(--paper); color: var(--paper); }

/* ---------- main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 62px;
  padding: 0 26px;
  background: rgba(242, 236, 221, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-strong);
}

.topbar__crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.topbar__crumbs b { color: var(--ink); font-weight: 500; }

.topbar__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--ink-55);
}

.topbar__dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar__dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(31, 107, 58, 0.14);
}

.view { padding: 26px 26px 64px; min-width: 0; }

/* ---------- page head ---------- */
.ahead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line-strong);
}

.ahead__kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 8px;
}
.ahead__kicker b { color: var(--red); font-weight: 500; }

.ahead h1 {
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.ahead__sub {
  font-size: 13px;
  color: var(--ink-55);
  margin-top: 5px;
  text-wrap: pretty;
}

.ahead__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- KPI ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--ink);
  border: 1px solid var(--line-strong);
  margin-bottom: 20px;
}

.kpi {
  background: var(--card);
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
}

.kpi__label {
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-40);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.kpi__label i { font-style: normal; color: var(--red); }

.kpi__value {
  font-family: var(--f-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.25;
  margin-top: 4px;
}

.kpi__value small { font-size: 12px; color: var(--ink-40); font-weight: 400; letter-spacing: 0; }

.kpi__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-55);
  margin-top: 2px;
}
.kpi__foot b { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; }
.kpi__up b { color: var(--ok); }
.kpi__down b { color: var(--red); }

/* ---------- panels ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.grid-2--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.panel {
  background: var(--card);
  border: 1px solid var(--line-strong);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--ink-12);
  flex-wrap: wrap;
}

.panel__title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.panel__title .mono { color: var(--ink-40); font-weight: 400; }

.panel__body { padding: 18px; }
.panel__body--flush { padding: 0; }

.panel__link {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-55);
  border-bottom: 1px solid var(--ink-20);
  padding-bottom: 1px;
}
.panel__link:hover { color: var(--red); border-color: var(--red); }

/* ---------- chart ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--f-mono); font-size: 8px; letter-spacing: 0.08em; fill: var(--ink-40); }
.chart .axis { stroke: var(--ink-12); stroke-width: 1; }
.chart .area { fill: rgba(196, 53, 28, 0.08); }
.chart .line { fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--paper); stroke: var(--red); stroke-width: 1.5; }
.chart .bar { fill: var(--ink); opacity: 0.82; }
.chart .bar--red { fill: var(--red); }

.chart-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-55);
  text-transform: uppercase;
}
.chart-legend i {
  display: inline-block;
  width: 14px; height: 2px;
  background: var(--red);
  margin-right: 5px;
  vertical-align: middle;
}

/* ---------- bars (plan distribution) ---------- */
.dist { display: grid; gap: 16px; }

.dist__row { display: grid; gap: 7px; }

.dist__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}
.dist__top b { font-family: var(--f-mono); font-size: 13px; font-weight: 500; }
.dist__top span { color: var(--ink-55); font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.06em; }

.dist__track { height: 6px; background: var(--ink-08); overflow: hidden; }
.dist__track i { display: block; height: 100%; background: var(--ink); transition: width 0.6s var(--ease); }
.dist__track i.red { background: var(--red); }
.dist__track i.teal { background: var(--teal); }

/* ---------- table ---------- */
.tbl-wrap { width: 100%; overflow-x: auto; }

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}

.tbl th {
  text-align: left;
  font-family: var(--f-mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
  padding: 9px 14px;
  border-bottom: 1px solid var(--ink-12);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 1;
}

.tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-08);
  vertical-align: middle;
}

.tbl tbody tr { transition: background 0.15s; cursor: pointer; }
.tbl tbody tr:hover { background: rgba(20, 18, 10, 0.035); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.is-static { cursor: default; }

.tbl .num { font-family: var(--f-mono); font-size: 12px; letter-spacing: -0.01em; }
.tbl .muted { color: var(--ink-55); }
.tbl .strong { font-weight: 600; }

.tbl__user { display: flex; align-items: center; gap: 9px; }
.tbl__user .avatar { width: 27px; height: 27px; font-size: 12px; }
.tbl__user div { display: grid; gap: 1px; }
.tbl__user strong { font-size: 12.5px; font-weight: 600; }
.tbl__user span { font-family: var(--f-mono); font-size: 9px; color: var(--ink-40); letter-spacing: 0.04em; }

.tbl__acts { display: flex; gap: 4px; justify-content: flex-end; }

.row-btn {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--ink-20);
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--ink-70);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.row-btn:hover { border-color: var(--ink); color: var(--ink); background: var(--paper); }
.row-btn--red { color: var(--red); border-color: rgba(196, 53, 28, 0.3); }
.row-btn--red:hover { background: var(--red); border-color: var(--red); color: var(--paper); }

/* ---------- pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--ink-20);
  border-radius: var(--r-sm);
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.pill--ok { color: var(--ok); border-color: rgba(31, 107, 58, 0.3); background: rgba(31, 107, 58, 0.06); }
.pill--warn { color: var(--gold); border-color: rgba(168, 128, 44, 0.35); background: rgba(168, 128, 44, 0.07); }
.pill--red { color: var(--red); border-color: rgba(196, 53, 28, 0.3); background: rgba(196, 53, 28, 0.06); }
.pill--ink { color: var(--ink); border-color: var(--ink-20); background: var(--ink-06); }
.pill--teal { color: var(--teal); border-color: rgba(20, 80, 74, 0.3); background: rgba(20, 80, 74, 0.06); }
.pill--mute { color: var(--ink-40); border-color: var(--ink-12); }
.pill--mute::before { display: none; }

/* ---------- filters ---------- */
.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--ink-12);
}

.adm-search {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--ink-20);
  background: var(--paper);
  min-width: 190px;
  flex: 0 1 240px;
}
.adm-search:focus-within { border-color: var(--ink); }
.adm-search input {
  border: 0;
  background: none;
  outline: none;
  font-family: var(--f-sans);
  font-size: 12.5px;
  color: var(--ink);
  width: 100%;
}
.adm-search svg { width: 13px; height: 13px; color: var(--ink-40); flex: 0 0 auto; }

.filters .chip { height: 30px; font-size: 12px; padding: 0 11px; }

.filters__count {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-40);
  text-transform: uppercase;
  white-space: nowrap;
}
.filters__count b { color: var(--ink); font-weight: 500; }

/* ---------- todo list ---------- */
.todo { display: grid; }

.todo__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--ink-08);
  font-size: 12.5px;
}
.todo__item:last-child { border-bottom: 0; }
.todo__item:hover { background: rgba(20, 18, 10, 0.03); }

.todo__n {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink-20);
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-55);
  flex: 0 0 auto;
}
.todo__item.is-hot .todo__n { border-color: var(--red); color: var(--red); }
.todo__body { min-width: 0; flex: 1; }
.todo__body strong { display: block; font-size: 12.5px; font-weight: 600; }
.todo__body span { font-size: 11.5px; color: var(--ink-55); }

/* ---------- plan cards ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }

.plan {
  border: 1px solid var(--line-strong);
  background: var(--card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.plan--pro { background: var(--paper); }
.plan--pro .plan__head { padding-right: 34px; }
.plan--pro::before {
  content: "推荐";
  position: absolute;
  top: -1px; right: -1px;
  background: var(--red);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  padding: 3px 7px;
}

.plan__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.plan__name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.plan__id { font-family: var(--f-mono); font-size: 8.5px; color: var(--ink-40); letter-spacing: 0.1em; text-transform: uppercase; }

.plan__price {
  font-family: var(--f-mono);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.plan__price small { font-size: 10px; color: var(--ink-40); letter-spacing: 0; }

.plan__feats { display: grid; gap: 5px; margin: 2px 0 4px; }
.plan__feats li {
  font-size: 11.5px;
  color: var(--ink-70);
  display: flex;
  gap: 6px;
  line-height: 1.6;
}
.plan__feats li::before { content: "·"; color: var(--red); font-weight: 700; }

.plan__foot { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.plan__count {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--ink-40);
  letter-spacing: 0.06em;
}

/* ---------- switch ---------- */
.switch {
  position: relative;
  width: 38px;
  height: 21px;
  border: 1px solid var(--ink-40);
  background: var(--paper-2);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex: 0 0 auto;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 15px; height: 15px;
  background: var(--ink);
  border-radius: 50%;
  transition: left 0.2s var(--ease), background 0.2s;
}
.switch[aria-checked="true"] { background: var(--ink); border-color: var(--ink); }
.switch[aria-checked="true"]::after { left: 19px; background: var(--paper); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--ink-12);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row__t strong { display: block; font-size: 12.5px; font-weight: 600; }
.switch-row__t span { font-size: 11.5px; color: var(--ink-55); line-height: 1.6; }

/* ---------- drawer ---------- */
.drawer-veil {
  position: fixed;
  inset: 0;
  background: rgba(14, 12, 6, 0.42);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.drawer-veil.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: min(446px, 100%);
  background: var(--paper);
  border-left: 1px solid var(--line-strong);
  z-index: 160;
  display: flex;
  flex-direction: column;
  transform: translateX(101%);
  transition: transform 0.32s var(--ease);
  box-shadow: -18px 0 40px -30px rgba(20, 18, 10, 0.6);
}
.drawer.is-open { transform: none; }

.drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-strong);
}
.drawer__kicker {
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 5px;
}
.drawer__head h2 { font-size: 19px; letter-spacing: -0.02em; }
.drawer__head p { font-size: 11.5px; color: var(--ink-55); margin-top: 3px; }

.drawer__close {
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid var(--ink-20);
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-55);
  flex: 0 0 auto;
}
.drawer__close:hover { border-color: var(--ink); color: var(--ink); }

.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 24px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.drawer__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--ink-12);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
}
.drawer__foot .btn { height: 38px; font-size: 13px; }
.drawer__foot .spacer { flex: 1; }

/* ---------- form in drawer/modal ---------- */
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dgrid .full { grid-column: 1 / -1; }

.dfield { display: grid; gap: 6px; }

.dfield > label {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-55);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.dfield > label i { font-style: normal; color: var(--ink-40); text-transform: none; letter-spacing: 0; }

.dfield .input,
.dfield select,
.dfield textarea {
  width: 100%;
  border: 1px solid var(--ink-20);
  background: var(--card);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-family: var(--f-sans);
  font-size: 13px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dfield textarea { resize: vertical; min-height: 92px; line-height: 1.7; }

.dfield .input:focus,
.dfield select:focus,
.dfield textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(20, 18, 10, 0.07);
}

.dfield select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314120a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  padding-right: 28px;
  cursor: pointer;
}

.dhint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-40);
}

.dsection {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-55);
  padding-top: 10px;
}
.dsection::after { content: ""; flex: 1; height: 1px; background: var(--ink-12); }

/* 可增删的多行输入（组织单位 / 流程安排 / 活动议题） */
.rep { display: grid; gap: 8px; }
.rep__rows { display: grid; gap: 8px; counter-reset: rep; }
.rep__row { display: grid; grid-template-columns: 20px 1fr auto; gap: 6px; align-items: start; counter-increment: rep; }
.rep__no { padding-top: 10px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-40); font-variant-numeric: tabular-nums; }
.rep__no::before { content: counter(rep, decimal-leading-zero); }
.rep__cells { display: grid; gap: 6px; min-width: 0; }
.rep__cells--orgs,
.rep__cells--agenda { grid-template-columns: 128px minmax(0, 1fr); }
.rep__cells--talks { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.rep__cells--talks > :first-child { grid-column: 1 / -1; }
.rep__acts { display: flex; gap: 4px; padding-top: 4px; }
.rep__btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ink-20);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-55);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.rep__btn:hover { border-color: var(--ink); color: var(--ink); }
.rep__row:first-child [data-rep-move] { visibility: hidden; }
.rep__add { justify-self: start; height: 30px; }
@media (max-width: 560px) {
  .rep__cells--orgs,
  .rep__cells--agenda { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- modal (admin) ---------- */
.amodal .modal__sheet { width: min(480px, 100%); display: flex; flex-direction: column; overflow: hidden; }
.amodal .modal__sheet--lg { width: min(720px, 100%); }
.amodal #amodalBody { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

.amodal__head { padding-right: 34px; margin-bottom: 16px; }
.amodal__head .mono { color: var(--red); display: block; margin-bottom: 6px; }
.amodal__head h2 { font-size: 21px; letter-spacing: -0.02em; }
.amodal__head p { font-size: 12px; color: var(--ink-55); margin-top: 4px; }

.amodal__body { display: grid; gap: 13px; }

.amodal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--ink-12);
}
.amodal__foot .btn { height: 38px; font-size: 13px; }

/* ---------- empty ---------- */
.aempty {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-55);
  font-size: 13px;
  background-image: var(--hatch);
  border: 1px dashed var(--ink-20);
  margin: 16px;
}
.aempty strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 14px; }

/* ---------- gate ---------- */
.agate {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--ink) url("../img/admin-login-bg.jpg") center 42% / cover no-repeat;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.agate::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 72% at 50% 48%, rgba(10, 8, 4, 0.64) 0%, rgba(10, 8, 4, 0.26) 56%, rgba(10, 8, 4, 0.58) 100%),
    linear-gradient(180deg, rgba(10, 8, 4, 0.34) 0%, rgba(10, 8, 4, 0.16) 46%, rgba(10, 8, 4, 0.62) 100%);
}

.agate__card {
  position: relative;
  width: min(420px, 100%);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
  padding: 30px;
}

.agate__logo {
  display: block;
  width: 150px;
  height: auto;
  margin-bottom: 18px;
}

.agate__kicker {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 6px;
}

.agate h1 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 4px; }
.agate__sub { font-size: 12.5px; color: var(--ink-55); margin-bottom: 20px; line-height: 1.7; }

.agate form { display: grid; gap: 13px; }

.agate__err {
  font-size: 12px;
  color: var(--red);
  display: none;
}
.agate__err.is-on { display: block; }

.agate__hint {
  margin-top: 16px;
  border: 1px dashed var(--ink-20);
  padding: 8px 11px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--ink-40);
  line-height: 1.7;
  text-transform: uppercase;
}
.agate__hint b { color: var(--ink-70); letter-spacing: 0.1em; text-transform: none; }

.agate__back {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
  border-bottom: 1px solid var(--ink-20);
}
.agate__back:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- settings layout ---------- */
.set-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.set-col { display: grid; gap: 20px; }

/* ---------- stat line ---------- */
.statline {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid var(--line-strong);
  background: var(--card);
  margin-bottom: 18px;
}

.statline__item {
  flex: 1 1 150px;
  padding: 11px 16px;
  border-right: 1px solid var(--ink-12);
  display: grid;
  gap: 1px;
  min-width: 0;
}
.statline__item:last-child { border-right: 0; }

.statline__item span {
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.statline__item b {
  font-family: var(--f-mono);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.statline__item em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--ink-55);
  line-height: 1.5;
}

/* ---------- table checkbox ---------- */
.cbx {
  width: 14px;
  height: 14px;
  accent-color: var(--red);
  cursor: pointer;
  vertical-align: middle;
}

.tbl th.cbx-h,
.tbl td.cbx-c {
  width: 34px;
  padding-left: 14px;
  padding-right: 0;
}

/* ---------- batch bar ---------- */
.batchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
}
.batchbar[hidden] { display: none; }
.batchbar b { font-family: var(--f-mono); font-weight: 500; }
.batchbar .spacer { flex: 1; }

.batchbar .bb-btn {
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(242, 236, 221, 0.3);
  background: none;
  color: var(--paper);
  font-size: 11px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: all 0.15s;
}
.batchbar .bb-btn:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.batchbar .bb-btn--red { border-color: rgba(224, 128, 106, 0.55); color: #f0b9a9; }
.batchbar .bb-btn--red:hover { background: var(--red); border-color: var(--red); color: var(--paper); }

/* ---------- drawer variants ---------- */
.drawer--wide { width: min(560px, 100%); }

.dtabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--ink-20);
  margin-bottom: 16px;
}

.dtab {
  position: relative;
  padding: 7px 0 9px;
  margin-right: 18px;
  border: 0;
  background: none;
  font-size: 12.5px;
  color: var(--ink-40);
  cursor: pointer;
}
.dtab:hover { color: var(--ink-70); }
.dtab.is-on { color: var(--ink); font-weight: 600; }
.dtab.is-on::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--red);
}

.dtab-pane { display: none; }
.dtab-pane.is-on { display: grid; gap: 12px; }

.dstats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--ink-12);
  border: 1px solid var(--ink-12);
}
.dstats > div {
  background: var(--card);
  padding: 11px 12px;
  display: grid;
  gap: 2px;
}
.dstats span {
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-40);
}
.dstats b { font-family: var(--f-mono); font-size: 16px; font-weight: 500; }

/* ---------- level tags ---------- */
.lvl {
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border: 1px solid var(--ink-20);
  color: var(--ink-55);
  white-space: nowrap;
}
.lvl--gold { color: var(--gold); border-color: rgba(168, 128, 44, 0.4); background: rgba(168, 128, 44, 0.07); }
.lvl--diamond { color: var(--teal); border-color: rgba(20, 80, 74, 0.35); background: rgba(20, 80, 74, 0.06); }

/* ---------- dictionary ---------- */
.dict-col { display: grid; gap: 9px; align-content: start; }

.dict-col__head {
  font-family: var(--f-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
  display: flex;
  justify-content: space-between;
}

.dict-list { display: grid; gap: 6px; }

.dict-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 24px;
  gap: 6px;
  align-items: center;
}

.dict-row .input { padding: 6px 9px; font-size: 12.5px; }

.dict-row .mono {
  font-size: 8px;
  color: var(--ink-40);
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dict-row button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--ink-20);
  background: none;
  cursor: pointer;
  color: var(--ink-40);
  font-size: 10px;
  padding: 0;
}
.dict-row button:hover { border-color: var(--red); color: var(--red); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
  .set-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .adm { grid-template-columns: 1fr; }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .side::-webkit-scrollbar { display: none; }
  .side::before { display: none; }
  .side__brand {
    padding: 12px 14px;
    margin: 0;
    border-bottom: 0;
    border-right: 1px solid rgba(242, 236, 221, 0.12);
    flex: 0 0 auto;
  }
  .side__brand em { display: none; }
  .side__nav {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px;
    overflow: visible;
    flex: 0 0 auto;
  }
  .side__group { display: none; }
  .side__link {
    padding: 8px 11px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-size: 12.5px;
  }
  .side__link.is-on { border-left-color: transparent; border-bottom-color: var(--red); }
  .side__link span.i { display: none; }
  .side__badge { margin-left: 4px; }
  .side__foot {
    margin-left: auto;
    border-top: 0;
    padding: 8px 14px;
    flex: 0 0 auto;
  }
  .side__who { display: none; }
  .view { padding: 18px 16px 48px; }
  .topbar { padding: 0 16px; height: 54px; }
  .grid-2--even { grid-template-columns: 1fr; }
  .tbl { font-size: 12px; }
  .statline__item {
    flex: 1 1 45%;
    border-bottom: 1px solid var(--ink-12);
  }
  .statline__item:nth-child(2n) { border-right: 0; }
  .statline__item:nth-last-child(-n + 2) { border-bottom: 0; }
}

@media (max-width: 620px) {
  .kpis { grid-template-columns: 1fr; }
  .ahead h1 { font-size: 23px; }
  .dgrid { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .side__brand strong { font-size: 13px; }
  .topbar__crumbs span { display: none; }
  .filters { padding: 10px 12px; }
  .panel__body { padding: 14px; }
}

/* ---------- 保存状态 ---------- */
.topbar__sync {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-55);
}
.topbar__sync::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(31, 107, 58, 0.14);
}
.topbar__sync[data-state="pending"]::before,
.topbar__sync[data-state="saving"]::before { background: var(--gold); box-shadow: 0 0 0 3px rgba(168, 128, 44, 0.16); }
.topbar__sync[data-state="error"],
.topbar__sync[data-state="expired"] { color: var(--red); }
.topbar__sync[data-state="error"]::before,
.topbar__sync[data-state="expired"]::before { background: var(--red); box-shadow: 0 0 0 3px rgba(196, 53, 28, 0.14); }

/* ---------- 默认密码警告 ---------- */
.warnbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 28px 0;
  padding: 12px 16px;
  border: 1px solid rgba(196, 53, 28, 0.35);
  border-radius: 10px;
  background: rgba(196, 53, 28, 0.06);
  color: var(--ink);
  font-size: 13px;
}
.warnbar b { color: var(--red); }
.warnbar a { margin-left: auto; color: var(--red); font-weight: 600; }
@media (max-width: 760px) { .warnbar { margin: 12px 16px 0; } }

/* 顶部 Logo 多图上传 */
.logo-up { display: grid; gap: 8px; }
.logo-up__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.logo-up__list:empty { display: none; }
.logo-up__list li {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--ink-12);
}
.logo-up__list img { max-width: 52px; max-height: 52px; object-fit: contain; }
.logo-up__list button {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

/* 发邮件用的邀请函图片 */
.mail-img { display: flex; gap: 12px; align-items: flex-start; }
.mail-img img {
  display: block;
  width: 72px;
  height: 120px;
  object-fit: cover;
  object-position: top;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 1px var(--ink-12);
}
.mail-img__empty {
  display: grid;
  place-items: center;
  width: 72px;
  height: 120px;
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink-40);
  font-size: 12px;
  box-shadow: 0 0 0 1px var(--ink-12);
}
.mail-img > div { display: grid; gap: 8px; justify-items: start; }
