/* Generated by scripts/build-frontend.js from frontend/src/styles.
   Edit frontend/src/styles files instead of editing public/styles.css directly. */

/* Theme variables, base layout, form controls, buttons. */

:root {
  --theme: #0079ba;
  --theme-dark: #0079ba;
  --theme-rgb: 0, 121, 186;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #64748b;
  --border: #dce6ef;
  --ok: #07805f;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1720px;
  margin: 0 auto;
  padding: 18px;
}

.banner {
  position: relative;
  min-height: 86px;
  padding: 12px 24px;
  background: var(--theme);
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.banner-left,
.banner-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.banner-left {
  min-width: 0;
  z-index: 2;
}

.logo {
  width: auto;
  height: 58px;
  object-fit: contain;
}

.banner-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100% - 560px));
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
}

.banner-title-main {
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 30px;
  font-weight: 400;
  white-space: nowrap;
}

.banner-title-sub {
  font-size: 22px;
  font-weight: 700;
  opacity: .98;
  white-space: nowrap;
}

.banner-right {
  z-index: 2;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.section-gap {
  margin-top: 18px;
}

.card-title,
h2 {
  margin: 0 0 16px;
  color: var(--theme-dark);
  font-size: 22px;
  font-weight: 700;
}

.label {
  display: block;
  margin: 12px 0 8px;
  color: var(--theme-dark);
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  color: var(--theme-dark);
  font-weight: 700;
}

.form-row-name {
  display: inline-block;
  width: 96px;
  text-align: justify;
  text-align-last: justify;
  white-space: nowrap;
}

.form-row .input,
.form-row .select {
  margin: 0;
}

.input,
.select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.7;
}

.student-report-card textarea {
  min-height: 118px;
}

.btn {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 16px;
  font: inherit;
  cursor: pointer;
}

.btn-primary {
  background: var(--theme);
  color: #fff;
}

.btn-primary:hover {
  background: var(--theme-dark);
}

.btn-danger {
  background: #fff5f5;
  color: var(--danger);
  border-color: #e7aaa5;
}

.btn-danger:hover {
  background: #ffe7e5;
  color: #8f1d14;
  border-color: #d87870;
}

.btn-outline {
  background: #fff;
  color: var(--theme-dark);
  border-color: var(--theme);
}

.btn-outline.light {
  color: #fff;
  border-color: rgba(255, 255, 255, .75);
  background: transparent;
}

.btn-sm {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 13px;
}

.wide {
  width: 100%;
}

/* Login screen. */

.auth-shell {
  min-height: 100vh;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(360px, 1fr) minmax(420px, 1.25fr);
  gap: 0;
  margin-top: 24px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.login-panel > .card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.login-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
}

.login-logo-card img {
  display: block;
  width: min(66%, 312px);
  height: auto;
  object-fit: contain;
}

.login-card {
  align-self: stretch;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 54px 26px 20px;
}

.login-help {
  border-left: 1px solid var(--border);
  padding-left: 36px;
}

.login-card .wide {
  display: block;
  width: 150px;
  min-height: 34px;
  margin: 0;
  padding: 6px 14px;
  font-weight: 700;
}

.login-card .form-row {
  grid-template-columns: 76px minmax(0, 1fr);
  width: min(100%, 460px);
  margin: 10px 0;
}

.login-card .form-row-name {
  width: 76px;
}

.login-card .input {
  min-height: 34px;
}

.login-card .form-message {
  width: min(100%, 460px);
  min-height: 18px;
  margin: 6px 0;
}

.login-submit-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  width: min(100%, 460px);
  margin-top: 2px;
}

.login-submit-row .btn {
  justify-self: center;
}

.login-card,
.login-help {
  min-height: 250px;
}

.login-help h1 {
  margin: 0 0 10px;
  color: var(--theme-dark);
  font-size: 22px;
  font-weight: 700;
}

