:root {
  color-scheme: light;
  --paper: #f7f7f8;
  --white: #fff;
  --ink: #15171c;
  --muted: #707783;
  --faint: #9ba1aa;
  --line: #e3e5e9;
  --line-strong: #cdd1d8;
  --blue: #002fa7;
  --blue-soft: #edf2ff;
  --green: #19784c;
  --green-soft: #e9f5ee;
  --amber: #8b5d00;
  --amber-soft: #fff5de;
  --red: #a12b2b;
  --red-soft: #fff0ef;
  font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; }
button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.table-pagination { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); }
.cover-field small { font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.6; }
.cover-preview { display: block; width: 100%; max-height: 220px; object-fit: contain; background: var(--paper); border: 1px solid var(--line); }
.cover-field .button { justify-self: start; }
.competition-cell { display: flex; align-items: center; gap: 12px; }
.competition-thumbnail { width: 64px; height: 48px; flex: none; object-fit: cover; background: var(--paper); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--paper); }
.login-card { width: min(100%, 440px); padding: 44px; border: 1px solid var(--line); background: var(--white); }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; background: var(--blue); color: var(--white); font-size: 20px; font-weight: 700; }
.login-card .brand-mark { margin-bottom: 32px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .11em; }
.login-card h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.login-intro { margin: 12px 0 30px; color: var(--muted); line-height: 1.7; }
.login-form { display: grid; gap: 18px; }
.login-form label, .dialog-field { display: grid; gap: 8px; font-size: 13px; font-weight: 600; }
.login-form input, .dialog-field input, .dialog-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 0; outline: none; background: var(--white); color: var(--ink); font-weight: 400; }
.login-form input:focus, .dialog-field input:focus, .dialog-field textarea:focus, .search-box input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgb(0 47 167 / 10%); }
.form-error { margin: 0; color: var(--red); font-size: 13px; line-height: 1.5; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 25px 16px 18px; border-right: 1px solid var(--line); background: var(--white); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 30px; color: inherit; text-decoration: none; }
.brand .brand-mark { width: 36px; height: 36px; font-size: 18px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.main-nav { display: grid; gap: 4px; }
.nav-heading { margin: 0; padding: 4px 10px 8px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .11em; }
.nav-heading-spaced { margin-top: 19px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 10px; border: 0; border-left: 2px solid transparent; background: transparent; color: #4e5560; text-align: left; cursor: pointer; }
.nav-item:hover { background: #f5f6f8; color: var(--ink); }
.nav-item.is-active { border-left-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.nav-icon { width: 22px; color: #9ba1aa; font-size: 10px; font-variant-numeric: tabular-nums; }
.nav-item.is-active .nav-icon { color: var(--blue); }
.nav-badge { min-width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: auto; padding: 0 5px; background: var(--red-soft); color: var(--red); font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.operator { display: flex; align-items: center; gap: 10px; padding: 2px 6px 13px; }
.operator-avatar { width: 32px; height: 32px; display: grid; place-items: center; background: #eff0f2; color: #4d5561; font-weight: 700; }
.operator-copy strong, .operator-copy small { display: block; }
.operator-copy strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.operator-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.logout-button { width: 100%; min-height: 34px; border: 0; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.logout-button:hover { color: var(--red); }

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 36px; border-bottom: 1px solid var(--line); background: var(--white); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.breadcrumbs strong { color: var(--ink); font-weight: 600; }
.breadcrumb-divider { color: #c3c7ce; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.system-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.system-status i { width: 7px; height: 7px; border-radius: 50%; background: #31845b; }
.main-content { flex: 1; width: min(100%, 1440px); margin: 0 auto; padding: 34px 36px 44px; }
.page-notice { margin-bottom: 18px; padding: 12px 14px; border-left: 3px solid var(--red); background: var(--red-soft); color: var(--red); line-height: 1.5; }
.page-notice.is-success { border-left-color: var(--green); background: var(--green-soft); color: var(--green); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.page-heading .eyebrow { margin-bottom: 8px; }
.page-heading h1 { margin: 0; font-size: 29px; line-height: 1.15; letter-spacing: -.04em; }
.page-description { margin: 9px 0 0; color: var(--muted); line-height: 1.6; }
.updated-at { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--white); cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.button:hover { border-color: var(--blue); color: var(--blue); }
.button-primary { border-color: var(--blue); background: var(--blue); color: var(--white); }
.button-primary:hover { border-color: #001f72; background: #001f72; color: var(--white); }
.button-quiet { color: #4e5560; }
.button-wide { width: 100%; min-height: 44px; margin-top: 2px; }
.button-small { min-height: 29px; padding: 0 9px; font-size: 11px; }
.button-danger { border-color: #e7c8c6; color: var(--red); }
.button-danger:hover { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.button:disabled { opacity: .55; cursor: wait; }

.summary-grid { display: grid; grid-template-columns: repeat(6, minmax(125px, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-card { min-height: 125px; padding: 18px 18px 15px; border: 1px solid var(--line); background: var(--white); }
.summary-label { color: var(--muted); font-size: 12px; }
.summary-value { display: block; margin-top: 17px; font-size: 31px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.summary-card.is-attention .summary-value { color: var(--red); }
.summary-note { margin-top: 9px; color: var(--faint); font-size: 10px; }
.overview-columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(270px, .8fr); gap: 14px; }
.panel { border: 1px solid var(--line); background: var(--white); }
.overview-panel { min-height: 258px; padding: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-heading .eyebrow { margin-bottom: 6px; }
.panel-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.todo-list { display: grid; }
.todo-item { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #eff0f2; }
.todo-item:last-child { border-bottom: 0; }
.todo-label { color: #424954; }
.todo-value { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.todo-count { min-width: 28px; color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; text-align: right; }
.text-button { padding: 4px 0; border: 0; background: none; color: var(--blue); cursor: pointer; }
.quick-links { display: grid; }
.quick-link { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-bottom: 1px solid #eff0f2; background: none; text-align: left; cursor: pointer; }
.quick-link:last-child { border-bottom: 0; }
.quick-link span:first-child { font-weight: 600; }
.quick-link span:last-child { color: var(--muted); font-size: 11px; }
.quick-link:hover span:last-child { color: var(--blue); }
.quiet-empty { padding: 23px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.table-panel { min-width: 0; }
.table-toolbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.table-toolbar > div { display: flex; align-items: baseline; gap: 10px; }
.table-toolbar strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.toolbar-hint { color: var(--muted); font-size: 11px; }
.search-box { width: min(280px, 42vw); position: relative; display: flex; align-items: center; }
.search-box input { width: 100%; height: 34px; padding: 0 34px 0 10px; border: 1px solid var(--line); border-radius: 0; outline: none; font-size: 12px; }
.search-mark { position: absolute; right: 12px; width: 12px; height: 12px; border: 1.5px solid #747c87; border-radius: 50%; pointer-events: none; }
.search-mark::after { position: absolute; right: -4px; bottom: -3px; width: 5px; height: 1.5px; background: #747c87; content: ""; transform: rotate(45deg); transform-origin: left center; }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #fafafb; color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap; }
.data-table td { min-height: 62px; padding: 13px 14px; border-bottom: 1px solid #eff0f2; color: #3d444e; font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfcfd; }
.cell-primary { display: block; max-width: 370px; overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cell-secondary { display: block; max-width: 360px; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.cell-wrap { max-width: 250px; white-space: normal; line-height: 1.6; overflow-wrap: anywhere; }
.cell-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.status-tag { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; background: #f0f1f3; color: #525964; font-size: 10px; white-space: nowrap; }
.status-tag.status-active, .status-tag.status-recruiting, .status-tag.status-finding, .status-tag.status-done { background: var(--green-soft); color: var(--green); }
.status-tag.status-pending, .status-tag.status-paused { background: var(--amber-soft); color: var(--amber); }
.status-tag.status-offline, .status-tag.status-suspended { background: var(--red-soft); color: var(--red); }
.empty-state { min-height: 210px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 35px 20px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 13px; }
.empty-state p { max-width: 340px; margin: 0; font-size: 11px; line-height: 1.7; }
.empty-rule { width: 32px; height: 2px; margin-bottom: 7px; background: var(--blue); }
.workspace-footer { display: flex; justify-content: space-between; padding: 14px 36px 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.settings-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 20px 0; }
.settings-panel { padding: 24px; margin-top: 20px; }
.settings-columns .settings-panel { margin-top: 0; }
.settings-panel h2 { font-size: 17px; margin: 0 0 12px; }
.settings-description { color: var(--muted); line-height: 1.7; font-size: 12px; margin: 0 0 20px; }
.settings-form { display: grid; gap: 16px; }
.settings-form label { display: grid; gap: 8px; font-size: 12px; font-weight: 600; }
.settings-form input, .settings-form select { min-height: 40px; width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 0; color: var(--ink); background: var(--white); }
.settings-form input:focus, .settings-form select:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.settings-form .button { justify-self: start; }
.create-admin-form { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.create-admin-form .form-error { grid-column: 1 / -1; }
.security-status { color: var(--muted); font-size: 13px; }
.session-row, .alert-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 0; border-top: 1px solid var(--line); }
.session-row:first-child, .alert-row:first-child { border-top: 0; }
.session-copy { min-width: 0; font-size: 12px; line-height: 1.7; }
.session-copy strong { display: block; color: var(--ink); }
.session-copy small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.alert-row { border-left: 3px solid var(--amber); padding-left: 12px; margin-top: 12px; }
.alert-row.is-error { border-left-color: var(--red); }
.alert-row p { margin: 0; font-size: 12px; line-height: 1.7; }
.alert-row small { display: block; color: var(--muted); margin-top: 6px; }
.quiet-empty { color: var(--muted); font-size: 12px; line-height: 1.7; }
.ops-value { font-size: clamp(20px, 2.4vw, 32px); }
.settings-error { margin-top: 20px; line-height: 1.7; }
@media (max-width: 900px) { .settings-columns { grid-template-columns: 1fr; } .create-admin-form { grid-template-columns: 1fr; } }

.dialog { width: min(100% - 32px, 560px); max-height: calc(100vh - 36px); padding: 0; border: 1px solid var(--line-strong); border-radius: 0; background: var(--white); color: var(--ink); }
.dialog::backdrop { background: rgb(16 22 34 / 38%); }
.dialog form { padding: 24px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.dialog-heading .eyebrow { margin-bottom: 6px; }
.dialog-heading h2 { margin: 0; font-size: 19px; }
.dialog-close { width: 28px; height: 28px; border: 1px solid var(--line); background: var(--white); color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; }
.dialog-description { margin: 17px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.dialog-field { margin-top: 15px; }
.dialog-field textarea { min-height: 88px; resize: vertical; }
.dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.dialog-field-wide { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; right: 26px; bottom: 24px; z-index: 10; max-width: min(420px, calc(100vw - 32px)); padding: 11px 14px; border: 1px solid var(--line); background: var(--white); color: var(--ink); box-shadow: 0 8px 28px rgb(0 0 0 / 10%); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

.user-details-dialog { width: min(100% - 32px, 920px); }
.user-details-inner { padding: 24px; }
.user-details-content { min-width: 0; }
.details-section { margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); }
.details-section h3 { margin: 0 0 15px; font-size: 13px; font-weight: 700; }
.details-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.details-section-heading > span { color: var(--muted); font-size: 11px; }
.details-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 24px; margin: 0; }
.details-fields > div { min-width: 0; }
.details-fields dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.details-fields dd { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.student-card-photo { min-height: 90px; padding: 14px; border: 1px solid var(--line); background: var(--paper); }
.student-card-photo .quiet-empty { margin: 0; padding: 16px 0; }
.student-card-image { display: block; width: auto; max-width: 100%; max-height: 480px; object-fit: contain; }
.audit-table { min-width: 670px; }
.audit-table td { max-width: 190px; font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .user-details-inner { padding: 18px; }
  .details-fields { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .main-content { padding-right: 24px; padding-left: 24px; }
  .topbar { padding-right: 24px; padding-left: 24px; }
  .workspace-footer { padding-right: 24px; padding-left: 24px; }
}
@media (max-width: 780px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; z-index: 2; width: 100%; height: auto; display: block; padding: 12px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 0 12px; }
  .brand .brand-mark { width: 30px; height: 30px; font-size: 15px; }
  .main-nav { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 9px; }
  .nav-heading, .nav-heading-spaced, .sidebar-bottom { display: none; }
  .nav-item { min-width: max-content; min-height: 34px; padding: 0 9px; border-left: 0; border-bottom: 2px solid transparent; font-size: 11px; }
  .nav-item.is-active { border-bottom-color: var(--blue); }
  .nav-icon { display: none; }
  .topbar { height: 48px; padding: 0 16px; }
  .system-status { display: none; }
  .main-content { padding: 25px 16px 34px; }
  .overview-columns { grid-template-columns: 1fr; }
  .workspace-footer { padding: 13px 16px; }
  .data-table { min-width: 720px; }
  .page-heading h1 { font-size: 25px; }
}
@media (max-width: 480px) {
  .login-card { padding: 30px 24px; }
  .topbar-actions .button { min-height: 31px; padding: 0 8px; font-size: 11px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary-card { min-height: 106px; padding: 13px; }
  .summary-value { margin-top: 14px; font-size: 27px; }
  .updated-at { display: none; }
  .page-heading { align-items: flex-start; }
  .page-heading > .button { align-self: flex-end; padding: 0 8px; font-size: 11px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .search-box { width: 100%; }
  .dialog-grid { grid-template-columns: 1fr; }
  .dialog-field-wide { grid-column: auto; }
}
