:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --line: #dbe4e0;
  --line-strong: #b8c9c2;
  --text: #15221d;
  --muted: #62736c;
  --teal: #0f766e;
  --teal-dark: #0a4f4a;
  --amber: #c47a12;
  --danger: #b42318;
  --shadow: 0 12px 36px rgba(21, 34, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Tahoma", "Noto Sans Thai", "Segoe UI", sans-serif;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-showcase-logo {
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.login-showcase-logo img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.login-brand {
  margin-bottom: 22px;
}

.login-brand .brand-mark {
  width: 92px;
  height: 92px;
}

.login-card form,
.login-card label {
  display: grid;
  gap: 8px;
}

.login-card form {
  gap: 14px;
}

.login-card label span {
  color: var(--muted);
  font-size: 13px;
}

.login-card input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 9px 11px;
}

@media (max-width: 480px) {
  .login-card {
    padding: 18px;
  }

  .login-showcase-logo {
    margin-bottom: 16px;
    padding: 8px;
  }

  .login-showcase-logo img {
    max-height: 112px;
  }
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 260px;
  min-height: 100vh;
}

.judge-shell {
  grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar {
  background: #fbfcfb;
  border-right: 1px solid var(--line);
  padding: 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.3;
}

.brand p,
.kicker,
small,
.note,
.summary-strip span {
  color: var(--muted);
}

.side-actions,
.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.side-actions {
  margin-bottom: 14px;
}

button,
.file-button,
select {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  min-height: 38px;
}

button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

button.danger {
  border-color: #f0b8b2;
  color: var(--danger);
  background: #fff4f2;
}

.view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.view-tabs button.active {
  background: #e8f3f1;
  border-color: var(--teal);
  color: var(--teal-dark);
  font-weight: 700;
}

.role-tabs {
  margin-bottom: 10px;
}

.admin-nav {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-nav-group {
  display: grid;
  gap: 6px;
}

.admin-nav-group-secondary {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.admin-nav-label {
  padding: 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

.admin-nav button {
  text-align: left;
  min-height: 36px;
  padding: 8px 10px;
}

.admin-nav-group-secondary button {
  color: var(--muted);
}

.admin-nav button.active {
  background: #e8f3f1;
  border-color: var(--teal);
  color: var(--teal-dark);
  font-weight: 700;
}

.admin-shell > .sidebar {
  display: flex;
  flex-direction: column;
}

.admin-shell {
  grid-template-columns: 280px minmax(0, 1fr);
}

.admin-shell [data-admin-overlay] {
  display: none;
}

.admin-shell .side-actions {
  margin-top: auto;
  margin-bottom: 0;
}

.admin-shell .side-actions button {
  width: 100%;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-workspace {
  display: grid;
  gap: 12px;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.dashboard-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(21, 34, 29, 0.055);
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  color: var(--teal-dark);
  font-size: 26px;
  line-height: 1;
}

.dashboard-brief-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  box-shadow: 0 8px 22px rgba(21, 34, 29, 0.055);
}

.dashboard-brief-card.ok {
  border-color: #b8ddcd;
  background: #f5fbf9;
}

.dashboard-brief-card.warn {
  border-color: #f2d2a2;
  background: #fff8eb;
}

.dashboard-brief-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-brief-main strong {
  font-size: 20px;
  line-height: 1.25;
}

.dashboard-brief-main small {
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-status-pill {
  width: fit-content;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f3f1;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-brief-card.warn .dashboard-status-pill {
  background: #fff1d7;
  color: #8a5208;
}

.dashboard-brief-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-progress-meta small,
.dashboard-result-text small {
  color: var(--muted);
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.95fr);
  gap: 16px;
}

.dashboard-compact-main {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  gap: 12px;
}

.dashboard-progress-list,
.dashboard-result-list {
  display: grid;
  gap: 10px;
}

.dashboard-progress-row,
.dashboard-result-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.dashboard-progress-row {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
}

.dashboard-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-progress-meta {
  align-items: center;
}

.dashboard-progress-meta > div,
.dashboard-result-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-progress-meta strong,
.dashboard-result-text strong {
  line-height: 1.4;
}

.dashboard-progress-meta b,
.dashboard-result-score {
  white-space: nowrap;
}

.dashboard-progress-meta b {
  color: var(--teal-dark);
}

.dashboard-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e6edeb;
  overflow: hidden;
}

.dashboard-progress-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.dashboard-progress-bar.warning {
  background: #d69a37;
}

.dashboard-progress-bar.neutral {
  background: #7b8d86;
}

.dashboard-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.dashboard-bottom-grid {
  grid-template-columns: 1.1fr 0.85fr 0.85fr;
}

.dashboard-list-card {
  align-content: start;
}

.dashboard-result-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
}

.dashboard-result-rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #eef2f0;
  color: var(--teal-dark);
  font-weight: 700;
}

.dashboard-result-score {
  color: var(--teal-dark);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.dashboard-empty {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  text-align: center;
}

.readiness-summary-grid {
  margin-bottom: 16px;
}

.compact-list,
.check-list {
  display: grid;
  gap: 8px;
}

.compact-row,
.check-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.compact-row div,
.check-row div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.compact-row strong,
.compact-row small,
.check-row strong,
.check-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-row small,
.check-row small,
.empty-inline {
  color: var(--muted);
}

.compact-row b {
  color: var(--teal-dark);
  white-space: nowrap;
}

.check-row > span {
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 32px;
  border-radius: 999px;
  font-weight: 700;
}

.check-row.ok > span {
  background: #e8f3f1;
  color: var(--teal-dark);
}

.check-row.warn > span {
  background: #fff8eb;
  color: #8a5208;
}

.judge-picker {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.judge-picker span,
.subline {
  color: var(--muted);
  font-size: 13px;
}

.judge-sidebar .level-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.judge-sidebar .level-tabs button {
  min-height: 36px;
}

.judge-sidebar .level-tabs button.active {
  background: #e8f3f1;
  border-color: var(--teal);
  color: var(--teal-dark);
  font-weight: 700;
}

.judge-sidebar .level-tabs button small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  opacity: .78;
}

.judge-queue-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid #c8dfdc;
  border-radius: 8px;
  background: #f3faf8;
}

.judge-queue-summary strong {
  color: var(--teal-dark);
  font-size: 22px;
  line-height: 1;
}

.judge-queue-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.judge-filter-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.judge-filter-tabs button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
}

.judge-filter-tabs button.active {
  border-color: var(--teal);
  background: #e8f3f1;
  color: var(--teal-dark);
  font-weight: 700;
}

.judge-filter-tabs b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #eef2f0;
  font-size: 11px;
}

.judge-filter-tabs button.active b {
  background: #fff;
}

.judge-picker select {
  width: 100%;
}

.file-button {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.project-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 128px);
  overflow: auto;
  padding-right: 4px;
}

.project-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  width: 100%;
  text-align: left;
  border-color: transparent;
  background: transparent;
  padding: 10px 8px;
}

.project-item:hover,
.project-item.active {
  background: #e8f3f1;
  border-color: #c8dfdc;
}

.rank {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eef2f0;
  font-weight: 700;
}