.login-help p,
.login-help li {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-help ol {
  margin: 14px 0 0;
  padding: 14px 0 0 20px;
  border-top: 1px solid var(--border);
}

.form-message {
  min-height: 22px;
  margin: 10px 0;
  color: var(--danger);
  font-size: 14px;
}

.login-card .form-message:empty {
  min-height: 0;
  margin: 0;
}

.form-message.ok {
  color: var(--ok);
}

/* Report forms, student info, actions, toolbar, stats. */

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.student-report-card {
  width: 100%;
}

.student-info-grid {
  grid-template-columns: max-content max-content max-content max-content;
  justify-content: center;
  align-items: center;
  gap: 16px 72px;
  padding-left: 56px;
}

.student-info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.student-info-item .field-name {
  color: var(--theme-dark);
  font-size: 16px;
  font-weight: 700;
}

.student-date-field .input {
  flex: 0 0 150px;
  width: 150px;
  min-width: 150px;
  color: var(--theme-dark);
  font-size: 16px;
  font-weight: 700;
}

.readonly-chip {
  display: inline-flex;
  min-height: 34px;
  min-width: 86px;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fbfd;
  color: var(--theme-dark);
  font-size: 16px;
  font-weight: 700;
}

.date-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.field-name {
  display: block;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.week-hint {
  margin: 12px 0 4px;
  color: var(--theme-dark);
  font-weight: 700;
}

.date-week-hint {
  display: inline-block;
  margin-top: 0;
  color: var(--theme-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-align: left;
}

.large-label {
  margin-top: 18px;
  font-size: 20px;
}

.report-field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.report-field-label small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.actions,
.toolbar,
.tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.actions {
  justify-content: center;
  margin-top: 16px;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.compact {
  max-width: 180px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat span {
  color: var(--muted);
  font-size: 14px;
}

.stat strong {
  color: var(--theme-dark);
  font-size: 30px;
}

.stat strong.time {
  font-size: 18px;
  line-height: 1.5;
}

/* Tabs, filters, custom selects, user layouts, tables, report grids. */

.tabs {
  margin: 18px 0;
}

.tab {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--theme-dark);
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: var(--theme);
  border-color: var(--theme);
  color: #fff;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  align-items: end;
  overflow: visible;
}

.filter-grid label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-grid .input,
.filter-grid .select {
  margin-top: 6px;
}

.keyword-search-control {
  position: relative;
  margin-top: 6px;
}

.filter-grid .keyword-search-control .input {
  margin-top: 0;
  padding-right: 44px;
}

.keyword-search-button {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.keyword-search-button::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 7px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--theme-dark);
  border-radius: 50%;
}

.keyword-search-button::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 21px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--theme-dark);
  transform: rotate(45deg);
  transform-origin: left center;
}

.keyword-search-button:hover,
.keyword-search-button:focus-visible {
  background: #eef7fc;
  outline: none;
}

.custom-select {
  position: relative;
  width: 100%;
  margin-top: 6px;
}

.custom-select-button {
  position: relative;
  display: block;
  width: 100%;
  min-height: 40px;
  margin-top: 0 !important;
  padding-right: 34px;
  text-align: left;
  background: #fff;
}

.custom-select-button::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.custom-select.open .custom-select-button::after {
  transform: translateY(-30%) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  display: none;
  max-height: 132px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, .12);
}

.custom-select.open .custom-select-menu {
  display: block;
}

.custom-select-option {
  display: block;
  width: 100%;
  min-height: 32px;
  border: 0;
  padding: 7px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option.selected {
  background: #eef7fc;
  color: var(--theme-dark);
  font-weight: 700;
}

.user-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.user-layout > .card {
  align-self: start;
}

.user-filter-grid {
  grid-template-columns: 180px 180px 1fr;
}

.user-bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.user-bulk-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 700;
}

.user-bulk-count {
  min-width: 72px;
}

.user-select-col {
  width: 54px;
  min-width: 54px;
}

