:root {
  --ink: #1e293b;
  --muted: #64748b;
  --line: #dbe3ee;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --primary: #155e75;
  --primary-dark: #164e63;
  --accent: #f59e0b;
  --success: #15803d;
  --danger: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Tahoma, "Noto Sans Thai", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--primary); }

.container {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  color: #fff;
  background: linear-gradient(120deg, #0f172a, #155e75);
  border-bottom: 4px solid var(--accent);
}

.header-inner {
  position: relative;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 10px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 10px;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: currentColor;
  border-radius: 999px;
  transition: transform .2s ease, opacity .2s ease;
}
.site-header.menu-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.site-header.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.brand-logo {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  object-fit: contain;
  padding: 2px;
  background: #fff;
  border-radius: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #0f172a;
  background: var(--accent);
  border-radius: 12px;
  font-weight: 800;
}

.brand strong, .brand small { display: block; }
.brand small { color: #bae6fd; }
.brand-text { display: block; min-width: 0; }
.brand-college-th,
.brand-college-en,
.brand-system-name,
.brand-product-en { display: block; }
.brand-college-th {
  color: var(--ink);
  margin-top: 3px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}
.brand-college-en {
  margin-top: 1px;
  font-size: 7px;
  letter-spacing: .025em;
  line-height: 1.25;
  white-space: nowrap;
}
.brand-system-name {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
}
.brand-product-en {
  margin-top: 0;
  color: var(--primary-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.2;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: flex-end;
}

.main-nav a {
  color: #e0f2fe;
  text-decoration: none;
}
.main-nav a:hover,
.main-nav a:focus { color: #fff; text-decoration: underline; text-underline-offset: 5px; }

.page-shell { min-height: calc(100vh - 146px); padding: 32px 0 52px; }
.site-footer { padding: 20px 0; color: var(--muted); background: #e8edf3; }

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-heading h1 { margin: 0 0 6px; font-size: 30px; line-height: 1.25; }
.page-heading p { margin: 0; color: var(--muted); }

.user-context-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #fff 0%, #f0f9ff 100%);
  border: 1px solid #cbddeb;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}
.user-context-label {
  display: block;
  margin-bottom: 3px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
}
.user-context-main h1 {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.25;
}
.user-profile-name {
  display: grid;
  gap: 1px;
  margin: -3px 0 13px;
}
.user-profile-name strong {
  color: var(--primary-dark);
  font-size: 17px;
  line-height: 1.4;
}
.user-profile-name small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}
.user-context-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.user-context-meta span {
  padding: 6px 11px;
  color: #475569;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
}
.user-context-meta strong { color: #0f172a; }
.user-context-status {
  min-width: 150px;
  padding: 16px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.user-context-status small { display: block; margin-bottom: 8px; color: var(--muted); }

.card {
  margin-bottom: 22px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.metric {
  padding: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.metric small { display: block; color: var(--muted); }
.metric strong { display: block; margin-top: 4px; font-size: 22px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: #334155; background: #f8fafc; font-size: 13px; }
.assessment-item-cell { min-width: 360px; }
.assessment-item-name {
  display: block;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.55;
}
.assessment-kpi-code {
  display: block;
  margin-top: 5px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}
.assessor-person-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: #0e7490;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.assessor-person-toggle:hover,
.assessor-person-toggle:focus-visible {
  color: #155e75;
  background: #cffafe;
  border-color: #67e8f9;
}
.assessor-person-toggle:focus-visible { outline: 3px solid rgba(8, 145, 178, .18); }
.assessor-toggle-count {
  min-width: 22px;
  padding: 2px 6px;
  color: #fff;
  background: #0e7490;
  border-radius: 999px;
  text-align: center;
}
.assessor-toggle-icon { font-size: 10px; transition: transform .18s ease; }
.assessor-person-toggle[aria-expanded="true"] .assessor-toggle-icon { transform: rotate(180deg); }
.assessor-kpi-panel-row[hidden] { display: none; }
.assessor-kpi-panel-row > td {
  padding: 0 10px 14px;
  background: #f8fafc;
}
.assessor-kpi-panel {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.assessor-kpi-score-table-wrap { width: 100%; }
.assessor-kpi-score-table-wrap table { table-layout: fixed; }
.assessor-kpi-score-table-wrap th:first-child,
.assessor-kpi-score-table-wrap td:first-child { width: 42%; }
.assessor-kpi-score-table-wrap th:nth-child(2),
.assessor-kpi-score-table-wrap td:nth-child(2) { width: 13%; }
.assessor-kpi-score-table-wrap th:nth-child(3),
.assessor-kpi-score-table-wrap td:nth-child(3),
.assessor-kpi-score-table-wrap th:nth-child(4),
.assessor-kpi-score-table-wrap td:nth-child(4) { width: 12%; }
.assessor-kpi-score-table-wrap th:last-child,
.assessor-kpi-score-table-wrap td:last-child { width: 21%; }
.assessor-kpi-score-table-wrap .assessment-item-cell { min-width: 0; }
.assessor-score-actions { align-items: stretch; }
.assessor-score-actions .button { text-align: center; white-space: normal; }
.assessor-score-actions form { display: flex; }
.assessor-score-actions form .button { width: 100%; }

@media (max-width: 900px) {
  .assessor-assignment-table { min-width: 760px; }
  .assessor-kpi-score-table-wrap table { min-width: 720px; }
}
.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.status-muted { color: #475569; background: #e2e8f0; }
.status-draft { color: #92400e; background: #fef3c7; }
.status-wait { color: #1d4ed8; background: #dbeafe; }
.status-done { color: #166534; background: #dcfce7; }
.status-error { color: #991b1b; background: #fee2e2; }

.button {
  display: inline-block;
  padding: 10px 16px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 9px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.button:hover { background: var(--primary-dark); }
.button-secondary { color: var(--ink); background: #e2e8f0; }
.button-secondary:hover { color: #fff; background: #475569; }
.button-outline {
  color: var(--primary);
  background: transparent;
  border: 1px solid #94a3b8;
}
.button-outline:hover { color: #fff; border-color: var(--primary-dark); }
.button-success { background: var(--success); }
.button-success:hover { background: #166534; }
.button-danger { background: var(--danger); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-small { padding: 6px 10px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.inline-form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
}
.inline-form .field { min-width: 280px; margin-bottom: 0; }
.confirm-action { margin-top: 18px; }

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-weight: 700; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
}
.checkbox-row input { width: 18px; height: 18px; }
input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(21, 94, 117, .14);
  border-color: var(--primary);
}

.choice {
  display: grid;
  grid-template-columns: 34px minmax(120px, 1fr) minmax(120px, 1.3fr) 110px;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
}
.choice:hover { border-color: #67e8f9; background: #ecfeff; }
.choice input { width: 18px; height: 18px; }
.choice-score { text-align: right; font-weight: 700; color: var(--primary); }

.alert { margin-bottom: 20px; padding: 14px 16px; border-radius: 10px; }
.alert-success { color: #166534; background: #dcfce7; border: 1px solid #86efac; }
.alert-error { color: #991b1b; background: #fee2e2; border: 1px solid #fca5a5; }
.alert-info { color: #1e40af; background: #dbeafe; border: 1px solid #93c5fd; }
.muted { color: var(--muted); }
.pre-line { white-space: pre-line; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.summary-grid > div {
  padding: 14px;
  text-align: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.summary-grid strong, .summary-grid span { display: block; }
.summary-grid strong { font-size: 24px; color: var(--primary); }
.summary-grid span { color: var(--muted); }
.assignment-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.assignment-hero { padding: 0; overflow: hidden; }
.assignment-hero-heading { padding: 26px 28px 22px; background: linear-gradient(135deg, #f8fafc, #ecfeff); }
.assignment-kpi-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}
.assignment-kpi-meta > span {
  padding: 4px 9px;
  background: rgba(255, 255, 255, .85);
  border: 1px solid #cbd5e1;
  border-radius: 999px;
}
.assignment-kpi-meta .assignment-kpi-code {
  color: var(--primary);
  background: #cffafe;
  border-color: #a5f3fc;
  font-size: 12px;
}
.assignment-kpi-title {
  max-width: 1050px;
  margin: 0;
  color: #0f172a;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.4;
}
.assignment-weight {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 9px 14px;
  color: #78350f;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 11px;
}
.assignment-weight span { font-size: 13px; font-weight: 700; }
.assignment-weight strong { color: #92400e; font-size: 24px; line-height: 1; }
.assignment-people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 28px 0;
}
.assignment-person-card {
  padding: 15px 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.assignment-person-card small,
.assignment-person-card strong,
.assignment-person-card span { display: block; }
.assignment-person-card small { color: var(--muted); }
.assignment-person-card strong { margin: 3px 0; color: #0f172a; font-size: 17px; }
.assignment-person-card span { color: var(--primary); font-size: 13px; font-weight: 700; }
.assignment-person-profile {
  display: grid;
  gap: 1px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}
.assignment-person-profile span {
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}
.assignment-person-profile small {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
}
.table-profile-name {
  display: grid;
  gap: 1px;
  margin-top: 7px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}
.table-profile-name small {
  color: #64748b;
  font-size: 10px;
  letter-spacing: .04em;
}
.assignment-hero .kpi-detail { margin: 20px 28px 28px; }
.kpi-detail {
  margin-top: 20px;
  padding: 18px;
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
}
.kpi-detail h3 { margin: 0 0 8px; }
.kpi-detail p { margin: 0; }

.login-shell {
  max-width: 480px;
  margin: 5vh auto;
}
.login-shell .card { padding: 34px; }
.login-branding {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.login-logo {
  width: 116px;
  height: 108px;
  flex: 0 0 116px;
  object-fit: contain;
}
.login-branding strong,
.login-branding span { display: block; }
.login-branding strong {
  color: var(--ink);
  font-size: 21px;
}
.login-branding span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

/* Admin setup pages */
html { scroll-behavior: smooth; scroll-padding-top: 92px; }

.admin-page-heading { margin-bottom: 18px; }
.admin-page-heading .actions { justify-content: flex-end; }

.eyebrow,
.section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.current-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 16px 20px;
  color: #e0f2fe;
  background: #164e63;
  border-radius: 12px;
}
.current-context-label {
  display: block;
  color: #a5f3fc;
  font-size: 12px;
}
.current-context strong { display: block; color: #fff; font-size: 20px; }
.current-context p { max-width: 620px; margin: 0; color: #cffafe; }

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .04);
}
.quick-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #334155;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}
.quick-nav a:hover { color: var(--primary); background: #ecfeff; }
.quick-nav a span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 12px;
}

.workflow-guide {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 24px;
}
.workflow-step {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.workflow-number {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 10px;
  font-weight: 800;
}
.workflow-step strong,
.workflow-step small { display: block; }
.workflow-step small { margin-top: 2px; color: var(--muted); line-height: 1.35; }
.workflow-arrow {
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 22px;
}

.admin-section {
  scroll-margin-top: 18px;
  margin: 34px 0 46px;
}
.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.section-number {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  border-radius: 13px;
  box-shadow: 0 6px 14px rgba(21, 94, 117, .2);
  font-size: 20px;
  font-weight: 800;
}
.section-heading h2 { margin: 0; font-size: 24px; line-height: 1.25; }
.section-heading p { margin: 4px 0 0; color: var(--muted); }
.section-heading .section-kicker { margin-bottom: 3px; }

.admin-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding: 20px;
  border-top: 4px solid #94a3b8;
}
.form-card-primary { border-top-color: var(--success); }
.form-card-muted { background: #f8fafc; border-style: dashed; border-top-style: solid; }
.form-card form {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.form-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 62px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.form-card-heading h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.form-card-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.form-step {
  flex: 0 0 auto;
  display: inline-block;
  padding: 3px 8px;
  color: var(--primary);
  background: #cffafe;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}
.field-help {
  display: block;
  margin: -4px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.compact-grid { gap: 12px; }
.form-actions {
  display: flex;
  align-items: flex-end;
  flex: 1;
  padding-top: 4px;
}
.form-actions .button { width: 100%; text-align: center; }
.assessor-profile-form-actions {
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 0;
}
.assessor-profile-form-actions .button {
  width: auto;
  min-width: 180px;
}
.assessor-assignment-form-actions {
  flex: 0 0 auto;
  margin-top: 8px;
  padding-top: 0;
}
.assessor-assignment-form-actions .button { width: 100%; }
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.pagination a {
  min-width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  color: var(--primary-dark);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.pagination a:hover { background: var(--surface-soft); }
.pagination a.is-current {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.pagination-summary {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.empty-state {
  padding: 18px;
  color: #475569;
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 9px;
  text-align: center;
}
.notice-inline {
  margin-bottom: 18px;
  padding: 12px 14px;
  color: #334155;
  background: #f1f5f9;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  font-size: 13px;
}
.notice-important {
  color: #854d0e;
  background: #fefce8;
  border-color: var(--accent);
  font-size: 14px;
}

.scope-explainer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.scope-explainer > div {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.scope-explainer strong {
  align-self: flex-start;
  padding: 2px 8px;
  color: #1e40af;
  background: #dbeafe;
  border-radius: 6px;
  font-size: 12px;
}
.scope-explainer span { color: #475569; }
.scope-card-question { border-top-color: #2563eb; }
.scope-card-unit { border-top-color: #7c3aed; }
.assessor-kpi-category-stack { margin-top: 14px; }
.assessor-kpi-category > summary { user-select: none; }
.assessor-kpi-table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.assessor-kpi-mapping-table {
  min-width: 1080px;
  table-layout: fixed;
}
.assessor-kpi-mapping-table th,
.assessor-kpi-mapping-table td { vertical-align: top; }
.assessor-kpi-mapping-table th:nth-child(1) { width: 115px; }
.assessor-kpi-mapping-table th:nth-child(2) { width: 27%; }
.assessor-kpi-mapping-table th:nth-child(3) { width: 28%; }
.assessor-kpi-mapping-table th:nth-child(4) { width: 30%; }
.assessor-kpi-mapping-table th:nth-child(5) { width: 115px; }
.assessor-kpi-code-cell strong,
.assessor-kpi-code-cell small { display: block; }
.assessor-kpi-code-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.assessor-kpi-name-cell {
  color: var(--ink);
  line-height: 1.55;
}
.assessor-kpi-table-row { transition: background-color .15s ease; }
.assessor-kpi-table-row:hover { background: var(--surface-soft); }
.assessor-kpi-profile-heading {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.assessor-kpi-profile-list {
  display: grid;
  gap: 6px;
}
.assessor-kpi-profile-list span {
  padding: 6px 9px;
  color: var(--primary-dark);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.4;
}
.assessor-kpi-assignee-cell select {
  width: 100%;
  min-width: 0;
}
.assessor-kpi-multiple-warning {
  display: block;
  margin-top: 7px;
  color: #b45309;
  font-size: 11px;
  line-height: 1.45;
}
.assessor-kpi-save-cell .button {
  width: 100%;
  padding-right: 10px;
  padding-left: 10px;
  white-space: nowrap;
}
.assessor-kpi-save-all {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 14px 18px;
  color: #e0f2fe;
  background: rgba(15, 23, 42, .96);
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
}
.assessor-kpi-save-all strong,
.assessor-kpi-save-all span { display: block; }
.assessor-kpi-save-all span {
  color: #bae6fd;
  font-size: 12px;
}

.preview-card { padding: 22px; border-top: 4px solid var(--accent); }
.preview-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.preview-toolbar h3 { margin: 0; }
.preview-toolbar p { margin: 3px 0 0; }
.preview-toolbar .inline-form { flex-wrap: nowrap; }
.preview-toolbar .inline-form .field { min-width: 300px; }
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.preview-actions form { margin: 0; }
.technical-label { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.assignment-summary .summary-error { background: #fff1f2; border-color: #fecdd3; }
.assignment-summary .summary-error strong { color: var(--danger); }
.assignment-summary .summary-done { background: #f0fdf4; border-color: #bbf7d0; }
.assignment-summary .summary-done strong { color: var(--success); }
.preview-person-section { margin-top: 22px; }
.preview-person-section > .form-card-heading { margin-bottom: 10px; }
.preview-kpi-details summary {
  display: inline-block;
  padding: 6px 10px;
  color: var(--primary);
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  list-style: none;
  white-space: nowrap;
}
.preview-kpi-details summary::-webkit-details-marker { display: none; }
.preview-kpi-details summary::after { content: " ▼"; }
.preview-kpi-details[open] summary::after { content: " ▲"; }
.preview-kpi-details > .table-wrap {
  min-width: 620px;
  margin-top: 10px;
}
.assignment-step-help { margin-top: 22px; }
.assignment-step-help .card { padding: 16px; }
.assignment-step-help p { margin: 6px 0 0; color: var(--muted); }

.admin-summary { margin-top: 0; }
.admin-summary-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.details-panel {
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .035);
  overflow: hidden;
}
.details-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}
.details-panel summary::-webkit-details-marker { display: none; }
.details-panel summary::before {
  content: "+";
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: #ecfeff;
  border-radius: 6px;
  font-weight: 800;
}
.details-panel[open] summary::before { content: "−"; }
.details-panel summary > span:first-of-type { flex: 1; }
.details-panel summary strong,
.details-panel summary small { display: block; }
.details-panel summary small { margin-top: 2px; color: var(--muted); }
.details-panel[open] summary { border-bottom: 1px solid var(--line); }
.details-content { padding: 0 18px 14px; }
.count-badge {
  flex: 0 0 auto;
  padding: 4px 10px;
  color: #475569;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.table-empty { padding: 24px; color: var(--muted); text-align: center; }
.details-content tbody tr:nth-child(even) { background: #fafcff; }
.details-content tbody tr:hover { background: #f0f9ff; }

/* KPI and profile management */
.filter-bar {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.filter-bar .field { min-width: 180px; }
.weight-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.weight-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.weight-row .checkbox-row {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}
.option-editor {
  min-width: 760px;
}
.option-editor-head,
.option-editor-row {
  display: grid;
  grid-template-columns: 60px minmax(220px, 1.3fr) 110px minmax(220px, 1fr) 72px;
  gap: 10px;
  align-items: center;
}
.option-card-heading {
  align-items: center;
  justify-content: space-between;
}
.option-card-heading > div:first-child { flex: 1; }
.option-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.option-heading-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.option-editor-head {
  padding: 0 10px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.option-editor-row {
  padding: 10px;
  border-top: 1px solid var(--line);
}
.option-editor-row[hidden] { display: none; }
.option-editor-row:nth-child(even) { background: #fafcff; }
.sticky-save-bar {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 40px;
  padding: 14px 18px;
  color: #e0f2fe;
  background: rgba(15, 23, 42, .96);
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
}
.sticky-save-bar strong,
.sticky-save-bar span { display: block; }
.sticky-save-bar span { color: #bae6fd; font-size: 12px; }
.bulk-toolbar,
.selection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.bulk-toolbar .checkbox-row,
.selection-toolbar .checkbox-row { margin: 0; }
.bulk-copy-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bulk-copy-controls input,
.bulk-copy-controls select { width: auto; min-width: 140px; }
.bulk-select-groups {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.bulk-select-groups .checkbox-row { white-space: nowrap; }
.weight-display-column { min-width: 148px; }
.weight-chip-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}
.weight-chip-list-inline {
  flex-direction: row;
  flex-wrap: wrap;
}
.weight-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 124px;
  padding: 4px 5px 4px 9px;
  border: 1px solid #a5f3fc;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.weight-chip strong {
  min-width: 42px;
  padding: 3px 7px;
  border-radius: 999px;
  text-align: center;
  background: rgba(255, 255, 255, .78);
}
.weight-chip-support {
  color: #155e75;
  background: #ecfeff;
  border-color: #a5f3fc;
}
.weight-chip-deputy {
  color: #7e22ce;
  background: #faf5ff;
  border-color: #e9d5ff;
}
.weight-chip-teacher {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.kpi-dialog {
  width: min(900px, calc(100% - 28px));
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
}
.admin-edit-dialog { width: min(720px, calc(100% - 28px)); }
.kpi-edit-dialog { width: min(1120px, calc(100% - 28px)); }
.kpi-dialog::backdrop { background: rgba(15, 23, 42, .65); }
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  color: #fff;
  background: linear-gradient(120deg, #0f172a, #155e75);
}
.dialog-heading h2 { margin: 0; font-size: 22px; }
.dialog-heading .eyebrow { color: #a5f3fc; }
.dialog-close {
  width: 36px;
  height: 36px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 24px;
}
.dialog-content { max-height: calc(88vh - 76px); padding: 22px 24px; overflow-y: auto; }
.dialog-details > div {
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
}
.order-buttons {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.order-buttons .button {
  min-width: 34px;
  padding: 5px 8px;
}
.kpi-order-display {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi-drag-handle {
  padding: 5px 8px;
  color: #0e7490;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 7px;
  cursor: grab;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  user-select: none;
}
.kpi-drag-handle:active { cursor: grabbing; }
.kpi-sortable-body [data-kpi-sort-row] { transition: background-color .15s ease; }
.kpi-sortable-body [data-kpi-sort-row].is-dragging {
  opacity: .55;
  background: #cffafe;
  outline: 2px dashed #06b6d4;
  outline-offset: -2px;
}
.kpi-sortable-body .kpi-row-checked td { background: #f0fdf4; }
.kpi-name-profile-cell { min-width: 360px; }
.kpi-name-text {
  color: #0f172a;
  line-height: 1.55;
}
.kpi-profile-inline-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.kpi-profile-summary-label {
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.kpi-profile-weight-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 8px;
  color: #5b21b6;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.25;
}
.kpi-profile-weight-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-profile-weight-chip > span {
  flex: 0 0 auto;
  font-weight: 800;
  white-space: nowrap;
}
.kpi-row-checked .kpi-profile-summary-label { color: #166534; }
.kpi-row-checked .kpi-profile-weight-chip {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}
.kpi-check-cell { min-width: 112px; }
.kpi-review-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.kpi-review-check.is-checked {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}
.kpi-review-check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #16a34a;
}
.kpi-review-check input:disabled { cursor: wait; opacity: .6; }
.checkbox-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.selection-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.selection-card:hover { background: #ecfeff; border-color: #67e8f9; }
.selection-card input { width: 18px; height: 18px; flex: 0 0 auto; }
.selection-card > span { min-width: 0; flex: 1; }
.selection-card strong,
.selection-card small { display: block; }
.selection-card small { margin-top: 3px; color: var(--muted); }
.profile-kpi-card {
  display: grid;
  cursor: default;
}
.profile-kpi-card > .checkbox-row {
  justify-content: flex-start;
}
.profile-kpi-settings {
  width: 100%;
  margin-top: 8px;
}
.profile-kpi-settings .field {
  margin-bottom: 0;
}
.existing-profile-mapping-actions {
  display: grid;
  gap: 5px;
  min-width: 112px;
}
.profile-mapping-remove-status {
  color: #b91c1c;
  font-weight: 700;
}
.profile-mapping-marked-for-removal {
  background: #fff1f2;
  opacity: .68;
}
.kpi-profile-add-panel {
  margin: 8px 0 16px;
  padding: 16px;
  background: #ecfeff;
  border: 1px solid #67e8f9;
  border-radius: 12px;
}
.kpi-profile-add-panel[hidden] { display: none; }
.kpi-profile-add-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.kpi-profile-add-heading strong,
.kpi-profile-add-heading small { display: block; }
.kpi-profile-add-heading small {
  margin-top: 3px;
  color: var(--muted);
}
.kpi-profile-add-panel .field { margin-bottom: 0; }
.new-profile-mapping-list {
  display: grid;
  gap: 12px;
}
.new-profile-mapping-row {
  padding: 14px;
  background: #fff;
  border: 1px solid #a5f3fc;
  border-radius: 10px;
}
.new-profile-mapping-heading,
.new-profile-mapping-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.new-profile-mapping-heading { margin-bottom: 12px; }
.new-profile-mapping-actions {
  justify-content: flex-start;
  margin-top: 12px;
}
.new-profile-total-hint {
  display: block;
  margin-top: 5px;
  color: #0e7490;
  font-weight: 700;
}
.compact-profile-message { margin: 4px 0 12px; }
.profile-weight-total {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.profile-weight-total > strong {
  white-space: nowrap;
}
.profile-weight-list li strong {
  color: #7c3aed;
  white-space: nowrap;
}
.results-profile-stack {
  display: grid;
  gap: 14px;
}
.results-profile-details {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.results-profile-details > summary {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(360px, 2fr) 110px;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  cursor: pointer;
  list-style: none;
}
.results-profile-details > summary::-webkit-details-marker { display: none; }
.results-profile-details[open] > summary {
  background: #eef6f8;
  border-bottom: 1px solid var(--line);
}
.results-profile-details > summary > div:first-child strong,
.results-profile-details > summary > div:first-child small { display: block; }
.results-profile-details > summary > div:first-child strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 16px;
}
.results-profile-details > summary > div:first-child small {
  margin-top: 2px;
  color: var(--muted);
}
.results-profile-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: var(--muted);
  font-size: 12px;
}
.results-profile-metrics span {
  padding: 3px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.results-profile-details[open] > summary > .details-toggle::after { content: " ▲"; }
.results-profile-details:not([open]) > summary > .details-toggle::after { content: " ▼"; }
.results-profile-details > .table-wrap { margin: 0; }
.weighted-result-table > tbody > tr > td:nth-child(4) > strong {
  color: #2563eb;
  font-size: 18px;
}
.weighted-result-table > tbody > tr > td:nth-child(5) > strong {
  color: #15803d;
  font-size: 18px;
}
.result-person-details {
  min-width: 150px;
}
.result-person-details[open] {
  min-width: 760px;
}
.result-person-details > .table-wrap {
  margin-top: 10px;
  background: #fff;
}
.weighted-total-formula {
  display: block;
  max-width: 250px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.45;
}
.result-kpi-toggle {
  padding: 6px 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
}
.result-kpi-toggle:hover,
.result-kpi-toggle:focus { color: var(--primary-dark); text-decoration: underline; }
.result-kpi-detail-row > td {
  padding: 0 !important;
  background: #f8fafc;
  border-bottom: 2px solid #b8dbe7;
}
.result-kpi-detail-panel {
  width: 100%;
  padding: 16px 18px 20px;
}
.result-kpi-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}
.result-kpi-detail-heading strong,
.result-kpi-detail-heading small { display: block; }
.result-kpi-detail-heading strong { color: var(--primary-dark); font-size: 16px; }
.result-kpi-detail-heading small { margin-top: 3px; color: var(--muted); }
.result-kpi-detail-heading > span {
  flex: 0 0 auto;
  padding: 5px 10px;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  font-weight: 800;
}
.result-kpi-detail-panel > .table-wrap { margin: 0; }
.weighted-kpi-detail-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
  background: #fff;
  border: 1px solid var(--line);
}
.weighted-kpi-name-column { width: 34%; }
.weighted-kpi-weight-column { width: 9%; }
.weighted-kpi-score-column { width: 12%; }
.weighted-kpi-formula-column { width: 16.5%; }
.weighted-formula-cell strong {
  display: block;
  color: var(--primary-dark);
  font-size: 17px;
}
.weighted-formula-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.individual-weight-formulas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.weight-formula-box {
  padding: 15px 17px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 4px solid #2563eb;
  border-radius: 10px;
}
.weight-formula-assessor { border-left-color: #15803d; }
.weight-formula-box > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.weight-equation {
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
}
.weight-equation strong { color: var(--primary-dark); }
.weight-formula-assessor .weight-equation strong { color: #166534; }
.weight-formula-box small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.selection-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.kpi-weight-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  color: #7c3aed;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.profile-type-stack {
  display: grid;
  gap: 18px;
}
.profile-type-block {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.profile-kpi-group > summary {
  cursor: pointer;
  list-style: none;
}
.profile-kpi-group > summary::-webkit-details-marker { display: none; }
.profile-kpi-group > summary::after {
  content: "▼";
  color: currentColor;
  font-size: 12px;
}
.profile-kpi-group[open] > summary::after { content: "▲"; }
.profile-type-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  color: #155e75;
  background: #ecfeff;
  border-bottom: 1px solid #a5f3fc;
}
.profile-type-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.profile-type-heading > span {
  color: #0e7490;
  font-size: 12px;
  font-weight: 700;
}
.profile-type-heading-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
}
.profile-type-heading-actions > span {
  color: #0e7490;
  font-size: 12px;
  font-weight: 700;
}
.profile-type-heading-actions .assessor-kpi-completion-status.status-done {
  color: #166534;
  background: #dcfce7;
}
.profile-type-heading-actions .assessor-kpi-completion-status.status-wait {
  color: #92400e;
  background: #fef3c7;
}
.profile-type-heading-actions .checkbox-row {
  margin: 0;
  padding: 5px 9px;
  color: #155e75;
  background: rgba(255, 255, 255, .72);
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
}
.profile-type-code {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #fff;
  background: #0891b2;
  border-radius: 8px;
  font-weight: 800;
}
.profile-type-t .profile-type-heading {
  color: #1e40af;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.profile-type-t .profile-type-heading > span { color: #1d4ed8; }
.profile-type-t .profile-type-heading-actions > span,
.profile-type-t .profile-type-heading-actions .checkbox-row { color: #1d4ed8; }
.profile-type-t .profile-type-code { background: #2563eb; }
.profile-type-c .profile-type-heading {
  color: #6d28d9;
  background: #f5f3ff;
  border-color: #ddd6fe;
}
.profile-type-c .profile-type-heading > span,
.profile-type-c .profile-type-heading-actions > span,
.profile-type-c .profile-type-heading-actions .checkbox-row { color: #6d28d9; }
.profile-type-c .profile-type-code { background: #7c3aed; }
.profile-type-block > .checkbox-card-grid { padding: 14px; }
.profile-kpi-table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.profile-kpi-mapping-table {
  min-width: 980px;
  table-layout: fixed;
}
.profile-kpi-mapping-table th,
.profile-kpi-mapping-table td {
  vertical-align: middle;
}
.profile-kpi-mapping-table th:nth-child(1) { width: 64px; }
.profile-kpi-mapping-table th:nth-child(2) { width: 110px; }
.profile-kpi-mapping-table th:nth-child(4) { width: 150px; }
.profile-kpi-mapping-table th:nth-child(5) { width: 135px; }
.profile-kpi-mapping-table th:nth-child(6) { width: 155px; }
.profile-kpi-select-column { text-align: center; }
.profile-kpi-select-column input {
  width: 18px;
  height: 18px;
}
.profile-kpi-code-cell { white-space: nowrap; }
.profile-kpi-name-cell {
  color: #334155;
  line-height: 1.55;
}
.profile-kpi-table-row { transition: background-color .15s ease; }
.profile-kpi-table-row:hover { background: #f8fafc; }
.profile-kpi-table-row.is-selected { background: #f0fdf4; }
.profile-kpi-table-row.is-selected:hover { background: #dcfce7; }
.profile-kpi-setting-input {
  min-width: 96px;
  width: 100%;
}
.profile-kpi-setting-input:disabled {
  color: #94a3b8;
  background: #f1f5f9;
  cursor: not-allowed;
}
.profile-kpi-pair-status { white-space: nowrap; }
.profile-type-toolbar {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.profile-type-block > .table-wrap { margin: 0; }
.table-type-row td {
  padding: 9px 12px;
  color: #155e75;
  background: #ecfeff;
  border-top: 1px solid #a5f3fc;
  border-bottom: 1px solid #a5f3fc;
}
.table-type-row td > span {
  float: right;
  color: #0e7490;
  font-size: 12px;
  font-weight: 700;
}
.table-type-t td {
  color: #1e40af;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.table-type-t td > span { color: #1d4ed8; }
.kpi-category-stack {
  display: grid;
  gap: 14px;
}
.kpi-category-block {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.kpi-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 13px 16px;
  background: #f8fafc;
  cursor: pointer;
  list-style: none;
}
.kpi-category-heading::-webkit-details-marker { display: none; }
.kpi-category-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.kpi-category-heading::after {
  content: "▼";
  color: var(--primary);
  font-size: 12px;
}
.kpi-category-block[open] > .kpi-category-heading {
  border-bottom: 1px solid var(--line);
}
.kpi-category-block[open] > .kpi-category-heading::after { content: "▲"; }
.kpi-category-code {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: #0891b2;
  border-radius: 8px;
  font-weight: 800;
}
.kpi-category-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}
.kpi-category-toggle {
  color: var(--primary);
  font-weight: 700;
}
.kpi-category-block > .table-wrap { margin: 0; }
.kpi-category-block table { margin: 0; }
.kpi-category-u .kpi-category-heading { background: #ecfeff; }
.kpi-category-t .kpi-category-heading { background: #eff6ff; }
.kpi-category-t .kpi-category-code { background: #2563eb; }
.kpi-category-c .kpi-category-heading { background: #f5f3ff; }
.kpi-category-c .kpi-category-code { background: #7c3aed; }
.sequence-cell {
  width: 64px;
  color: var(--muted);
  text-align: center;
}
.scope-management-stack {
  display: grid;
  gap: 18px;
}
.dashboard-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.dashboard-section-heading h2 { margin: 3px 0 5px; }
.dashboard-section-heading p { margin: 0; color: var(--muted); }
.admin-profile-progress-list { display: grid; }
.admin-profile-progress-details {
  border-bottom: 1px solid var(--line);
}
.admin-profile-progress-details:last-child { border-bottom: 0; }
.admin-profile-progress-details > summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto 110px;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #f8fafc;
  cursor: pointer;
  list-style: none;
}
.admin-profile-progress-details > summary::-webkit-details-marker { display: none; }
.admin-profile-progress-details[open] > summary {
  background: #eef6f8;
  border-bottom: 1px solid var(--line);
}
.admin-profile-progress-details > summary > div strong,
.admin-profile-progress-details > summary > div small { display: block; }
.admin-profile-progress-details > summary > div strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 16px;
}
.admin-profile-progress-details > summary > div small {
  margin-top: 2px;
  color: var(--muted);
}
.admin-profile-progress-details > summary > span:not(.details-toggle) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.admin-profile-progress-details[open] > summary > .details-toggle::after { content: " ▲"; }
.admin-profile-progress-details:not([open]) > summary > .details-toggle::after { content: " ▼"; }
.admin-profile-progress-details > .person-progress-list {
  padding-left: 18px;
  background: #f8fafc;
  border-left: 4px solid #a5f3fc;
}
.person-progress-list { display: grid; }
.person-progress-details {
  border-bottom: 1px solid var(--line);
}
.person-progress-details:last-child { border-bottom: 0; }
.person-progress-details > summary {
  display: grid;
  grid-template-columns:
    minmax(190px, 1.8fr)
    repeat(3, minmax(96px, .72fr))
    minmax(105px, .72fr)
    76px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}
.person-progress-details > summary::-webkit-details-marker { display: none; }
.person-progress-details > summary:hover { background: #f8fafc; }
.person-progress-details[open] > summary {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.person-progress-name strong,
.person-progress-name span,
.person-progress-metric strong,
.person-progress-metric span { display: block; }
.person-progress-name span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.person-progress-metric strong {
  color: var(--ink);
  font-size: 16px;
}
.person-progress-metric span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}
.details-toggle {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.person-progress-details[open] .details-toggle::after { content: " ▲"; }
.person-progress-details:not([open]) .details-toggle::after { content: " ▼"; }
.person-progress-content { padding: 0 14px 14px; background: #f8fafc; }
.person-progress-content .table-wrap { background: #fff; }
.table-subtext {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .results-profile-details > summary {
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.5fr) auto;
  }
  .admin-profile-progress-details > summary {
    grid-template-columns: minmax(220px, 1fr) auto auto;
  }
  .person-progress-details > summary {
    grid-template-columns: minmax(180px, 1.5fr) repeat(2, minmax(100px, 1fr));
  }
  .person-progress-details > summary .status,
  .person-progress-details > summary .details-toggle { justify-self: start; }
}

@media (max-width: 900px) {
  .header-inner {
    min-height: 70px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }
  .menu-toggle { display: block; }
  .brand { min-width: 0; }
  .brand-logo {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 10px;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }
  .brand strong { white-space: nowrap; }
  .brand small {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .main-nav {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100vh - 90px);
    padding: 10px;
    overflow-y: auto;
    background: #0f263b;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 18px 35px rgba(15, 23, 42, .3);
  }
  .site-header.menu-open .main-nav { display: grid; }
  .main-nav a {
    display: block;
    padding: 11px 13px;
    border-radius: 8px;
  }
  .main-nav a:hover,
  .main-nav a:focus { background: rgba(255, 255, 255, .1); text-decoration: none; }
}
.inline-details summary {
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
}
.inline-details p { margin: 8px 0 0; color: var(--muted); }
.compact-list { min-width: 280px; margin: 8px 0 0; padding-left: 18px; }
.compact-list li { margin-bottom: 5px; }
.muted-line {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.field-grow { flex: 1 1 260px; }
.prefix-bulk-toolbar {
  position: sticky;
  top: 88px;
  z-index: 20;
  flex-wrap: wrap;
  margin-bottom: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
}
.prefix-assignment-table th:first-child,
.prefix-assignment-table td:first-child { width: 62px; text-align: center; }
.prefix-assignment-table select { min-width: 220px; }
.prefix-assignment-table tbody tr:has(.prefix-user-checkbox:checked) { background: #f0fdf4; }
.prefix-assignment-table tbody tr.is-selected { background: #f0fdf4; }
.prefix-user-group-row td {
  padding: 11px 14px;
  text-align: left !important;
  background: #eaf4f8;
  border-top: 2px solid #b8dbe7;
}
.prefix-user-group-heading,
.prefix-user-group-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.prefix-user-group-actions { flex-wrap: wrap; }
.prefix-user-group-heading strong,
.prefix-user-group-heading small { display: block; }
.prefix-user-group-heading strong { color: var(--primary-dark); font-size: 16px; }
.prefix-user-group-heading small { color: var(--muted); font-size: 11px; }
.prefix-user-group-actions > span { color: var(--primary); font-weight: 800; }
.prefix-user-group-actions .checkbox-row {
  margin: 0;
  padding: 5px 9px;
  background: #fff;
  border: 1px solid #cbddeb;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .container { width: min(100% - 20px, 1240px); }
  .page-shell { padding: 20px 0 38px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 18px; }
  .page-heading h1 { font-size: 26px; }
  .page-heading .actions,
  .page-heading .button { width: 100%; }
  .card { padding: 18px; border-radius: 12px; }
  .user-context-card { align-items: stretch; flex-direction: column; gap: 16px; padding: 20px; }
  .user-context-status { min-width: 0; text-align: left; }
  .user-context-meta { display: grid; grid-template-columns: 1fr 1fr; }
  .user-context-meta span:first-child { grid-column: 1 / -1; }
  .assignment-hero { padding: 0; }
  .assignment-hero-heading { padding: 20px; }
  .assignment-kpi-title { font-size: 24px; }
  .assignment-weight { width: 100%; justify-content: space-between; }
  .assignment-people-grid { grid-template-columns: 1fr; padding: 16px 20px 0; }
  .assignment-hero .kpi-detail { margin: 16px 20px 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-summary-3 { grid-template-columns: 1fr; }
  .choice { grid-template-columns: 30px 1fr; }
  .choice-score { text-align: left; grid-column: 2; }
  .current-context,
  .preview-toolbar { align-items: flex-start; flex-direction: column; }
  .workflow-guide { display: grid; grid-template-columns: 1fr; }
  .workflow-arrow { display: none; }
  .admin-form-grid,
  .scope-explainer { grid-template-columns: 1fr; }
  .quick-nav { flex-direction: column; }
  .quick-nav a { width: 100%; }
  .preview-toolbar .inline-form {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .preview-toolbar .inline-form .field { width: 100%; min-width: 0; }
  .preview-actions { flex-direction: column; }
  .preview-actions .button { width: 100%; }
  .assessor-profile-form-actions { align-items: stretch; flex-direction: column; }
  .assessor-profile-form-actions .button { width: 100%; min-width: 0; }
  .pagination-summary { width: 100%; margin-left: 0; }
  .details-panel summary { align-items: flex-start; }
  .details-panel summary small { display: none; }
  .weight-editor,
  .checkbox-card-grid { grid-template-columns: 1fr; }
  .bulk-toolbar,
  .selection-toolbar,
  .sticky-save-bar,
  .assessor-kpi-save-all,
  .bulk-copy-controls,
  .bulk-select-groups,
  .profile-type-heading-actions { align-items: stretch; flex-direction: column; }
  .bulk-copy-controls input,
  .bulk-copy-controls select { width: 100%; }
  .sticky-save-bar .actions,
  .sticky-save-bar .button,
  .assessor-kpi-save-all .button { width: 100%; }
  .option-editor-head { display: none; }
  .option-editor { min-width: 0; }
  .option-editor-row { grid-template-columns: 44px 1fr; }
  .option-editor-row input { grid-column: 2; }
  .option-editor-row .remove-option-row { grid-column: 2; }
  .option-card-heading,
  .option-heading-actions { align-items: stretch; flex-direction: column; }
  .profile-type-heading { align-items: flex-start; flex-direction: column; }
  .kpi-category-heading { align-items: flex-start; }
  .kpi-category-meta {
    width: 100%;
    margin-left: 40px;
    justify-content: space-between;
  }
  .kpi-category-toggle { display: none; }
  .table-type-row td > span { float: none; display: block; margin-top: 3px; }
  .person-progress-details > summary { grid-template-columns: 1fr 1fr; }
  .results-profile-details > summary { grid-template-columns: 1fr; }
  .results-profile-details > summary .details-toggle { text-align: left; }
  .result-kpi-detail-heading { flex-direction: column; }
  .individual-weight-formulas { grid-template-columns: 1fr; }
  .admin-profile-progress-details > summary { grid-template-columns: 1fr auto; }
  .admin-profile-progress-details > summary > div { grid-column: 1 / -1; }
  .admin-profile-progress-details > .person-progress-list { padding-left: 0; }
  .person-progress-name { grid-column: 1 / -1; }
  .person-progress-details > summary .status,
  .person-progress-details > summary .details-toggle { justify-self: start; }
  .table-wrap {
    margin-right: -8px;
    margin-left: -8px;
    padding: 0 8px 6px;
    -webkit-overflow-scrolling: touch;
  }
  th, td { padding: 10px 8px; }
  .assessment-item-cell { min-width: 260px; }
  .login-shell { margin: 2vh auto; }
  .login-shell .card { padding: 24px 20px; }
  .login-branding {
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 20px;
  }
  .login-logo {
    width: 88px;
    height: 82px;
    flex-basis: 88px;
  }
  .login-branding strong { font-size: 18px; }
}

@media (min-width: 761px) and (max-width: 1050px) {
  .admin-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-arrow { display: none; }
}

/* Modern glass theme: Light is the default, Dark is stored per browser. */
:root {
  color-scheme: light;
  --ink: #12233a;
  --muted: #60738a;
  --line: rgba(100, 130, 160, .24);
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-soft: rgba(244, 249, 253, .82);
  --canvas: #eef7fc;
  --glass-shadow: 0 20px 55px rgba(20, 60, 90, .10);
  --glass-border: rgba(255, 255, 255, .72);
  --header-surface: rgba(248, 252, 255, .82);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8f3ff;
  --muted: #9db0c5;
  --line: rgba(148, 190, 220, .20);
  --surface: rgba(11, 25, 43, .76);
  --surface-solid: #0d1b2c;
  --surface-soft: rgba(18, 39, 62, .72);
  --canvas: #07111f;
  --primary: #0e91ad;
  --primary-dark: #08748d;
  --accent: #f7b731;
  --glass-shadow: 0 24px 65px rgba(0, 0, 0, .30);
  --glass-border: rgba(157, 208, 239, .16);
  --header-surface: rgba(7, 18, 32, .82);
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(34, 211, 238, .13), transparent 31%),
    radial-gradient(circle at 92% 82%, rgba(59, 130, 246, .12), transparent 30%),
    var(--canvas);
  transition: color .3s ease, background-color .3s ease;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  pointer-events: none;
}

body::before {
  inset: 0;
  opacity: .35;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .65), transparent 78%);
}

body::after {
  width: 54vw;
  height: 18rem;
  left: -60vw;
  top: 14vh;
  opacity: .22;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, #06b6d4, #3b82f6, transparent);
  filter: blur(70px);
  animation: facultyind-color-stream 18s linear infinite;
}

.site-header {
  color: var(--ink);
  background: var(--header-surface);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 12px 35px rgba(15, 55, 80, .08);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}
.site-header .container {
  width: min(1480px, calc(100% - 32px));
}

.brand { color: var(--ink); }
.brand small { color: var(--muted); }
.brand-college-th { color: var(--ink); }
.brand-college-en,
.brand-product-en { color: var(--muted); }
.brand-logo {
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(20, 100, 135, .12);
}
.brand-logo {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.brand-mark {
  color: #10233b;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 10px 28px rgba(245, 158, 11, .24);
}

.header-controls {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.main-nav {
  flex-wrap: nowrap;
  gap: 5px;
  white-space: nowrap;
}
.main-nav a {
  padding: 8px 11px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.main-nav a:hover,
.main-nav a:focus {
  color: var(--primary);
  background: rgba(8, 145, 173, .09);
  text-decoration: none;
  transform: translateY(-1px);
}
.main-nav a.is-active {
  color: #fff;
  background: linear-gradient(105deg, #0891b2, #2563eb);
  border-color: rgba(255, 255, 255, .25);
  box-shadow: 0 9px 24px rgba(37, 99, 235, .20);
}
.main-nav .logout-link {
  margin-left: 5px;
  padding-right: 14px;
  padding-left: 14px;
  color: #fff;
  background: linear-gradient(105deg, #dc2626, #b91c1c);
  border-color: rgba(255, 255, 255, .24);
  box-shadow: 0 9px 24px rgba(185, 28, 28, .22);
}
.main-nav .logout-link:hover,
.main-nav .logout-link:focus {
  color: #fff;
  background: linear-gradient(105deg, #ef4444, #dc2626);
  box-shadow: 0 12px 28px rgba(185, 28, 28, .30);
}

.theme-switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(20, 65, 90, .08);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.theme-switch-track {
  position: relative;
  width: 50px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  color: #f59e0b;
  background: rgba(148, 163, 184, .18);
  border-radius: 999px;
  font-size: 12px;
}
.theme-switch-moon { color: #64748b; }
.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(15, 23, 42, .22);
  transition: transform .25s ease;
}
:root[data-theme="dark"] .theme-switch-thumb { transform: translateX(24px); }

.menu-toggle {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.card,
.user-context-card,
.assignment-person-card,
.quick-nav,
.workflow-step,
.form-card,
.scope-explainer > div,
.details-panel,
.selection-card,
.profile-type-section,
.results-profile-details,
.person-progress-details,
.admin-profile-progress-details {
  background: var(--surface);
  border-color: var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.user-context-card {
  background: linear-gradient(135deg, var(--surface), rgba(224, 247, 255, .60));
}
.metric,
.summary-grid > div,
.kpi-detail,
.form-card-muted,
.dialog-details > div,
.weight-row,
.option-editor-row,
.details-content tbody tr:nth-child(even) {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
}
.site-footer {
  color: var(--muted);
  background: var(--header-surface);
  border-top: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .30);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #0891b2;
  box-shadow: 0 0 0 4px rgba(8, 145, 178, .13);
}
input::placeholder,
textarea::placeholder { color: var(--muted); opacity: .72; }

th {
  color: var(--ink);
  background: var(--surface-soft);
}
th, td { border-color: var(--line); }

.button {
  border-radius: 10px;
  box-shadow: 0 9px 22px rgba(8, 116, 141, .14);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(8, 116, 141, .20);
}

:root[data-theme="dark"] .user-context-card,
:root[data-theme="dark"] .assignment-hero-heading {
  background: linear-gradient(135deg, rgba(15, 35, 56, .86), rgba(9, 55, 70, .68));
}
:root[data-theme="dark"] .user-context-main h1,
:root[data-theme="dark"] .user-context-meta strong,
:root[data-theme="dark"] .assignment-person-card strong,
:root[data-theme="dark"] .assignment-person-profile,
:root[data-theme="dark"] .table-profile-name,
:root[data-theme="dark"] .kpi-name-text,
:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4 { color: var(--ink); }
:root[data-theme="dark"] .user-context-meta span,
:root[data-theme="dark"] .user-context-status,
:root[data-theme="dark"] .assessor-kpi-panel,
:root[data-theme="dark"] .selection-toolbar,
:root[data-theme="dark"] .kpi-dialog,
:root[data-theme="dark"] .dialog-content {
  color: var(--ink);
  background: var(--surface-solid);
  border-color: var(--line);
}
:root[data-theme="dark"] .assessor-kpi-panel-row > td { background: var(--surface-soft); }
:root[data-theme="dark"] .details-content tbody tr:hover,
:root[data-theme="dark"] .profile-kpi-table-row:hover,
:root[data-theme="dark"] .choice:hover {
  background: rgba(8, 145, 178, .12);
}
:root[data-theme="dark"] .button-secondary {
  color: var(--ink);
  background: rgba(148, 163, 184, .18);
}

/* Login: reference-inspired glass layout without registration or sidebar. */
.login-page .page-shell {
  min-height: calc(100vh - 136px);
  display: grid;
  place-items: center;
  padding-top: 42px;
  padding-bottom: 42px;
}
.login-shell {
  width: min(1040px, 100%);
  max-width: none;
  margin: 0 auto;
}
.login-glass-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: 0 35px 90px rgba(16, 69, 100, .18);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
}
.login-visual-panel,
.login-form-panel { min-width: 0; padding: clamp(34px, 5vw, 64px); }
.login-visual-panel {
  position: relative;
  overflow: hidden;
  color: #eefcff;
  background:
    linear-gradient(145deg, rgba(8, 47, 73, .94), rgba(8, 145, 178, .82)),
    linear-gradient(45deg, #0f172a, #155e75);
}
.login-visual-panel::before,
.login-visual-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
}
.login-visual-panel::before {
  width: 340px;
  height: 340px;
  right: -170px;
  bottom: -165px;
  border: 1px solid rgba(165, 243, 252, .40);
  box-shadow: 0 0 80px rgba(34, 211, 238, .18);
}
.login-visual-panel::after {
  width: 240px;
  height: 240px;
  left: -120px;
  top: -125px;
  background: rgba(59, 130, 246, .30);
  filter: blur(48px);
}
.login-visual-panel > * { position: relative; z-index: 1; }
.login-visual-logo-wrap { display: flex; align-items: center; gap: 14px; }
.login-visual-logo {
  width: 104px;
  height: 96px;
  object-fit: contain;
  padding: 5px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
}
.login-visual-logo {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.login-visual-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #10233b;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(245, 158, 11, .30);
  font-weight: 900;
}
.login-college-name {
  margin-top: 22px;
  color: #f4fdff;
}
.login-college-name strong,
.login-college-name small { display: block; }
.login-college-name strong {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.45;
}
.login-college-name small {
  margin-top: 4px;
  color: #bce8f1;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .035em;
  line-height: 1.4;
}
.login-eyebrow {
  margin: 24px 0 10px;
  color: #a5f3fc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
}
.login-product-name {
  margin: 15px 0 0;
  color: #a5f3fc;
}
.login-visual-panel h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(36px, 4.5vw, 58px);
  line-height: 1.13;
  letter-spacing: -.025em;
}
.login-intro {
  max-width: 520px;
  margin: 20px 0 0;
  color: #c9eaf3;
  font-size: 16px;
  line-height: 1.8;
}
.login-feature-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.login-feature-list span {
  padding: 7px 11px;
  color: #e9fcff;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(165, 243, 252, .22);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.login-form-panel { display: flex; flex-direction: column; justify-content: center; }
.login-eyebrow-accent { margin: 0 0 9px; color: var(--primary); }
.login-form-panel h2 { margin: 0; font-size: 34px; }
.login-form-subtitle { margin: 8px 0 28px; color: var(--muted); }
.login-form .field { margin-bottom: 19px; }
.login-form .field label { color: var(--ink); font-size: 13px; }
.login-form input {
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 12px;
}
.password-field { position: relative; }
.password-field input { padding-right: 68px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 7px 9px;
  color: var(--primary);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}
.password-toggle:hover { background: rgba(8, 145, 178, .10); }
.login-submit {
  width: 100%;
  min-height: 51px;
  margin-top: 4px;
  background: linear-gradient(100deg, #0891b2, #2563eb);
  border-radius: 12px;
  font-size: 16px;
}
.login-help { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

@keyframes facultyind-color-stream {
  from { left: -60vw; transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(-4deg) translateY(10vh); }
  to { left: 112vw; transform: rotate(-8deg) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}

@media (max-width: 1050px) {
  .main-nav a { padding-right: 8px; padding-left: 8px; font-size: 13px; }
  .theme-switch-word { display: none; }
}

@media (min-width: 901px) and (max-width: 1240px) {
  .site-header .container { width: calc(100% - 20px); }
  .brand-logo { width: 46px; height: 46px; flex-basis: 46px; }
  .brand-college-th { font-size: 9px; }
  .brand-college-en { font-size: 7px; }
  .brand-system-name { font-size: 13px; }
  .brand-product-en { font-size: 8px; }
  .main-nav a { padding-right: 6px; padding-left: 6px; font-size: 12px; }
  .main-nav .logout-link { padding-right: 10px; padding-left: 10px; }
}

@media (max-width: 900px) {
  .header-inner { grid-template-columns: auto minmax(0, 1fr) auto; }
  .header-controls { grid-column: 3; }
  .main-nav {
    flex-wrap: wrap;
    white-space: normal;
    color: #e8f3ff;
    background: rgba(7, 18, 32, .96);
    border-color: rgba(165, 243, 252, .14);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }
  .main-nav a { color: #cde6f4; }
  .main-nav a.is-active { color: #fff; }
  .main-nav .logout-link {
    margin: 5px 0 0;
    text-align: center;
  }
  .theme-switch { padding: 5px; }
  .login-glass-card { grid-template-columns: 1fr; }
  .login-visual-panel,
  .login-form-panel { padding: 34px; }
  .login-visual-panel h1 { font-size: clamp(34px, 8vw, 50px); }
}

@media (max-width: 620px) {
  .header-inner { gap: 8px; }
  .brand { gap: 7px; }
  .brand-logo { width: 38px; height: 38px; flex-basis: 38px; }
  .brand strong { font-size: 12px; }
  .brand small { max-width: 165px; }
  .brand-college-th { font-size: 8px; }
  .brand-college-en {
    max-width: 165px;
    overflow: hidden;
    font-size: 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand-system-name { font-size: 12px; }
  .brand-product-en { font-size: 7px; }
  .theme-switch-track { width: 44px; height: 24px; }
  .theme-switch-thumb { width: 18px; height: 18px; }
  :root[data-theme="dark"] .theme-switch-thumb { transform: translateX(20px); }
  .login-page .page-shell { padding-top: 22px; padding-bottom: 28px; }
  .login-glass-card { border-radius: 20px; }
  .login-visual-panel,
  .login-form-panel { padding: 27px 22px; }
  .login-visual-logo { width: 82px; height: 76px; border-radius: 0; }
  .login-visual-mark { width: 46px; height: 46px; border-radius: 14px; }
  .login-college-name strong { font-size: 18px; }
  .login-college-name small { font-size: 11px; }
  .login-eyebrow { margin-top: 23px; }
  .login-visual-panel h1 { font-size: 34px; }
  .login-intro { font-size: 14px; }
  .login-intro { overflow-wrap: anywhere; }
  .login-feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .login-feature-list span { text-align: center; }
  .login-form-panel h2 { font-size: 29px; }
}

@media (max-width: 420px) {
  .brand .brand-college-en { display: none; }
  .brand-college-th {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand-system-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .menu-toggle { width: 40px; height: 40px; flex-basis: 40px; padding: 8px; }
}