.project-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-text span,
.project-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score {
  color: var(--teal-dark);
  font-weight: 700;
}

.score b,
.score small {
  display: block;
  line-height: 1.15;
  text-align: right;
}

.score small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.project-item[data-project-status="ready"] .score small {
  color: #8a5208;
}

.project-item[data-project-status="submitted"] .score small,
.project-item[data-project-status="locked"] .score small {
  color: var(--teal-dark);
}

.project-item[data-project-status="blocked"] {
  opacity: 0.72;
}

.judge-project-list {
  max-height: calc(100vh - 318px);
}

.workspace {
  padding: 20px;
  overflow: auto;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
  min-width: 0;
}

.topbar > div {
  min-width: 0;
}

.kicker {
  font-size: 13px;
  margin-bottom: 4px;
}

h2 {
  font-size: 24px;
  line-height: 1.35;
  max-width: 820px;
  overflow-wrap: anywhere;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-strip div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.summary-strip span,
.summary-strip strong {
  display: block;
}

.summary-strip strong {
  margin-top: 4px;
  font-size: 26px;
  line-height: 1;
}

.score-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.empty-state {
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin: 80px auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 205px);
}

.score-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px;
  text-align: center;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #edf5f3;
  color: var(--teal-dark);
  font-weight: 700;
}

th span {
  display: block;
  width: 86px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.criterion-col {
  min-width: 360px;
  text-align: left;
  overflow-wrap: anywhere;
}

.section-row td {
  background: #f6faf9;
  color: var(--teal-dark);
  font-weight: 700;
}

.section-row td:first-child {
  display: grid;
  gap: 2px;
}

.section-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

tfoot td {
  position: sticky;
  bottom: 0;
  background: #fff8eb;
  color: #5d3707;
  font-weight: 700;
}

td input {
  width: 64px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  text-align: center;
}

td input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  border-color: var(--teal);
}

td input.invalid {
  border-color: var(--danger);
  color: var(--danger);
  background: #fff4f2;
}

.score-picker-button {
  display: inline-flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  min-width: 96px;
  min-height: 38px;
  border-color: var(--line-strong);
  background: #fff;
  text-align: center;
}

.score-picker-button strong {
  color: var(--muted);
}

.score-picker-button span {
  color: var(--muted);
  font-size: 12px;
}

.score-picker-button.has-value {
  border-color: var(--teal);
  background: #e8f3f1;
}

.score-picker-button.has-value strong {
  color: var(--teal-dark);
}

.score-picker-button.invalid {
  border-color: var(--danger);
  background: #fff4f2;
}

.judge-score-table {
  min-width: 640px;
}

.judge-score-table td input {
  width: 96px;
}

.full-table-panel {
  overflow: visible;
}

.full-table-panel .level-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 8px 0;
}

.full-table-panel .level-tabs button {
  min-height: 28px;
  padding: 3px 10px;
  font-size: 12px;
}

.full-table-panel .level-tabs span {
  margin-left: 6px;
  color: var(--muted);
}

.full-table-panel .table-wrap {
  max-height: none;
  overflow: visible;
}

.results-workspace,
.assignment-workspace {
  padding: 8px 10px 10px;
}

.results-workspace .topbar,
.assignment-workspace .topbar {
  margin-bottom: 8px;
}

.results-workspace h2,
.assignment-workspace h2 {
  font-size: 18px;
  line-height: 1.15;
}

.results-workspace .subline,
.assignment-workspace .subline {
  display: none;
}

.results-workspace .kicker,
.assignment-workspace .kicker {
  display: none;
}

.results-workspace .top-actions button,
.assignment-workspace .top-actions button,
.results-workspace .score-table button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

.results-workspace .score-table,
.assignment-workspace .score-table {
  font-size: 12px;
  table-layout: fixed;
}

.results-workspace th,
.results-workspace td,
.assignment-workspace th,
.assignment-workspace td {
  padding: 2px 5px;
  line-height: 1.18;
}

.results-workspace .criterion-col,
.assignment-workspace .criterion-col {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.results-workspace td,
.assignment-workspace td,
.assignment-workspace th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-results-wrap {
  max-height: none;
}

.admin-results-table {
  min-width: 900px;
}

.admin-results-table th:nth-child(1),
.admin-results-table td:nth-child(1) {
  width: 52px;
}

.admin-results-table th:nth-child(2),
.admin-results-table td:nth-child(2) {
  width: 64px;
}

.admin-results-table th:nth-child(3),
.admin-results-table td:nth-child(3) {
  width: 58px;
}

.admin-results-table th:nth-child(4),
.admin-results-table td:nth-child(4) {
  width: auto;
}

.admin-results-table th:nth-child(5),
.admin-results-table td:nth-child(5) {
  width: 145px;
}

.admin-results-table th:nth-child(6),
.admin-results-table td:nth-child(6),
.admin-results-table th:nth-child(7),
.admin-results-table td:nth-child(7),
.admin-results-table th:nth-child(8),
.admin-results-table td:nth-child(8) {
  width: 82px;
}

.admin-results-table th:nth-child(9),
.admin-results-table td:nth-child(9) {
  width: 86px;
}

.official-summary-card {
  display: grid;
  gap: 10px;
}

.official-summary-controls {
  display: grid;
  grid-template-columns: minmax(150px, .5fr) minmax(180px, .7fr) minmax(220px, 1fr);
  gap: 10px;
}

.official-summary-controls label {
  display: grid;
  gap: 5px;
}

.official-summary-controls span,
.official-judge-picker small {
  color: var(--muted);
  font-size: 13px;
}

.official-summary-controls input,
.official-summary-controls select {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
  font: inherit;
}

.official-judge-picker {
  display: grid;
  gap: 8px;
}

.official-judge-picker > div:first-child {
  display: grid;
  gap: 3px;
}

.official-judge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}

.official-judge-option {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  line-height: 1.25;
}

.official-summary-card .official-judge-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: auto;
  padding: 0;
  flex: 0 0 16px;
  accent-color: var(--teal);
}

.official-judge-option span {
  display: block;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
}

.assignment-workspace {
  padding: 0;
}

.assignment-workspace .topbar {
  margin-bottom: 10px;
}

.assignment-workspace .kicker {
  display: block;
}

.assignment-workspace h2 {
  font-size: 22px;
  line-height: 1.1;
}

.assignment-workspace .subline {
  display: block;
  max-width: 760px;
}

.assignment-layout {
  display: grid;
  grid-template-columns: minmax(280px, 300px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.assignment-judge-rail,
.assignment-main-column,
.assignment-panel-stack,
.assignment-project-main,
.assignment-judge-text {
  min-width: 0;
}

.assignment-judge-rail {
  padding: 12px;
  overflow: hidden;
}

.assignment-judge-rail .admin-card-head {
  margin-bottom: 8px;
}

.assignment-main-column,
.assignment-panel-stack,
.assignment-judge-list,
.assignment-project-list {
  display: grid;
  gap: 8px;
}

.assignment-mode-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: min(360px, 100%);
  gap: 6px;
  margin-bottom: 8px;
}

.assignment-mode-tabs button {
  min-height: 34px;
  padding: 6px 10px;
}

.assignment-mode-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(520px, 100%);
}