.bulk-user-check,
#bulkSelectVisibleUsers {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--theme);
  vertical-align: middle;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.table-scroll-top {
  width: 100%;
  height: 16px;
  margin-bottom: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.table-scroll-inner {
  height: 1px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #e7edf4;
  padding: 10px 12px;
  vertical-align: top;
}

th {
  color: var(--theme-dark);
  background: #f8fbfd;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.table-wrap th:last-child,
.table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -1px 0 0 var(--border);
}

.table-wrap th:last-child {
  z-index: 3;
  background: #f8fbfd;
}

.user-layout .table-wrap tbody td {
  text-align: center;
  vertical-align: middle;
}

.user-layout .password-view-cell {
  max-width: 360px;
  margin: 0 auto;
}

tr:last-child td {
  border-bottom: none;
}

.report-long-cell {
  min-width: 300px;
  max-width: 430px;
}

.report-table {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.report-grid {
  display: grid;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.report-grid-summary {
  grid-template-columns: 64px 108px 96px 70px 92px repeat(2, minmax(230px, 1fr)) minmax(190px, .85fr) 84px;
}

.report-grid-person {
  grid-template-columns: 74px 100px repeat(2, minmax(280px, 1fr)) minmax(190px, .85fr) 84px;
}

.report-table-header {
  color: var(--theme-dark);
  background: #f8fbfd;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid #e7edf4;
}

.report-cell {
  min-width: 0;
  padding: 10px 12px;
}

.report-grid .report-long-cell {
  padding-left: 20px;
  padding-right: 20px;
}

.report-header-cell {
  white-space: normal;
  line-height: 1.3;
  word-break: keep-all;
}

.report-table-body {
  background: #fff;
}

.report-row-scroll {
  width: 100%;
  overflow: visible;
  border-bottom: 1px solid #e7edf4;
}

.report-row-scroll:last-child {
  border-bottom: none;
}

.report-empty-grid {
  min-height: 56px;
}

.report-empty-row {
  grid-column: 1 / -1;
  align-self: center;
  padding: 20px 12px;
  color: var(--muted);
  text-align: center;
}

.report-grid .report-long-cell,
.report-grid .feedback-cell {
  min-width: 0;
  max-width: none;
}

.report-info-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  vertical-align: middle;
}

.user-report-table td {
  vertical-align: top;
}

.user-report-table .report-long-cell {
  text-align: left;
  vertical-align: top;
}

.user-report-table .report-long-cell .expandable-report,
.user-report-table .report-long-cell .report-text-static {
  display: block;
  width: 100%;
  max-width: 100%;
  text-align: left;
}

.user-report-meta,
.user-report-actions {
  width: 1%;
}

.user-report-actions {
  min-width: 122px;
}

.user-report-actions .btn-sm {
  margin: 0 4px 6px;
}

.user-report-scroll-wrap {
  overflow-y: auto;
  cursor: grab;
  scrollbar-gutter: stable;
}

.user-report-scroll-wrap.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.user-report-scroll-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

.user-report-row.is-returned td:first-child {
  box-shadow: inset 4px 0 0 #f97316;
}

.report-text-static,
.report-text {
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.report-text.collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

.expandable-report.is-expanded .report-text {
  display: block;
  overflow: visible;
}

.report-expand-btn {
  margin-top: 8px;
  border: none;
  background: transparent;
  color: var(--theme-dark);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.report-expand-btn:hover {
  text-decoration: underline;
}

.search-highlight {
  border-radius: 3px;
  background: rgba(255, 218, 64, .72);
  color: inherit;
  box-shadow: 0 0 0 1px rgba(176, 123, 0, .18);
}

/* Tags, return alerts, admin notices, inline feedback cells, toast. */

.center {
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.name-strong {
  color: var(--theme-dark);
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e8f5f1;
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
}

.danger-tag {
  margin-top: 4px;
  background: #fef2f2;
  color: var(--danger);
}

.revised-tag {
  margin-top: 4px;
  background: rgba(var(--theme-rgb), .09);
  color: var(--theme);
}

.muted-tag {
  background: #f1f5f9;
  color: var(--muted);
}

.return-alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #f5c2c7;
  border-radius: 6px;
  background: #fff8f8;
  color: #7a271a;
  line-height: 1.7;
}

.return-alert strong {
  display: block;
  margin-bottom: 4px;
  color: #b42318;
}

.return-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-return-alert {
  margin-top: 16px;
  border-color: rgba(var(--theme-rgb), .28);
  background: rgba(var(--theme-rgb), .06);
  color: var(--theme);
}

.admin-return-alert strong {
  color: var(--theme);
}

.admin-notice-panel {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--theme-rgb), .28);
  border-radius: 6px;
  background: rgba(var(--theme-rgb), .06);
}

.admin-notice-head,
.admin-notice-badges,
.admin-notice-list {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-notice-head {
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--theme-dark);
}

.admin-notice-pill,
.admin-notice-item {
  border: 1px solid rgba(var(--theme-rgb), .32);
  border-radius: 6px;
  background: #fff;
  color: var(--theme-dark);
  cursor: pointer;
}

.admin-notice-pill {
  padding: 6px 10px;
  font-weight: 700;
}

.admin-notice-pill span {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--theme);
  color: #fff;
}

.admin-notice-pill.return span {
  background: #b42318;
}

.admin-notice-item {
  padding: 7px 10px;
  text-align: left;
}

.admin-notice-item span,
.admin-notice-item strong,
.admin-notice-item em {
  margin-right: 6px;
}

.admin-notice-item span {
  font-weight: 700;
  color: var(--theme);
}

.admin-notice-item em {
  font-style: normal;
  color: var(--muted);
}

.admin-report-row.has-unread-notice,
.admin-report-row.has-unread-notice td,
.admin-report-row.has-unread-notice .report-cell {
  background: #fffdf4;
}

.admin-report-row.has-unread-return td:first-child,
.admin-report-row.has-unread-return .report-cell:first-child {
  box-shadow: inset 4px 0 0 #f97316;
}

.admin-report-row.has-unread-new td:first-child,
.admin-report-row.has-unread-new .report-cell:first-child {
  box-shadow: inset 4px 0 0 var(--theme);
}

.admin-report-row.report-row-focus td,
.admin-report-row.report-row-focus .report-cell {
  animation: reportRowFocus 1.8s ease;
}

.user-report-row.report-row-focus td {
  animation: reportRowFocus 1.8s ease;
}

@keyframes reportRowFocus {
  0%,
  100% {
    background: transparent;
  }
  20%,
  70% {
    background: rgba(var(--theme-rgb), .10);
  }
}

.feedback-cell {
  min-width: 330px;
  max-width: 390px;
}

.feedback-input-wrap {
  position: relative;
  margin-bottom: 7px;
}

.feedback-input {
  min-height: 82px;
  max-height: 96px;
  margin-bottom: 0;
  line-height: 1.65;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

.feedback-highlight-layer {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: transparent;
  font: inherit;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  pointer-events: none;
  scrollbar-width: none;
}

.feedback-highlight-layer::-webkit-scrollbar {
  display: none;
}

.feedback-highlight-layer .search-highlight {
  background: rgba(255, 218, 64, .48);
  color: transparent;
}

.feedback-cell.is-feedback-editing .feedback-highlight-layer {
  display: none;
}

.feedback-input[readonly] {
  background: #f8fbfd;
  color: var(--text);
  cursor: default;
}

.feedback-input.is-editing {
  background: #fff;
  border-color: var(--theme);
  box-shadow: 0 0 0 2px rgba(var(--theme-rgb), .08);
}

.feedback-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  width: 100%;
}

.feedback-actions .btn-sm {
  min-height: 30px;
  width: 100%;
  padding: 5px 5px;
  font-size: 12px;
  border-radius: 6px;
}

.report-row-actions {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-left: 8px;
  padding-right: 8px;
}

.report-row-actions .btn-sm {
  display: inline-flex;
  width: auto;
  min-width: 48px;
  justify-content: center;
  margin: 0;
  padding: 5px 8px;
}

.save-feedback {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #94a3b8;
}

.save-feedback.ready {
  background: var(--theme);
  border-color: var(--theme);
  color: #fff;
}

.app-toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 9999;
  max-width: min(360px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(15, 23, 42, .94);
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .22);
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}

