/* =====================================================================
   LIBRA · 管理端（P14—P17）与错误边界页（P18）
   仅在 admin.css 内扩展，不改动 libra.css 的共享设计系统
   ===================================================================== */

/* ------------------------------------------------------------------ 通用 */
.adm-kpis .adm-kpi {
  padding: 18px 20px;
  min-height: 126px;
  display: flex;
  flex-direction: column;
}
.adm-kpi .value {
  font-size: 33px;
  line-height: 1.18;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.adm-kpi .foot {
  margin-top: auto;
  padding-top: 10px;
  font-size: 11px;
  color: var(--faint);
}
.adm-up { color: #4fe0b4; }
.adm-down { color: #ff9ba6; }

.adm-split-wide {
  grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
}
.adm-dashboard-top {
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
}
.adm-dashboard-bottom {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
}
.adm-chart-card .card-head { margin-bottom: 10px; }
.adm-chart-card .hint { white-space: nowrap; }
.adm-dashboard-top .card {
  display: flex;
  flex-direction: column;
}
.adm-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 2px;
}
.adm-area svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 210px;
  flex: 1;
  overflow: visible;
}
.adm-area-axis {
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  margin-top: -10px;
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.adm-bars .bars {
  gap: 12px;
  height: 196px;
  padding: 6px 2px 0;
}
.adm-bars .bars .bar {
  min-height: 10px;
  border-radius: 5px 5px 3px 3px;
}
.adm-bars .bars .bar span { display: none; }
.adm-axis {
  display: flex;
  gap: 12px;
  margin-top: 11px;
  padding: 0 2px;
}
.adm-axis span {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 10px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-room-bars .bars { height: 224px; }

/* 表格：以「行块」呈现，贴合高保真稿的圆角行 */
.adm-table {
  border-collapse: separate;
  border-spacing: 0 6px;
}
.adm-table thead th {
  padding: 0 14px 4px;
  font-weight: 500;
}
.adm-table tbody td {
  padding: 12px 14px;
  background: var(--row);
  border-top: 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s;
}
.adm-table tbody td:first-child {
  border-left: 1px solid var(--line-soft);
  border-radius: 10px 0 0 10px;
}
.adm-table tbody td:last-child {
  border-right: 1px solid var(--line-soft);
  border-radius: 0 10px 10px 0;
}
.adm-table tbody tr:hover td { background: var(--row); }
.adm-table tbody tr.is-picked td { background: var(--row); }
.adm-table tbody tr.is-picked td:first-child { box-shadow: inset 2px 0 0 var(--blue); }

.adm-type { font-size: 12px; font-weight: 500; white-space: nowrap; }
.adm-type.overdue { color: #ff9ba6; }
.adm-type.device { color: #ffd08a; }
.adm-type.complaint { color: #a9bcff; }
.adm-type.other { color: #c4b1ff; }

.adm-status { font-size: 12px; font-weight: 500; white-space: nowrap; }
.adm-status.pending { color: #ff9ba6; }
.adm-status.processing { color: #ffd08a; }
.adm-status.recorded { color: #6ff0c8; }

/* ------------------------------------------------------------------ P14 看板 */
.adm-heat {
  width: 100%;
  max-width: 250px;
  gap: 6px;
  margin: 4px auto 0;
}
.adm-heat i {
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--tint-2);
}
.adm-heat-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 14px;
  font-size: 10px;
  color: var(--faint);
}
.adm-heat-legend i {
  width: 14px;
  height: 6px;
  border-radius: 2px;
  background: var(--line-strong);
}
.adm-heat-legend i:nth-of-type(2) { background: var(--line-hover); }
.adm-heat-legend i:nth-of-type(3) { background: var(--line-hover); }
.adm-heat-legend i:nth-of-type(4) { background: #5b7cfa; }

.adm-anomaly-card .card-head { margin-bottom: 6px; }
.adm-anomaly-card .table-wrap { margin-top: 2px; }
.adm-anomaly-card .adm-table { border-spacing: 0 5px; }
.adm-anomaly-card .adm-table thead th { padding: 0 8px 2px; }
.adm-anomaly-card .adm-table tbody td { padding: 9px 8px; font-size: 11.5px; }
.adm-anomaly-card .adm-table td .btn { min-width: 50px; height: 27px; padding: 0 9px; }
.adm-anomaly-card .empty { padding: 26px 10px; }

/* ------------------------------------------------------------------ P15 座位监控 */
.adm-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 18px;
}
.adm-toolbar .adm-search-box {
  flex: 1;
  width: auto;
  min-width: 260px;
  height: 40px;
}
button.chip {
  font-family: inherit;
  cursor: pointer;
  transition: 0.16s;
}
.adm-table-card { padding: 18px 20px 10px; }
.adm-table-card .card-head { margin-bottom: 8px; }
.adm-table-card .card-head .hint { font-size: 11px; }

.adm-seat-table .check {
  padding: 0;
  appearance: none;
  cursor: pointer;
}
.adm-seat-table td .btn { min-width: 58px; }
.adm-seat-table .actions { text-align: right; }

.adm-modal { max-width: 480px; }
/* 通知日志：列多，单独放宽 */
.adm-modal.notify-modal { max-width: 940px; width: min(940px, 94vw); }
.notify-table td:nth-child(1) { white-space: nowrap; }
.notify-table td:nth-child(4) { min-width: 200px; }
.notify-table td:nth-child(5) { min-width: 220px; }
.notify-table td:nth-child(5) { color: var(--muted); }
.adm-modal .field { margin-top: 14px; }
.adm-modal .textarea { min-height: 86px; }
.adm-modal .field label { font-size: 11.5px; color: var(--muted); }
.adm-modal-err { margin-top: 12px; }
.adm-seat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.adm-seat-tags .badge { font-size: 10.5px; }
.adm-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

/* ------------------------------------------------------------------ P16 研讨间 */
.adm-colleges {
  display: flex;
  flex-direction: column;
  gap: 19px;
  padding-top: 2px;
}
.adm-college-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}
.adm-college-head b {
  color: #8fb0ff;
  font-size: 12px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.adm-college-track {
  height: 7px;
  border-radius: 99px;
  background: var(--row);
  overflow: hidden;
}
.adm-college-track i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3f63e8, #5b7cfa);
}
.adm-college-row.c1 .adm-college-track i { background: linear-gradient(90deg, #6134d8, #8b5cf6); }
.adm-college-row.c1 .adm-college-head b { color: #c4b1ff; }
.adm-college-row.c2 .adm-college-track i { background: linear-gradient(90deg, #b06c38, #f0b64b); }
.adm-college-row.c2 .adm-college-head b { color: #ffd08a; }
.adm-college-row.c3 .adm-college-track i { background: linear-gradient(90deg, #2f6de0, #7d9bff); }
.adm-college-row.c3 .adm-college-head b { color: #a9bcff; }

.adm-noshows { display: flex; flex-direction: column; padding-top: 2px; }
.adm-noshow {
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 12.5px;
}
.adm-noshow:last-child { border-bottom: 0; }
.adm-noshow .lv2 { color: #ff9ba6; }
.adm-noshow .lv1 { color: #ffd08a; }
.adm-noshows-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 11px;
}
.adm-rules .card-head { margin-bottom: 4px; }
.adm-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 12.5px;
}
.adm-rule:last-of-type { border-bottom: 0; }
.adm-rule span { color: var(--muted); }
.adm-rule b { color: var(--text-2); font-weight: 550; }

/* ------------------------------------------------------------------ P17 读者与消息 */
.adm-readers-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 18px;
  align-items: start;
}
.adm-readers-card { padding: 20px; }
.adm-readers-card .card-head { margin-bottom: 14px; }
.adm-readers-card .table-wrap {
  max-height: 472px;
  overflow-y: auto;
}
.adm-readers-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card-b);
}
.adm-reader-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.adm-reader-form .adm-search-box {
  flex: 1;
  width: auto;
  height: 40px;
}
.adm-reader-form .btn { height: 40px; padding: 0 24px; }
.adm-readers-table th { padding-top: 4px; }
.adm-readers-table tbody td { padding: 20px 14px; }
.adm-reader-status { font-size: 12px; font-weight: 500; }
.adm-reader-status.normal { color: #6ff0c8; }
.adm-reader-status.overdue { color: #ff9ba6; }
.adm-reader-status.mute { color: #ffd08a; }

.adm-push {
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 20px;
  position: sticky;
  top: calc(var(--topbar-h) + 18px);
}
.adm-push .card-head { margin-bottom: 0; }
.adm-push-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.adm-template-chips { gap: 8px; }
.adm-template-chips .chip {
  height: 30px;
  padding: 0 12px;
  font-size: 11.5px;
}
.adm-target-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--menu-hover);
  border: 1px solid var(--nav-active-line);
  color: #a9bcff;
  font-size: 12px;
}
.adm-preview {
  padding: 16px;
  border-radius: 10px;
  background: var(--card-b);
  border: 1px solid var(--line);
}
.adm-preview b {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.adm-preview p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.adm-preview .link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #7d9bff;
  font-size: 11.5px;
}
.adm-reach {
  color: #4fe0b4;
  font-size: 28px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.adm-reach-track {
  height: 8px;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}
.adm-reach-track i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #8b5cf6, #35d6a4 55%, #5b7cfa);
  transition: width 0.3s ease;
}
.adm-push-btn { height: 42px; margin-top: 1px; }
.adm-push-modal { max-width: 500px; }
.adm-confirm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.adm-confirm-grid > div {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--card-b);
  border: 1px solid var(--line-strong);
}
.adm-confirm-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 10.5px;
}
.adm-confirm-grid b { font-size: 12.5px; font-weight: 550; }

/* ------------------------------------------------------------------ P18 错误与边界 */
.adm-error-app { min-height: 100vh; }
.adm-error-main { padding-top: 34px; }
.adm-error-page { max-width: 1240px; }
.err-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 26px;
}
.err-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 248px;
  padding: 36px 34px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.err-tile:hover { border-color: var(--line-strong); }
.err-tile .err-orb {
  width: 96px;
  height: 96px;
  flex: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.err-body { flex: 1; min-width: 0; }
.err-body h2 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.err-body p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.err-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.err-actions .btn {
  height: 42px;
  padding: 0 26px;
  border-radius: 8px;
}
.err-code {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.03em;
}
.err-tile.is-active {
  border-color: var(--line-hover);
  box-shadow: 0 0 0 1px rgba(91, 124, 250, 0.25), 0 18px 48px rgba(74, 108, 244, 0.12);
}
.err-current {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(91, 124, 250, 0.14);
  border: 1px solid rgba(91, 124, 250, 0.32);
  color: #a9bcff;
  font-size: 10px;
}

/* ------------------------------------------------------------------ P20 操作日志 */
.lg-admin-only {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
}
.lg-toolbar { padding: 16px 18px; }
.lg-search { width: 320px; }
.lg-toolbar .select { width: 172px; }
.lg-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 11.5px;
}
.lg-date .input { width: 150px; height: 34px; }
.lg-table tbody td { vertical-align: top; }
.lg-detail {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
}
.lg-pager { margin-top: 16px; gap: 10px; }
.lg-pager select.lg-size {
  width: 104px;
  height: 30px;
  padding: 0 26px 0 9px;
  font-size: 11.5px;
  background-position: calc(100% - 15px) 13px, calc(100% - 10px) 13px;
}
.lg-page {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--btn-bg);
  color: var(--text-2);
  font-size: 11.5px;
  transition: 0.16s;
}
.lg-page:hover { border-color: var(--line-hover); color: #fff; }
.lg-page.active {
  background: rgba(91, 124, 250, 0.16);
  border-color: rgba(91, 124, 250, 0.45);
  color: #cfe0ff;
}
.lg-modal { max-width: 560px; }
.lg-detail-box {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card-b);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.7;
  word-break: break-all;
}

/* 馆员只读提示：按钮保留位置但以「锁定」样式呈现，避免误以为功能消失 */
.btn.bk-locked,
.btn.adm-param-locked {
  color: var(--line-hover);
  border-style: dashed;
  border-color: var(--line-strong);
  background: var(--card-b);
}
.btn.bk-locked:hover,
.btn.adm-param-locked:hover {
  color: var(--text-2);
  border-color: var(--line-hover);
  transform: none;
}
.btn.bk-locked svg,
.btn.adm-param-locked svg { opacity: 0.7; }
.bk-perm-note { margin-bottom: 16px; }
.adm-param-lock {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 16px;
  font-size: 11.5px;
  line-height: 1.65;
}
.adm-param-lock svg { flex: none; margin-top: 2px; }

/* ------------------------------------------------------------------ 宽屏：看板图表更大、分栏比例更偏主内容 */
@media (min-width: 1600px) {
  .adm-split-wide { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
  .adm-dashboard-top { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); }
  .adm-dashboard-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .adm-heat { max-width: 300px; }
  .adm-room-bars .bars { height: 250px; }
  .lg-detail { max-width: 760px; }
}
@media (min-width: 1920px) {
  .adm-split-wide { grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr); }
  .adm-dashboard-top { grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr); }
  .adm-heat { max-width: 330px; gap: 7px; }
  .adm-kpi .value { font-size: 36px; }
  /* 行高略收紧，同一屏能多看几行 */
  .adm-table tbody td { padding: 10px 14px; }
}

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .adm-split-wide,
  .adm-dashboard-top,
  .adm-dashboard-bottom { grid-template-columns: 1fr; }
  .adm-readers-layout { grid-template-columns: 1fr; }
  .adm-push { position: static; }
}
@media (max-width: 900px) {
  .adm-error-main { padding: 22px 16px 40px; }
  .err-grid { grid-template-columns: 1fr; margin-top: 18px; }
  .err-tile {
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
    padding: 26px 22px;
    gap: 18px;
  }
  .err-body h2 { font-size: 22px; }
  .err-orb { width: 74px !important; height: 74px !important; font-size: 13px !important; }
  .adm-toolbar .adm-search-box { min-width: 0; width: 100%; }
  .adm-form-grid { grid-template-columns: 1fr; }
  .adm-confirm-grid { grid-template-columns: 1fr; }
  .adm-reader-form { flex-wrap: wrap; }
  .adm-reader-form .adm-search-box { min-width: 200px; }
  .lg-search { width: 100%; }
  .lg-date { flex: 1 1 150px; }
  .lg-date .input { width: 100%; flex: 1; }
  .lg-detail { max-width: 200px; }
}