.judge-scope-stack,
.judge-scope-grid,
.judge-scope-action-bar,
.judge-scope-rail-summary,
.compact-audit-list {
  display: grid;
  gap: 10px;
}

.judge-scope-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.judge-scope-action-bar {
  grid-template-columns: minmax(210px, .36fr) minmax(0, 1fr);
}

.judge-scope-action-bar label {
  display: grid;
  gap: 6px;
}

.scope-note-field input,
.judge-scope-action-bar select {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  font: inherit;
}

.judge-scope-summary-card .summary-strip,
.judge-scope-workspace .summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.judge-scope-table .criterion-col {
  white-space: normal;
}

.judge-scope-table td:last-child,
.judge-scope-table th:last-child {
  text-align: right;
}

.judge-scope-history-card .audit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}

.judge-scope-history-card .audit-item small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.scoring-control-stack {
  gap: 14px;
}

.scoring-control-status-grid,
.scoring-control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.scoring-control-grid {
  grid-template-columns: 0.8fr 1.2fr;
  align-items: start;
}

.scoring-control-toggle {
  min-height: 86px;
}

.tight-head {
  margin-bottom: 10px;
}

.tight-head h4 {
  margin: 0;
  font-size: 18px;
}

.scoring-control-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
  padding: 12px;
}

.scoring-control-rows {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.scoring-control-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.scoring-control-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.scoring-control-row strong,
.scoring-control-row small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.scoring-control-row b {
  color: var(--muted);
  font-size: 13px;
}

.judge-scope-overview-card .status-chip,
.judge-scope-table .status-chip {
  white-space: nowrap;
}

.judge-view-switch,
.judge-scope-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(420px, 100%);
}

.judge-view-switch {
  margin-bottom: 12px;
}

.judge-scope-rail-summary {
  display: grid;
  gap: 8px;
}

.judge-scope-rail-summary div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6faf9;
}

.judge-scope-rail-summary span {
  color: var(--muted);
  font-size: 12px;
}

.assignment-judge-list {
  gap: 8px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding-right: 2px;
}

.assignment-judge-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  width: 100%;
  text-align: left;
  border-radius: 8px;
  padding: 8px 9px;
  background: #fff;
}

.assignment-judge-item.active {
  border-color: var(--teal);
  background: #e8f3f1;
  color: var(--teal-dark);
}

.assignment-judge-item strong,
.assignment-project-main strong {
  display: block;
}

.assignment-judge-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.assignment-judge-item small,
.assignment-project-main small,
.assignment-card-note {
  display: block;
  color: var(--muted);
}

.assignment-judge-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-judge-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.assignment-judge-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--teal-dark);
}

.assignment-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f5f7f6;
  font-size: 12px;
  color: var(--text);
}

.assignment-control-card {
  padding: 10px 12px;
}

.assignment-control-head {
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(0, 1.8fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.assignment-control-head h3 {
  margin: 0 0 2px;
  line-height: 1.25;
}

.assignment-control-head p {
  color: var(--muted);
  line-height: 1.35;
}

.assignment-compact-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.assignment-compact-stats span,
.assignment-row-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.assignment-compact-stats b {
  color: var(--text);
}

.assignment-control-tools {
  display: grid;
  grid-template-columns: 136px minmax(210px, 1fr) minmax(200px, 0.9fr) minmax(132px, auto) 58px;
  gap: 8px;
  align-items: center;
}

.assignment-control-tools .level-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
}

.assignment-control-tools .level-tabs button,
.assignment-control-tools input,
.assignment-control-tools select,
.assignment-control-tools button {
  min-height: 34px;
  padding: 6px 9px;
  white-space: nowrap;
}

.assignment-control-tools > button[data-assignment-pending] {
  min-width: 132px;
}

.assignment-bulk-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.assignment-bulk-actions button {
  min-width: 92px;
}

.assignment-project-card h3 {
  margin-bottom: 2px;
}

button.active-filter {
  min-width: 0;
}

button.active-filter {
  border-color: var(--teal);
  background: #e8f3f1;
  color: var(--teal-dark);
}

.assignment-card-note {
  margin-top: 3px;
}

.assignment-project-list {
  gap: 6px;
}

.assignment-project-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.assignment-project-row.blocked {
  background: #fff5f2;
  border-color: #f0d3cb;
}

.assignment-project-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.assignment-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--teal-dark);
  font-size: 12px;
  white-space: nowrap;
}

.assignment-toggle input {
  width: 16px;
  height: 16px;
}

.assignment-row-stat.success {
  border-color: #b8ddcd;
  background: #eef8f2;
  color: #1d6a45;
}

.assignment-row-stat.warning {
  border-color: #f2d2a2;
  background: #fff6e8;
  color: #9a5e13;
}

.assignment-row-stat.danger {
  border-color: #efc4bb;
  background: #fff2ef;
  color: var(--danger);
}

.assignment-row-stat.muted {
  color: var(--muted);
}

.assignment-summary-wrap {
  max-height: none;
}

.assignment-summary-table {
  min-width: 920px;
}

.assignment-summary-table th:nth-child(1),
.assignment-summary-table td:nth-child(1) {
  width: 210px;
}

.assignment-summary-table th:nth-child(2),
.assignment-summary-table td:nth-child(2) {
  width: 170px;
}

.assignment-summary-table th:last-child,
.assignment-summary-table td:last-child {
  width: 86px;
}

.judge-level-assignment-card {
  min-width: 0;
}

.judge-level-table {
  min-width: 1220px;
}

.judge-level-table .criterion-col small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.compact-check input {
  width: 16px;
  height: 16px;
}

.order-input {
  width: 74px;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}

.signature-title-select {
  width: 132px;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}

.assignment-empty {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  background: #fbfcfb;
}

.assignment-overview-metrics {
  margin-bottom: 0;
}

@media (max-width: 1200px) {
  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-main-grid,
  .dashboard-list-grid {
    grid-template-columns: 1fr;
  }

  .assignment-layout {
    grid-template-columns: 1fr;
  }

  .assignment-judge-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: none;
  }

  .assignment-control-head {
    grid-template-columns: 1fr;
  }

  .assignment-compact-stats {
    justify-content: flex-start;
  }

  .assignment-control-tools {
    grid-template-columns: 142px minmax(220px, 1fr) minmax(180px, 0.9fr);
  }

  .assignment-bulk-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .submission-settings-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .submission-settings-layout {
    grid-template-columns: 1fr;
  }

  .user-role-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dashboard-summary-grid,
  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

  .official-summary-controls,
  .official-judge-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-brief-card,
  .dashboard-brief-actions {
    display: grid;
    justify-content: stretch;
  }

  .dashboard-brief-actions {
    grid-template-columns: 1fr;
  }

  .dashboard-progress-meta,
  .dashboard-result-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .dashboard-progress-meta b,
  .dashboard-result-score {
    white-space: normal;
  }

  .dashboard-result-rank {
    width: 36px;
    height: 36px;
  }

  .assignment-judge-list,
  .assignment-control-tools {
    grid-template-columns: 1fr;
  }

  .assignment-project-row,
  .assignment-control-head {
    grid-template-columns: 1fr;
  }

  .assignment-bulk-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .assignment-project-action {
    justify-content: stretch;
  }

  button.active-filter,
  .assignment-project-action .assignment-toggle {
    width: 100%;
  }

  .assignment-project-action {
    justify-content: flex-start;
  }

  .submission-settings-summary,
  .submission-setting-grid,
  .user-role-tabs {
    grid-template-columns: 1fr;
  }
}