/* Feedback and report modal dialogs. */

.feedback-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .36);
}

.feedback-modal {
  position: relative;
  width: min(980px, calc(100vw - 48px));
  height: min(84vh, 780px);
  min-width: 560px;
  min-height: 420px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(15, 23, 42, .24);
}

.feedback-modal.is-dragging,
.feedback-modal.is-resizing,
.feedback-modal.is-resizing-feedback {
  box-shadow: 0 28px 66px rgba(15, 23, 42, .28);
}

.feedback-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--theme-dark);
  font-size: 18px;
  cursor: move;
  user-select: none;
}

.feedback-modal-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feedback-modal-title {
  line-height: 1.35;
}

.feedback-modal-person {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.feedback-modal-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.feedback-modal-close:hover {
  color: var(--theme-dark);
  border-color: var(--theme);
}

.feedback-modal-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  padding: 18px 20px;
  overflow: hidden;
}

.feedback-modal-input,
.report-modal-input {
  min-height: 350px;
  max-height: 52vh;
  resize: none;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.8;
}

.feedback-modal-content > .feedback-modal-input,
.feedback-modal-content > .report-modal-input {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  max-height: none;
}

.feedback-modal-input[readonly],
.report-modal-input[readonly] {
  background: #fff;
  color: var(--text);
  cursor: default;
}

