/* v1.5: administrator workspace, class-code cues and explicit confirmation states. */
:root {
  --v15-ink: #173451;
  --v15-muted: #6b7f98;
  --v15-line: #d7e1ec;
  --v15-blue: #2b69c9;
  --v15-teal: #138d88;
  --v15-red: #c74747;
  --v15-gold: #b57b28;
}

.class-code {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 7px;
  background: #edf4fc;
  border: 1px solid #c8dbef;
  color: #2b5f91;
  font: 600 12px/1.2 Consolas, "Microsoft YaHei", monospace;
  letter-spacing: .02em;
  white-space: nowrap;
}

.small-panel { max-width: 560px; }
.delete-warning {
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--v15-red);
  border-radius: 8px;
  background: #fff4f2;
  color: #843b3b;
  line-height: 1.65;
}
.modal.open { display: flex; }

.admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.admin-hero h1 { margin-bottom: 5px; }
.admin-hero .muted { max-width: 720px; }
.admin-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-filter a { text-decoration: none; }
.admin-filter a.active { color: #fff; background: var(--v15-blue); border-color: var(--v15-blue); }
.admin-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.admin-stats .stat { position: relative; overflow: hidden; }
.admin-stats .stat::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -32px;
  width: 92px;
  height: 92px;
  border: 13px solid rgba(43,105,201,.08);
  border-radius: 50%;
}
.admin-stats .value { color: var(--v15-ink); }
.admin-stats small, .admin-stats span { color: var(--v15-muted); }
.usage-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 18px; }
.usage-bars { display: grid; gap: 12px; }
.usage-row { display: grid; grid-template-columns: 56px 1fr 46px 110px; align-items: center; gap: 10px; }
.usage-row > span { color: var(--v15-muted); font-size: 13px; }
.usage-row strong { text-align: right; color: var(--v15-ink); }
.usage-row small { color: var(--v15-muted); font-size: 12px; white-space: nowrap; }
.usage-track { height: 9px; overflow: hidden; border-radius: 99px; background: #edf2f7; }
.usage-track i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #2b69c9, #1ba39b); }
.usage-bar-row { display: grid; grid-template-columns: 110px 1fr 72px; align-items: center; gap: 10px; }
.usage-bar-row .bar { height: 9px; overflow: hidden; border-radius: 99px; background: #edf2f7; }
.usage-bar-row .bar span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #2b69c9, #1ba39b); }
.usage-bar-row strong { text-align: right; color: var(--v15-ink); font-size: 13px; }
.model-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.model-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--v15-line); }
.model-list li:last-child { border-bottom: 0; }
.model-list code { color: #315a82; font-size: 12px; overflow-wrap: anywhere; }
.model-usage { display: grid; gap: 10px; }
.model-usage > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--v15-line); }
.model-usage > div:last-child { border-bottom: 0; }
.model-usage strong { grid-column: 1 / -1; color: #315a82; font-size: 12px; overflow-wrap: anywhere; }
.model-usage span, .model-usage b { color: var(--v15-muted); font-size: 12px; }
.model-usage b { text-align: right; color: var(--v15-ink); }
.cleanup-card { border-left: 4px solid var(--v15-gold); }
.cleanup-card .btn { margin-top: 10px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #8da0b3; }
.status-dot.success { background: #1b9a76; }
.status-dot.failed { background: #ce5151; }

@media (max-width: 1100px) {
  .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .usage-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .admin-hero { align-items: flex-start; flex-direction: column; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-bar-row { grid-template-columns: 86px 1fr 54px; }
  .usage-row { grid-template-columns: 45px 1fr 36px; }
  .usage-row small { grid-column: 2 / -1; }
}

/* v1.5.1: balanced three-role login and practical AI administration. */
.role-switch.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid #dbe5ef;
  border-radius: 13px;
  background: #eef3f8;
}
.role-switch.three label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #304b68;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: background .18s, color .18s, box-shadow .18s, transform .18s;
}
.role-switch.three label:hover { background: #fff; border-color: #d8e2ec; }
.role-switch.three label.selected {
  background: #2466c9;
  border-color: #2466c9;
  color: #fff;
  box-shadow: 0 6px 16px rgba(31,91,178,.24);
  transform: translateY(-1px);
}

.admin-page-head { align-items: center; }
.ai-control-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 28px;
  padding: 24px 28px;
  border-left: 5px solid #1b9778;
  background: linear-gradient(110deg, #f3fbf7 0%, #fff 54%, #f7fafc 100%);
}
.ai-control-card.paused {
  border-left-color: #c95050;
  background: linear-gradient(110deg, #fff6f5 0%, #fff 54%, #f7fafc 100%);
}
.ai-control-copy { display: flex; align-items: center; gap: 16px; }
.ai-control-copy h2 { margin: 3px 0 5px; font-size: 21px; }
.ai-control-copy p { margin: 0; color: var(--v15-muted); line-height: 1.65; }
.status-light {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 4px solid #d9f1e8;
  border-radius: 50%;
  background: #1b9778;
  box-shadow: 0 0 0 6px rgba(27,151,120,.08);
}
.paused .status-light { border-color: #f4dede; background: #c95050; box-shadow: 0 0 0 6px rgba(201,80,80,.08); }
.ai-control-card > small { grid-column: 1 / -1; color: #73859a; line-height: 1.6; }
.ai-master-switch {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 142px;
  padding: 9px 14px;
  border: 1px solid #bddbcf;
  border-radius: 999px;
  background: #fff;
  color: #166f59;
  cursor: pointer;
  font: inherit;
}
.ai-master-switch span {
  position: relative;
  width: 46px;
  height: 25px;
  border-radius: 999px;
  background: #1b9778;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.16);
}
.ai-master-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(23,52,81,.28);
}
.paused .ai-master-switch { border-color: #e5caca; color: #9f3f3f; }
.paused .ai-master-switch span { background: #c9d0d8; }
.paused .ai-master-switch span::after { right: 24px; }
.admin-stats .value i { margin-left: 4px; color: var(--v15-muted); font-size: 14px; font-style: normal; font-weight: 600; }
.admin-operations-grid { grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); }
.cleanup-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 16px; }
.cleanup-counts div { padding: 12px; border: 1px solid #e0e7ee; border-radius: 10px; background: #f8fafc; text-align: center; }
.cleanup-counts strong { display: block; color: var(--v15-ink); font-size: 24px; }
.cleanup-counts span { display: block; margin-top: 4px; color: var(--v15-muted); font-size: 12px; }

@media (max-width: 760px) {
  .role-switch.three label { min-height: 42px; font-size: 12px; }
  .ai-control-card { grid-template-columns: 1fr; padding: 20px; }
  .ai-control-card > small { grid-column: 1; }
  .ai-master-switch { width: 100%; justify-content: center; }
  .admin-operations-grid { grid-template-columns: 1fr; }
}

/* v1.5.2: teacher-space lifecycle and explicit permanent-deletion impact. */
.teacher-account-card .card-title { align-items: flex-start; }
.teacher-account-card .card-title h2 { margin-bottom: 6px; }
.teacher-account-card .card-title p { margin: 0; }
.teacher-account-table td { vertical-align: middle; }
.teacher-account-table td:first-child { min-width: 150px; }
.teacher-account-table td:last-child { min-width: 310px; }
.teacher-space-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.teacher-space-counts span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 9px;
  border: 1px solid #dbe5ee;
  border-radius: 8px;
  background: #f7fafc;
  color: #667b91;
  font-size: 12px;
}
.teacher-space-counts b { color: var(--v15-ink); font-size: 14px; }
.teacher-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.teacher-actions form { margin: 0; }
.btn.warn-action { background: #fff5df; color: #93601a; border: 1px solid #efd9ad; }
.btn.warn-solid { background: #c98224; color: #fff; }
.btn.danger-solid { background: #bd3f4d; color: #fff; }
.btn.danger-solid:hover { background: #a93442; }
.teacher-status-warning {
  padding: 16px 18px;
  border: 1px solid #ead6ae;
  border-radius: 11px;
  background: #fff9ed;
  color: #654b24;
}
.teacher-status-warning > strong { display: block; margin-bottom: 7px; color: #513a17; font-size: 16px; }
.teacher-status-warning p { margin: 0; line-height: 1.75; }
.teacher-delete-panel { width: min(720px, calc(100vw - 34px)); }
.teacher-delete-panel .modal-head h2 { margin: 4px 0 0; }
.delete-impact-loading { padding: 34px 12px; text-align: center; color: var(--v15-muted); }
.delete-teacher-name { margin: 0 0 14px; color: #536b82; }
.delete-teacher-name strong { color: #8f2f3b; }
.teacher-impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}
.teacher-impact-grid div {
  padding: 12px 8px;
  border: 1px solid #e1e7ee;
  border-radius: 10px;
  background: #f8fafc;
  text-align: center;
}
.teacher-impact-grid strong { display: block; color: #9e3642; font-size: 22px; }
.teacher-impact-grid span { display: block; margin-top: 4px; color: #6d8094; font-size: 11px; line-height: 1.35; }
.teacher-delete-panel .delete-warning { margin: 0 0 16px; }
.teacher-delete-panel .delete-warning p { margin: 5px 0 0; }
.danger-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 15px;
  color: #8f3440;
  font-size: 13px;
  line-height: 1.55;
}
.danger-check input { margin-top: 3px; }

@media (max-width: 760px) {
  .teacher-impact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .teacher-account-table td:last-child { min-width: 245px; }
}