.note {
  margin-top: 14px;
  padding: 12px;
  border-left: 4px solid var(--amber);
  background: #fff8eb;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.admin-workspace {
  grid-column: auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.admin-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-card.wide {
  grid-column: 1 / -1;
}

.admin-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.admin-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label,
.stack-row {
  min-width: 0;
}

.form-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

.admin-card input,
.admin-card select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
}

.admin-table-wrap {
  overflow: auto;
}

.admin-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.admin-table th {
  background: #edf5f3;
}

.admin-table th,
.admin-table td {
  padding: 8px;
}

.admin-table td:first-child {
  width: 150px;
}

.admin-table td:last-child {
  width: 76px;
}

.settings-workspace .topbar {
  margin-bottom: 14px;
}

.settings-workspace .admin-grid {
  align-items: start;
}

.settings-workspace .admin-card {
  padding: 14px;
}

.settings-workspace .level-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.settings-workspace .level-tabs button {
  min-height: 34px;
  padding: 6px 12px;
}

.event-form-grid {
  grid-template-columns: minmax(320px, 1.7fr) 110px 140px repeat(2, 190px) minmax(160px, .7fr) minmax(260px, 1fr);
  align-items: end;
}

.event-form-grid label:first-child {
  grid-column: span 1;
}

.date-picker-label small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.date-picker-label input[type="date"] {
  min-height: 38px;
  height: 38px;
  padding: 8px 10px;
  line-height: 1.2;
}

.scoring-option {
  grid-column: 1 / -1;
  justify-self: start;
  width: min(100%, 520px);
}

.central-form-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  align-items: end;
}

.certifier-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(420px, 1fr));
  gap: 12px;
  align-items: start;
}

.certifier-subcard {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.certifier-subcard-head {
  display: grid;
  gap: 2px;
}

.certifier-subcard h4 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.certifier-subcard small {
  color: var(--muted);
  line-height: 1.35;
}

.certifier-form-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: end;
}

.summarizer-form-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.certifier-option {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 36px;
  padding-top: 0;
}

.certifier-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.certifier-option span {
  display: inline;
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.settings-workspace .admin-table {
  table-layout: fixed;
  min-width: 0;
}

.settings-workspace .admin-table th,
.settings-workspace .admin-table td {
  padding: 7px;
}

.settings-workspace .admin-table input,
.settings-workspace .admin-table select {
  min-height: 34px;
  padding: 6px 8px;
}

.settings-workspace .admin-table button {
  min-height: 34px;
  padding: 6px 10px;
}

.project-settings-table th:nth-child(1),
.project-settings-table td:nth-child(1) {
  width: 76px;
}

.project-settings-table {
  table-layout: auto;
}

.project-settings-table th:nth-child(2),
.project-settings-table td:nth-child(2) {
  width: auto;
}

.project-settings-table th:nth-child(3),
.project-settings-table td:nth-child(3) {
  width: 350px;
  white-space: nowrap;
}

.project-settings-table th:nth-child(4),
.project-settings-table td:nth-child(4) {
  width: 62px;
}

.criteria-settings-table th:nth-child(1),
.criteria-settings-table td:nth-child(1) {
  width: clamp(180px, 28%, 250px);
}

.criteria-settings-table th:nth-child(2),
.criteria-settings-table td:nth-child(2) {
  width: auto;
}

.criteria-settings-table th:nth-child(3),
.criteria-settings-table td:nth-child(3) {
  width: 96px;
}

.criteria-settings-table th:nth-child(4),
.criteria-settings-table td:nth-child(4) {
  width: 86px;
}

.criteria-settings-table th:nth-child(5),
.criteria-settings-table td:nth-child(5) {
  width: 62px;
}

.project-settings-table td:nth-child(1) input,
.criteria-settings-table td:nth-child(3) input,
.criteria-settings-table td:nth-child(4) input {
  text-align: center;
}

.project-settings-table td:nth-child(2) input,
.criteria-settings-table td:nth-child(2) input {
  text-align: left;
}

.project-settings-table td:nth-child(2) input {
  min-width: 220px;
}

.project-settings-table td:nth-child(3) select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.criteria-settings-table td:nth-child(3) input {
  max-width: 78px;
}

.criteria-settings-table td:nth-child(4) input {
  max-width: 72px;
}

.readonly-input {
  background: #f3f6f5 !important;
  color: var(--muted);
  font-weight: 700;
  cursor: default;
}

.projects-settings-card .admin-table-wrap,
.criteria-settings-card .admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.projects-settings-card .admin-table,
.criteria-settings-card .admin-table {
  border-radius: 8px;
  overflow: hidden;
}

.stack-list {
  display: grid;
  gap: 8px;
}

.stack-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 64px;
  gap: 8px;
  align-items: center;
}

.stack-row > span {
  display: grid;
  place-items: center;
  height: 34px;
  border-radius: 7px;
  background: #eef2f0;
  font-weight: 700;
}

.section-edit-row {
  grid-template-columns: 84px minmax(0, 1fr) 62px;
}

.section-edit-row b {
  text-align: center;
  color: var(--teal-dark);
}

.section-list-head {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.section-list-head {
  grid-template-columns: 84px minmax(0, 1fr) 62px;
}

.section-list-head span {
  height: auto;
  justify-content: start;
  background: transparent;
}

.sections-settings-card .stack-list {
  gap: 7px;
}

.sections-settings-card .stack-row input {
  min-height: 36px;
}

.sections-settings-card .stack-row button {
  min-height: 36px;
  padding: 6px 8px;
}

.disabled-item {
  opacity: 0.58;
}

.inactive-row {
  opacity: 0.62;
}

.audit-table,
.detail-table,
.result-detail-table {
  min-width: 900px;
}

.detail-wrap {
  max-height: 380px;
}

.result-detail-page .score-panel {
  min-height: calc(100vh - 190px);
}

.result-detail-wrap {
  max-height: calc(100vh - 245px);
}

.result-detail-table {
  min-width: 1080px;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 25, 22, 0.42);
}

.score-sheet,
.confirm-dialog {
  position: fixed;
  left: 50%;
  z-index: 41;
  width: min(520px, calc(100vw - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(21, 34, 29, 0.28);
}

.score-sheet {
  bottom: 14px;
  transform: translateX(-50%);
  padding: 14px;
}

.score-sheet-handle {
  width: 44px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: var(--line-strong);
}

.score-sheet header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.score-sheet header p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.score-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 2px;
}

.score-choice-grid button {
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 46px;
  padding: 8px 4px;
  font-weight: 700;
}

.score-choice-grid button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.score-choice-grid button.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.score-choice-grid button.active span {
  color: rgba(255, 255, 255, 0.82);
}

.score-sheet-actions,
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.confirm-dialog {
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 12px;
  padding: 18px;
}

.confirm-dialog > p {
  color: var(--muted);
  line-height: 1.5;
}

.missing-section-list {
  display: grid;
  gap: 8px;
}

.missing-section-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #efd49f;
  border-radius: 8px;
  background: #fff8eb;
}