.feedback-modal-input.is-editing {
  border-color: var(--theme);
  box-shadow: 0 0 0 2px rgba(var(--theme-rgb), .08);
}

.report-modal-input {
  min-height: 220px;
  max-height: 34vh;
}

.report-modal-feedback {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 132px;
  padding: 14px 20px 14px;
  border-top: 1px solid var(--border);
}

.report-modal-feedback-title {
  flex: 0 0 auto;
  margin: 0 0 8px;
  color: var(--theme-dark);
  font-weight: 700;
}

.report-feedback-pane {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.report-feedback-pane .feedback-modal-input {
  flex: 1 1 auto;
  min-height: 96px;
  max-height: none;
  height: 130px;
}

.report-feedback-resizer {
  position: absolute;
  z-index: 4;
  height: 12px;
  cursor: ns-resize;
}

.report-modal-feedback > .report-feedback-resizer {
  left: 20px;
  right: 20px;
}

.report-feedback-pane > .report-feedback-resizer {
  left: 0;
  right: 0;
}

.report-feedback-top-resizer {
  top: -6px;
}

.report-feedback-bottom-resizer {
  bottom: -6px;
}

.report-feedback-resizer:hover {
  background: rgba(var(--theme-rgb), .08);
}

.feedback-modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 150px));
  justify-content: end;
  gap: 12px;
  padding: 0 20px 18px;
}

.feedback-modal-actions .btn {
  min-height: 40px;
}

.feedback-modal-save {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #94a3b8;
}

.feedback-modal-save.ready {
  background: var(--theme);
  border-color: var(--theme);
  color: #fff;
}

.feedback-resize-handle {
  position: absolute;
  z-index: 3;
}

.feedback-resize-handle.top,
.feedback-resize-handle.bottom {
  left: 12px;
  right: 12px;
  height: 10px;
  cursor: ns-resize;
}

.feedback-resize-handle.top {
  top: -5px;
}

.feedback-resize-handle.bottom {
  bottom: -5px;
}

.feedback-resize-handle.left,
.feedback-resize-handle.right {
  top: 12px;
  bottom: 12px;
  width: 10px;
  cursor: ew-resize;
}

.feedback-resize-handle.left {
  left: -5px;
}

.feedback-resize-handle.right {
  right: -5px;
}