.missing-section-item strong {
  color: #5d3707;
}

.missing-section-item span {
  color: #8a5208;
  white-space: nowrap;
}

.confirm-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.confirm-summary div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6faf9;
}

.confirm-summary span {
  color: var(--muted);
  font-size: 12px;
}

.confirm-summary strong {
  color: var(--teal-dark);
  font-size: 20px;
}

.warning-text {
  padding: 10px;
  border-left: 4px solid var(--amber);
  background: #fff8eb;
}

.success-text {
  padding: 10px;
  border-left: 4px solid var(--teal);
  background: #e8f3f1;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    border: 0;
  }

  .project-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .project-item {
    min-width: 260px;
  }

  .topbar {
    display: grid;
  }

  .workspace {
    max-width: 100vw;
    overflow-x: hidden;
  }

  h2 {
    max-width: calc(100vw - 40px);
    word-break: break-word;
  }

  .summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-workspace {
    grid-column: auto;
  }

  .admin-grid,
  .form-grid,
  .dashboard-grid,
  .dashboard-summary-grid,
  .dashboard-main-grid,
  .dashboard-list-grid {
    grid-template-columns: 1fr;
  }

  .compact-row,
  .check-row,
  .dashboard-progress-meta {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  body {
    background: #eef4f2;
    -webkit-text-size-adjust: 100%;
  }

  button,
  input,
  select {
    font-size: 16px;
  }

  .judge-shell {
    display: block;
    min-height: 100dvh;
  }

  .judge-sidebar {
    padding: 14px 12px 10px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfb;
  }

  .judge-sidebar .brand {
    padding-right: 94px;
    margin-bottom: 10px;
  }

  .judge-sidebar .brand-mark {
    width: 48px;
    height: 48px;
  }

  .judge-sidebar h1 {
    font-size: 16px;
  }

  .judge-sidebar .side-actions {
    position: absolute;
    top: 14px;
    right: 12px;
    margin: 0;
  }

  .judge-sidebar .side-actions button {
    min-height: 34px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .judge-picker {
    gap: 2px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .judge-picker strong {
    font-size: 15px;
    line-height: 1.35;
  }

  .judge-view-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
  }

  .judge-view-switch button {
    min-height: 36px;
  }

  .judge-scope-rail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
  }

  .judge-scope-rail-summary div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .judge-scope-rail-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
  }

  .judge-project-list {
    display: flex;
    gap: 8px;
    max-height: none;
    margin: 0 -12px;
    padding: 0 12px 6px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .judge-queue-summary {
    margin-bottom: 8px;
    min-height: 42px;
  }

  .judge-filter-tabs {
    display: flex;
    gap: 6px;
    margin: 0 -12px 8px;
    padding: 0 12px 4px;
    overflow-x: auto;
  }

  .judge-filter-tabs button {
    flex: 0 0 auto;
    min-width: 118px;
    min-height: 38px;
  }

  .judge-project-list .project-item {
    grid-template-columns: 34px minmax(0, 1fr);
    min-width: min(82vw, 310px);
    max-width: min(82vw, 310px);
    padding: 10px;
    border-color: var(--line);
    border-radius: 8px;
    background: var(--surface);
    scroll-snap-align: start;
  }

  .judge-project-list .project-item.active {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
  }

  .judge-project-list .rank {
    width: 30px;
    height: 30px;
  }

  .judge-project-list .score {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-column: 1 / -1;
    justify-self: start;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e8f3f1;
    font-size: 13px;
  }

  .judge-project-list .score small {
    margin-top: 0;
    text-align: left;
  }

  .project-text span {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .judge-workspace {
    padding: 12px 12px 86px;
    overflow: visible;
  }

  .judge-workspace .topbar {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .judge-workspace .kicker {
    font-size: 12px;
    line-height: 1.45;
  }

  .judge-workspace h2 {
    max-width: none;
    font-size: 18px;
    line-height: 1.45;
  }

  .judge-workspace .top-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(246, 248, 247, 0.96);
    backdrop-filter: blur(8px);
  }

  .judge-workspace .top-actions button {
    min-height: 48px;
    padding: 8px 6px;
    font-weight: 700;
  }

  .judge-scope-workspace .top-actions {
    position: static;
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .judge-scope-workspace .top-actions .status-chip {
    justify-self: start;
  }

  .judge-workspace .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .judge-workspace .summary-strip div {
    padding: 10px;
    box-shadow: none;
  }

  .judge-workspace .summary-strip strong {
    font-size: 20px;
  }

  .judge-workspace .score-panel {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .judge-workspace .table-wrap {
    max-height: none;
    overflow: visible;
  }

  .judge-score-table,
  .judge-score-table tbody,
  .judge-score-table tfoot {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .judge-score-table thead {
    display: none;
  }

  .judge-score-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .judge-score-table td {
    border: 0;
    padding: 0;
    text-align: left;
  }

  .judge-score-table tr:not(.section-row) td:first-child {
    grid-column: 1 / -1;
    min-width: 0;
    font-weight: 700;
    line-height: 1.45;
  }

  .judge-score-table tr:not(.section-row) td:nth-child(2) {
    align-self: center;
    color: var(--muted);
    font-size: 13px;
  }

  .judge-score-table tr:not(.section-row) td:nth-child(2)::before {
    content: "เต็ม ";
  }

  .judge-score-table tr:not(.section-row) td:nth-child(3) {
    justify-self: end;
  }

  .judge-score-table .score-picker-button {
    width: 112px;
    height: 48px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
  }

  .judge-score-table .score-picker-button span {
    font-size: 13px;
  }

  .judge-score-table .section-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    margin-top: 12px;
    background: #e8f3f1;
    border-color: #c8dfdc;
  }

  .judge-score-table .section-row td {
    background: transparent;
    color: var(--teal-dark);
  }

  .judge-score-table .section-row td:first-child {
    font-weight: 700;
    line-height: 1.35;
  }

  .judge-score-table .section-row small {
    font-size: 12px;
  }

  .judge-score-table tfoot tr {
    margin: 12px 0 0;
    background: #fff8eb;
    border-color: #efd49f;
  }

  .judge-score-table tfoot td {
    position: static;
    background: transparent;
  }

  .empty-state {
    margin: 18px auto;
    padding: 18px;
  }

  .judge-scope-summary-strip,
  .judge-scope-summary-card .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .judge-scope-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .judge-scope-tabs button {
    min-height: 44px;
  }

  .judge-scope-grid {
    grid-template-columns: 1fr;
  }

  .judge-scope-action-bar {
    grid-template-columns: 1fr;
  }

  .scoring-control-status-grid,
  .scoring-control-grid {
    grid-template-columns: 1fr;
  }

  .scoring-control-rows {
    max-height: none;
  }

  .scoring-control-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .scoring-control-row b {
    grid-column: 2;
  }

  .score-sheet {
    bottom: 0;
    width: 100vw;
    max-height: 78dvh;
    border-radius: 14px 14px 0 0;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .score-sheet header h3 {
    font-size: 22px;
  }

  .score-choice-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    max-height: 48dvh;
  }

  .score-choice-grid button {
    min-height: 58px;
    font-size: 18px;
  }

  .score-choice-grid button span {
    font-size: 13px;
  }

  .score-sheet-actions button,
  .dialog-actions button {
    min-height: 48px;
    font-weight: 700;
  }

  .confirm-dialog {
    width: calc(100vw - 24px);
    padding: 16px;
  }

  .confirm-summary {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    min-width: 0;
    background: #fff;
  }

  .sidebar,
  .top-actions {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .workspace {
    padding: 0;
  }

  .score-panel,
  .summary-strip div {
    box-shadow: none;
  }

  .table-wrap {
    max-height: none;
  }
}


/* Document submission portal */
.college-shell { grid-template-columns: 360px minmax(0, 1fr); }
.college-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px;
  background: #f9fbfa;
}
.college-account-card, .submission-window-mini, .notice-card {
  display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.college-account-card span, .submission-window-mini small, .notice-card p, .detail-text-grid span, .document-upload-info small, .document-upload-info .muted, .submission-tracking-table small, .submission-documents-table small { color: var(--muted); }
.compact-college-card {
  gap: 3px;
  padding: 10px 11px;
}
.compact-college-card strong {
  font-size: 14px;
  line-height: 1.35;
}
.compact-college-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.college-sidebar-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
.college-sidebar-actions button {
  min-height: 0;
  padding: 8px 10px;
  white-space: nowrap;
}
.college-sidebar-actions .submission-window-mini {
  padding: 9px 10px;
}
.college-sidebar-actions .submission-window-mini strong,
.college-sidebar-actions .submission-window-mini small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.college-doc-note {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #d5e7e3;
  border-radius: 8px;
  background: #f1f8f6;
  font-size: 13px;
}
.college-doc-note span {
  color: var(--muted);
  white-space: nowrap;
}
.college-level-tabs {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 6px;
}
.college-level-tabs button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 13px;
}
.college-level-tabs button.active {
  border-color: var(--teal);
  background: #e8f3f1;
  color: var(--teal-dark);
  font-weight: 700;
}
.college-level-tabs b {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .1);
  font-size: 11px;
}
.college-project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  padding: 0 2px;
}
.college-project-header strong {
  color: var(--text);
}
.college-project-list {
  gap: 7px;
  max-height: calc(100vh - 286px);
  padding-right: 2px;
}
.college-project-item {
  grid-template-columns: 48px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 9px;
  min-height: 74px;
  padding: 9px 10px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.college-project-item:hover,
.college-project-item.active {
  background: #eef8f6;
  border-color: #b8d7d1;
}
.college-project-code {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 32px;
  border-radius: 8px;
  background: #eef2f0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}
.college-project-item .project-text {
  gap: 4px;
}
.college-project-item .project-text strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13px;
  line-height: 1.35;
}
.college-project-item .project-text span {
  color: var(--muted);
  font-size: 12px;
}
.college-project-progress {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 30px;
  border-radius: 999px;
  background: #f0f2f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.college-project-progress.complete {
  background: #dff3ed;
  color: var(--teal-dark);
}
.submission-window-mini.open, .submission-window-card.open { border-color: #99d4c8; background: #eef9f6; }
.submission-window-mini.closed, .submission-window-card.closed { border-color: #efd4a7; background: #fff9ef; }
.submission-window-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; }
.submission-window-card > div { display: grid; gap: 4px; }
.status-chip { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-chip.submitted { background: #dff3ed; color: #086251; }
.status-chip.approved { background: #e1f0ff; color: #155f91; }
.status-chip.returned { background: #fff0e4; color: #9b5308; }
.status-chip.draft, .status-chip.not_started, .status-chip.incomplete { background: #f0f2f1; color: #596861; }
.status-chip.used-score { background: #e9f7f3; color: #0f766e; }
.status-chip.trim-high { background: #fff1e8; color: #a14b08; }
.status-chip.trim-low { background: #eef2ff; color: #33449c; }
.trim-notice { border-color: #d7c49a; background: #fffaf0; }
.submission-tracking-table small, .submission-documents-table small, .document-upload-info small, .file-name { display: block; margin-top: 4px; }
.submission-tracking-table td, .submission-documents-table td { vertical-align: middle; }
.submission-settings-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.submission-setting-status {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(21, 34, 29, 0.055);
}
.submission-setting-status span,
.submission-setting-status small,
.submission-current-list span,
.submission-doc-type-list small {
  color: var(--muted);
}
.submission-setting-status strong {
  font-size: 24px;
  line-height: 1;
}
.submission-setting-status.open {
  border-color: #b8ddcd;
  background: #f2faf8;
}
.submission-setting-status.open strong {
  color: #1d6a45;
}
.submission-setting-status.closed {
  border-color: #f2d2a2;
  background: #fff8eb;
}
.submission-setting-status.closed strong {
  color: #8a5208;
}
.submission-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.submission-settings-main,
.submission-settings-side,
.submission-current-list,
.submission-doc-type-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.submission-window-settings-card {
  padding-bottom: 16px;
}
.submission-setting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}
.submission-setting-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.submission-setting-grid label > span {
  color: var(--muted);
  font-size: 13px;
}
.submission-setting-grid input[type="datetime-local"],
.submission-setting-grid textarea {
  width: 100%;
}
.setting-toggle-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px !important;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}
.setting-toggle-card input {
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--teal);
}
.setting-toggle-card span {
  display: grid;
  gap: 3px;
}
.setting-toggle-card strong {
  color: var(--text);
}
.setting-toggle-card small {
  color: var(--muted);
  line-height: 1.4;
}
.submission-current-list > div,
.submission-doc-type-list > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}
.submission-current-list strong {
  line-height: 1.35;
}
.submission-current-list p {
  color: var(--text);
  line-height: 1.45;
  white-space: pre-line;
}
.submission-instruction { grid-column: 1 / -1; }
.submission-setting-grid textarea, .review-card textarea { width: 100%; resize: vertical; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; padding: 8px 10px; font: inherit; }
.document-types-table th:nth-child(1), .document-types-table td:nth-child(1) { width: 86px; }
.document-types-table th:nth-child(2), .document-types-table td:nth-child(2) { width: 150px; }
.document-types-table th:nth-child(5), .document-types-table td:nth-child(5) { width: 160px; }
.document-types-table th:nth-child(6), .document-types-table td:nth-child(6) { width: 74px; }
.document-types-table th:nth-child(7), .document-types-table td:nth-child(7), .document-types-table th:nth-child(8), .document-types-table td:nth-child(8) { width: 70px; text-align: center; }
.source-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 62px; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef2f1; color: #53625e; }
.source-badge.college { background: #e9f7f2; color: #0d6b55; }
.source-badge.system { background: #f1f0ff; color: #5345a8; }
.source-badge.admin { background: #fff4df; color: #8b5a0f; }
.submission-filter-card { padding: 14px; }
.submission-filter-grid { display: grid; grid-template-columns: minmax(260px, 1.4fr) minmax(160px, .7fr) minmax(130px, .5fr) minmax(260px, auto); gap: 12px; align-items: end; }
.submission-filter-grid label { display: grid; gap: 5px; }
.submission-filter-grid label span { color: var(--muted); font-size: 13px; font-weight: 700; }
.submission-filter-grid input, .submission-filter-grid select, .submission-setting-grid select { border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; padding: 9px 10px; font: inherit; min-height: 42px; }
.submission-filter-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.submission-college-projects { display: grid; gap: 14px; }
.submission-project-review-card { display: grid; gap: 12px; }
.submission-project-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.submission-project-meta > div, .missing-document-box, .submission-check-item { border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; padding: 10px; display: grid; gap: 4px; }
.submission-project-meta span, .missing-document-box span, .submission-check-item span { color: var(--muted); font-size: 12px; font-weight: 700; }
.missing-document-box strong { color: #7d241f; font-size: 13px; }
.submission-checklist-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 8px; }
.submission-check-item.complete { border-color: #acd7ce; background: #f2fbf8; }
.submission-check-item.missing { border-color: #ead0bd; background: #fff8f2; }
.submission-check-item a { font-size: 12px; font-weight: 700; color: var(--primary); }
.checkbox-cell input { width: 18px !important; height: 18px; min-height: auto !important; }
.tiny-note { font-size: 12px; margin-bottom: 10px; }
.detail-text-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-text-grid > div { padding: 12px; border-radius: 7px; background: #f7faf9; }
.detail-text-grid p { white-space: pre-line; margin-top: 6px; }
.required-mark { color: var(--danger); font-weight: 800; }
.review-card { display: grid; gap: 12px; }
.review-actions { justify-content: flex-end; }
.college-workspace { display: grid; gap: 12px; }
.document-upload-list { display: grid; gap: 9px; }
.document-upload-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; }
.document-upload-row.uploaded { border-color: #b4d9d0; background: #f5fbf9; }
.document-upload-info { min-width: 0; display: grid; gap: 2px; }
.document-upload-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.file-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 9px 12px; text-decoration: none; cursor: pointer; }
.small-danger { min-height: 34px; padding: 6px 9px; }
.submit-documents-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.submit-documents-card > div { display: grid; gap: 5px; }
.notice-card.warning { border-color: #efd4a7; background: #fff9ef; }
.muted { color: var(--muted); }
.submission-summary-strip strong { font-size: 16px; }

@media (max-width: 900px) {
  .college-shell { display: block; }
  .college-sidebar { border-bottom: 1px solid var(--line); }
  .college-project-list {
    display: flex;
    gap: 8px;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .college-project-item {
    min-width: 280px;
    max-width: 320px;
  }
  .certifier-groups,
  .certifier-form-grid,
  .central-form-grid,
  .master-summary-grid,
  .master-college-create-grid {
    grid-template-columns: 1fr;
  }
  .master-table-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .master-table-head input[type="search"] {
    width: 100%;
  }
  .submission-setting-grid, .detail-text-grid, .linked-management-summary { grid-template-columns: 1fr; }
  .submission-filter-grid, .submission-project-meta, .submission-checklist-grid { grid-template-columns: 1fr; }
  .submission-filter-actions { justify-content: stretch; }
  .submission-filter-actions button { flex: 1 1 140px; }
  .document-upload-row, .submit-documents-card, .submission-window-card { align-items: flex-start; flex-direction: column; }
  .document-upload-actions { width: 100%; flex-wrap: wrap; }
}

.scoring-option { grid-column: 1 / -1; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; }
.scoring-option input { margin-top: 2px; }
.user-role-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}
.user-role-tabs button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 12px 14px;
  border-color: var(--line);
  background: #fbfcfb;
  font-weight: 700;
}
.user-role-tabs button.active {
  background: #e8f3f1;
  color: var(--teal-dark);
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .18);
}
.user-role-tabs b {
  min-width: 32px;
  text-align: center;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f0;
  color: var(--muted);
}
.user-role-tabs button.active b {
  background: var(--teal);
  color: #fff;
}
.user-create-grid {
  display: grid;
  gap: 10px;
  margin: 8px 0 14px;
  align-items: end;
}
.user-create-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.user-create-grid span {
  color: var(--muted);
  font-size: 13px;
}
.user-create-grid input,
.user-create-grid select {
  width: 100%;
  min-width: 0;
}
.user-create-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.user-create-grid-judge { grid-template-columns: minmax(140px, .75fr) minmax(180px, 1fr) minmax(160px, .8fr) minmax(220px, 1.2fr) auto; }
.user-create-grid-college { grid-template-columns: minmax(140px, .75fr) minmax(180px, 1fr) minmax(160px, .8fr) minmax(180px, .95fr) minmax(180px, .95fr) minmax(150px, .75fr) auto; }
.user-create-grid-executive { grid-template-columns: minmax(140px, .8fr) minmax(180px, 1fr) minmax(160px, .75fr) auto; }
.user-management-table { min-width: 1180px; table-layout: fixed; }
.user-management-table th, .user-management-table td { vertical-align: middle; }
.user-management-table input,
.user-management-table select {
  width: 100%;
  min-width: 0;
}
.user-management-table th:nth-child(1), .user-management-table td:nth-child(1) { width: 130px; }
.user-management-table th:nth-child(2), .user-management-table td:nth-child(2) { width: 180px; }
.user-management-table th:nth-child(3), .user-management-table td:nth-child(3) { width: 160px; }
.user-management-table th:last-child, .user-management-table td:last-child { width: 220px; }
.user-actions-cell { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
.executive-accounts-table { min-width: 900px; }
.executive-accounts-table th:nth-child(2), .executive-accounts-table td:nth-child(2) { width: 220px; }
.executive-accounts-table th:last-child, .executive-accounts-table td:last-child { width: 220px; }

.linked-management-card {
  display: grid;
  gap: 12px;
}

.linked-management-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.linked-management-summary > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.linked-management-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.linked-management-summary strong {
  color: var(--teal-dark);
  font-size: 22px;
  line-height: 1;
}

.audit-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.audit-filter-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
}

.audit-filter-tabs button.active {
  border-color: var(--teal);
  background: #e8f3f1;
  color: var(--teal-dark);
  font-weight: 700;
}

.audit-filter-tabs b {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef2f0;
  color: var(--muted);
  font-size: 11px;
}

.audit-filter-tabs button.active b {
  background: var(--teal);
  color: #fff;
}

.participating-workspace {
  display: grid;
  gap: 14px;
}

.master-summary-grid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.master-college-create-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(120px, .55fr) minmax(130px, .6fr) minmax(180px, .9fr) minmax(180px, .9fr) minmax(150px, .7fr);
  gap: 10px;
  align-items: end;
}

.master-college-create-grid label,
.master-table-head {
  min-width: 0;
}

.master-college-create-grid label {
  display: grid;
  gap: 5px;
}

.master-college-create-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.master-table-head input[type="search"] {
  width: min(460px, 40vw);
}

.master-college-table {
  min-width: 1560px;
  table-layout: fixed;
}

.master-college-table th,
.master-college-table td {
  vertical-align: middle;
}

.master-college-table th:nth-child(1),
.master-college-table td:nth-child(1) { width: 360px; }
.master-college-table th:nth-child(2),
.master-college-table td:nth-child(2) { width: 110px; }
.master-college-table th:nth-child(3),
.master-college-table td:nth-child(3) { width: 120px; }
.master-college-table th:nth-child(4),
.master-college-table td:nth-child(4) { width: 180px; }
.master-college-table th:nth-child(5),
.master-college-table td:nth-child(5) { width: 190px; }
.master-college-table th:nth-child(6),
.master-college-table td:nth-child(6) { width: 140px; }
.master-college-table th:nth-child(7),
.master-college-table td:nth-child(7) { width: 95px; }
.master-college-table th:nth-child(8),
.master-college-table td:nth-child(8) { width: 190px; }
.master-college-table th:nth-child(9),
.master-college-table td:nth-child(9) { width: 170px; }
.master-college-table th:nth-child(10),
.master-college-table td:nth-child(10) { width: 70px; }

.mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.mini-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
  accent-color: var(--teal);
}

.master-link-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.master-link-counts span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef2f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.master-project-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.master-project-actions button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.quick-action-list {
  display: grid;
  gap: 8px;
}

.quick-action-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  text-align: left;
  background: #fbfcfb;
}

.quick-action-list button strong,
.quick-action-list button small {
  display: block;
}

.quick-action-list button small {
  margin-top: 2px;
  color: var(--muted);
}

.quick-action-list button:hover,
.master-college-table tbody tr:hover {
  background: #f4f8f6;
}

.executive-workspace { max-width: 1440px; margin: 0 auto; padding: 24px; }
.executive-topbar { align-items: center; margin-bottom: 14px; }
.executive-brand { gap: 12px; }
.executive-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  max-width: 520px;
}
.executive-view-tabs button {
  min-height: 42px;
  font-weight: 700;
  background: #fbfcfb;
}
.executive-view-tabs button.active {
  border-color: var(--teal);
  background: #e8f3f1;
  color: var(--teal-dark);
}
.executive-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border-left: 5px solid var(--teal);
}
.executive-status-card.pending {
  border-left-color: var(--amber);
}
.executive-status-card > div {
  display: grid;
  gap: 4px;
}
.executive-status-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.executive-status-card strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
}
.executive-status-card small {
  color: var(--muted);
}
.executive-main-grid { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .9fr) minmax(280px, .9fr); }
.executive-medal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.executive-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.executive-results-workspace { max-width: none; }
.executive-results-wrap { max-height: calc(100vh - 250px); }
.medal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.medal-tile { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; }
.medal-tile span { color: var(--muted); font-size: 12px; }
.medal-tile strong { font-size: 24px; }
.executive-leader-card {
  display: grid;
  align-content: start;
  gap: 9px;
}
.executive-leader-card > strong {
  line-height: 1.35;
}
.executive-leader-card > small,
.executive-leader-meta {
  color: var(--muted);
  line-height: 1.4;
}
.executive-leader-score {
  color: var(--teal-dark);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}
.executive-result-cards {
  display: none;
}
.executive-result-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.executive-result-card-rank {
  color: var(--teal-dark);
  font-weight: 800;
}
.executive-result-card-main {
  display: grid;
  gap: 4px;
}
.executive-result-card-main strong {
  line-height: 1.35;
}
.executive-result-card-main small,
.executive-result-card-meta {
  color: var(--muted);
}
.executive-result-card-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.executive-result-card-score b {
  color: var(--teal-dark);
  font-size: 28px;
  line-height: 1;
}
.executive-result-card-score span {
  font-weight: 800;
}
.dashboard-result-score { display: grid; gap: 5px; justify-items: end; }
.dashboard-result-score button { min-height: 30px; padding: 4px 8px; font-size: 12px; }

@media (max-width: 980px) {
  .executive-workspace { padding: 14px; }
  .executive-main-grid, .executive-list-grid, .executive-medal-grid { grid-template-columns: 1fr; }
  .executive-topbar { align-items: flex-start; }
  .executive-view-tabs { grid-template-columns: 1fr; max-width: none; }
  .executive-status-card {
    align-items: stretch;
    flex-direction: column;
  }
  .executive-status-card strong {
    font-size: 20px;
  }
  .executive-results-wrap {
    display: none;
  }
  .executive-result-cards {
    display: grid;
    gap: 10px;
  }
}

.project-people-panel,
.people-type-card,
.certificate-bg-control {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.project-people-panel {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
}

.people-editor {
  display: grid;
  gap: 12px;
}

.people-type-card {
  padding: 12px;
}

.people-type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.people-type-head h4 {
  margin: 0;
  font-size: 16px;
}

.people-type-head small,
.certificate-bg-control small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.people-row-list {
  display: grid;
  gap: 8px;
}

.person-edit-row {
  display: grid;
  grid-template-columns: minmax(80px, .7fr) repeat(2, minmax(120px, 1fr)) repeat(5, minmax(100px, 1fr)) auto;
  gap: 8px;
  align-items: center;
}

.person-edit-row input,
.certificate-settings-grid input,
.certificate-settings-grid textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
}

.person-row-actions {
  display: flex;
  gap: 5px;
}

.person-row-actions button {
  min-height: 34px;
  padding: 6px 8px;
  white-space: nowrap;
}

.people-empty-inline {
  margin-top: 12px;
  color: var(--muted);
}

.certificates-workspace .notice-card {
  margin-bottom: 14px;
}

.certificate-settings-card,
.certificate-export-card,
.college-people-card,
.college-result-card {
  display: grid;
  gap: 14px;
}

.certificate-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.certificate-settings-grid label {
  display: grid;
  gap: 6px;
}

.certificate-settings-grid span {
  color: var(--muted);
  font-size: 13px;
}

.certificate-settings-grid .wide-field {
  grid-column: span 3;
}

.certificate-extra-position-option {
  grid-column: span 3;
  width: min(100%, 560px);
}

.certificate-background-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.certificate-bg-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.certificate-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(240px, 360px) 1fr;
  gap: 12px;
  align-items: center;
}

.compact-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.compact-tabs button.active {
  background: #e8f3f1;
  border-color: var(--teal);
  color: var(--teal-dark);
  font-weight: 700;
}

.certificate-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.certificate-person-row td {
  background: #f7faf8;
  border-top: 0;
}

.certificate-person-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.disabled-link {
  pointer-events: none;
  opacity: .5;
}

@media (max-width: 1180px) {
  .person-edit-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .person-row-actions {
    grid-column: span 2;
  }

  .certificate-settings-grid,
  .certificate-background-grid,
  .certificate-toolbar {
    grid-template-columns: 1fr;
  }

  .certificate-settings-grid .wide-field {
    grid-column: auto;
  }
}