.feedback-resize-handle.top-left,
.feedback-resize-handle.top-right,
.feedback-resize-handle.bottom-left,
.feedback-resize-handle.bottom-right {
  width: 16px;
  height: 16px;
}

.feedback-resize-handle.top-left {
  top: -5px;
  left: -5px;
  cursor: nwse-resize;
}

.feedback-resize-handle.top-right {
  top: -5px;
  right: -5px;
  cursor: nesw-resize;
}

.feedback-resize-handle.bottom-left {
  bottom: -5px;
  left: -5px;
  cursor: nesw-resize;
}

.feedback-resize-handle.bottom-right {
  right: -5px;
  bottom: -5px;
  cursor: nwse-resize;
}

.feedback-close-confirm {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(248, 251, 253, .82);
}

.feedback-inline-confirm {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .22);
}

.feedback-close-confirm-box {
  width: min(360px, 100%);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
}

.feedback-close-confirm-title {
  margin-bottom: 16px;
  color: var(--theme-dark);
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
}

.feedback-close-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 12px;
}

.feedback-close-confirm-actions .btn {
  min-height: 40px;
}

.person-block {
  margin-top: 16px;
}

.person-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-weight: 700;
}

.person-title-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.person-title strong {
  color: var(--text);
  font-size: 15px;
}

.toggle-person-reports {
  min-height: 30px;
  padding-inline: 12px;
}

.person-hidden-row {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.person-name-badge {
  padding: 4px 10px;
  border-radius: 5px;
  background: var(--theme);
  color: #fff !important;
}

.empty {
  padding: 24px;
  text-align: center;
  vertical-align: middle;
  color: var(--muted);
}

.password-view-cell {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 36px;
  gap: 6px;
  align-items: center;
}

.current-password-input {
  min-width: 130px;
  height: 34px;
  padding: 6px 9px;
  font-size: 13px;
}

.icon-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--theme-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.icon-btn:disabled {
  color: #94a3b8;
  background: #f1f5f9;
  cursor: not-allowed;
}

.eye-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn.is-revealing {
  background: var(--theme);
  border-color: var(--theme);
  color: #fff;
}

/* User-management dialog and responsive rules. */

.user-manage-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .34);
}

.user-manage-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(15, 23, 42, .24);
}

.user-manage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--theme-dark);
}

.user-manage-head strong,
.user-manage-head span {
  display: block;
}

.user-manage-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.user-manage-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 18px 20px;
  overflow: auto;
}

.user-manage-body .label:nth-child(3) {
  grid-column: 1 / -1;
}

.user-danger-zone {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px dashed #e7aaa5;
  border-radius: 6px;
  background: #fffafa;
}

.user-danger-zone summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.user-danger-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.user-danger-action {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.user-danger-action span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.user-manage-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 150px));
  justify-content: end;
  gap: 12px;
  padding: 0 20px 18px;
}

.user-manage-actions .btn {
  min-height: 40px;
}

@media (max-width: 1100px) {
  .login-panel,
  .info-grid,
  .stats,
  .filter-grid,
  .user-layout {
    grid-template-columns: 1fr;
  }

  .student-info-grid {
    justify-content: start;
    padding-left: 0;
  }

  .login-card,
  .login-help {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .banner {
    align-items: flex-start;
  }

  .banner-title {
    position: static;
    transform: none;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .banner-title-main {
    font-size: 26px;
    white-space: normal;
  }

  .banner-title-sub {
    white-space: normal;
  }

}

@media (max-width: 700px) {
  .container {
    padding: 12px;
  }

  .feedback-modal {
    width: calc(100vw - 16px);
    min-width: calc(100vw - 16px);
    min-height: 360px;
  }

  .user-manage-body {
    grid-template-columns: 1fr;
  }

  .banner,
  .banner-left,
  .banner-right {
    flex-direction: column;
    align-items: flex-start;
  }

  .logo {
    height: 58px;
  }

  .card {
    padding: 14px;
  }

}
