:root {
  --ws-primary: #078b9a;
  --ws-primary-dark: #056c78;
  --ws-primary-soft: #e9f7f8;
  --ws-ink: #182534;
  --ws-muted: #667386;
  --ws-line: #dfe6ec;
  --ws-surface: #ffffff;
  --ws-soft: #f7f9fb;
  --ws-green: #20945b;
  --ws-green-soft: #eaf7ef;
  --ws-orange: #dc7c18;
  --ws-orange-soft: #fff4e7;
  --ws-red: #d94848;
  --ws-shadow: 0 8px 24px rgba(27, 52, 66, .06);
}

.student-progress-lookup {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, .75fr) minmax(360px, 1.25fr);
  align-items: center;
  gap: 22px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid var(--ws-line);
  border-radius: 12px;
  background: var(--ws-surface);
  box-shadow: var(--ws-shadow);
}

.student-progress-copy { display: flex; align-items: center; gap: 12px; }
.student-progress-copy h2 { margin: 0 0 3px; color: var(--ws-ink); font-size: 15px; line-height: 1.3; }
.student-progress-copy p { margin: 0; color: var(--ws-muted); font-size: 12px; }
.student-progress-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; background: var(--ws-primary-soft); color: var(--ws-primary); }
.student-progress-icon svg { width: 20px; height: 20px; }
.student-progress-control { position: relative; }
.student-progress-control > label { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 12px; border: 1px solid #cdd7df; border-radius: 9px; background: #fff; color: #8491a1; }
.student-progress-control > label:focus-within { border-color: var(--ws-primary); box-shadow: 0 0 0 3px rgba(7, 139, 154, .12); }
.student-progress-control input { width: 100%; border: 0; outline: 0; color: var(--ws-ink); font: 500 13px/1.4 inherit; background: transparent; }
.student-progress-control svg { width: 17px; height: 17px; }
.student-progress-results { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; right: 0; overflow: hidden; border: 1px solid var(--ws-line); border-radius: 11px; background: #fff; box-shadow: 0 16px 40px rgba(25, 48, 61, .16); }
.student-progress-result { width: 100%; display: grid; grid-template-columns: minmax(120px, 1fr) minmax(110px, .9fr) 72px; gap: 14px; align-items: center; padding: 12px 14px; border: 0; border-bottom: 1px solid #edf1f4; background: #fff; text-align: left; cursor: pointer; }
.student-progress-result:last-child { border-bottom: 0; }
.student-progress-result:hover, .student-progress-result:focus-visible { background: #f2fafb; outline: 0; }
.student-progress-result strong { display: block; color: var(--ws-ink); font-size: 13px; }
.student-progress-result small { color: var(--ws-muted); font-size: 11px; }
.student-progress-result .mini-progress { display: flex; align-items: center; gap: 8px; color: var(--ws-primary-dark); font-size: 11px; }
.student-progress-result .mini-progress i { display: block; width: 70px; height: 5px; overflow: hidden; border-radius: 999px; background: #e8edf1; }
.student-progress-result .mini-progress b { display: block; height: 100%; border-radius: inherit; background: var(--ws-primary); }
.student-progress-empty { padding: 18px; color: var(--ws-muted); text-align: center; font-size: 12px; }

.student-detail-page { max-width: none; }
.student-workspace { color: var(--ws-ink); }
.student-workspace button, .student-workspace input, .student-workspace select, .student-workspace textarea { font-family: inherit; }
.student-back { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; margin-bottom: 12px; padding: 0; border: 0; background: none; color: var(--ws-primary-dark); font-weight: 700; font-size: 12px; cursor: pointer; }
.student-back svg { width: 16px; height: 16px; }

.student-identity { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--ws-line); }
.student-identity-avatar { display: grid; place-items: center; width: 64px; height: 64px; flex: 0 0 64px; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, #e6f6f7, #c9eaed); color: var(--ws-primary-dark); font-size: 23px; font-weight: 800; }
.student-identity-avatar img { width: 100%; height: 100%; object-fit: cover; }
.student-identity-main { min-width: 0; flex: 1; }
.student-identity-title { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.student-identity-title h1 { margin: 0; color: var(--ws-ink); font-size: 24px; line-height: 1.2; }
.student-identity-main p { margin: 7px 0 0; color: var(--ws-muted); font-size: 13px; }
.student-status { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 6px; background: var(--ws-green-soft); color: var(--ws-green); font-size: 11px; font-weight: 800; }
.student-identity-actions { display: flex; gap: 10px; }

.ws-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 16px; border: 1px solid #cfd8df; border-radius: 8px; background: #fff; color: #354255; font-size: 12px; font-weight: 750; cursor: pointer; transition: .18s ease; }
.ws-button:hover { border-color: var(--ws-primary); color: var(--ws-primary-dark); }
.ws-button svg { width: 16px; height: 16px; }
.ws-button.primary { border-color: var(--ws-primary); background: var(--ws-primary); color: #fff; box-shadow: 0 6px 14px rgba(7, 139, 154, .18); }
.ws-button.primary:hover { border-color: var(--ws-primary-dark); background: var(--ws-primary-dark); color: #fff; }
.ws-button.danger { border-color: #f1b4b4; color: var(--ws-red); }
.ws-button.ghost { border-color: transparent; background: transparent; color: var(--ws-primary-dark); }
.ws-button.small { min-height: 32px; padding: 0 11px; font-size: 11px; }
.ws-button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }

.student-tabs { display: flex; gap: 26px; margin: 0; border-bottom: 1px solid var(--ws-line); }
.student-tab { position: relative; min-height: 48px; padding: 0 2px; border: 0; background: transparent; color: #586679; font-size: 13px; font-weight: 750; cursor: pointer; }
.student-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; }
.student-tab.active { color: var(--ws-primary-dark); }
.student-tab.active::after { background: var(--ws-primary); }

.student-workflow { display: grid; grid-template-columns: repeat(6, minmax(108px, 1fr)); gap: 0; margin: 16px 0; padding: 15px 16px; border: 1px solid var(--ws-line); border-radius: 10px; background: #fff; }
.workflow-step { position: relative; display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: start; min-width: 0; }
.workflow-step:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: 37px; right: 7px; height: 1px; background: #ced7de; }
.workflow-step.done:not(:last-child)::after { background: #76c697; }
.workflow-number { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #c7d0d9; border-radius: 50%; background: #fff; color: #7b8797; font-size: 11px; font-weight: 800; }
.workflow-step.done .workflow-number { border-color: var(--ws-green); background: var(--ws-green-soft); color: var(--ws-green); }
.workflow-step.current .workflow-number { border-color: var(--ws-primary); background: var(--ws-primary-soft); color: var(--ws-primary-dark); }
.workflow-copy { position: relative; z-index: 2; min-width: 0; padding: 1px 6px 0 0; background: #fff; }
.workflow-copy strong { display: block; overflow: hidden; color: #354255; font-size: 11px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.workflow-copy small { display: block; margin-top: 3px; color: #8a96a5; font-size: 10px; }
.workflow-step.current .workflow-copy strong, .workflow-step.current .workflow-copy small { color: var(--ws-primary-dark); }

.student-content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .76fr); gap: 16px; align-items: start; }
.student-main-stack, .student-side-stack { display: grid; gap: 14px; }
.ws-panel { min-width: 0; border: 1px solid var(--ws-line); border-radius: 10px; background: #fff; box-shadow: 0 4px 16px rgba(25, 48, 61, .025); }
.ws-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 14px; border-bottom: 1px solid #e8edf1; }
.ws-panel-head h2 { margin: 0; color: var(--ws-ink); font-size: 14px; line-height: 1.3; }
.ws-panel-head p { margin: 3px 0 0; color: var(--ws-muted); font-size: 10px; }
.ws-panel-body { padding: 14px; }
.ws-panel-note { margin: 0; padding: 11px 14px; border-top: 1px solid #edf1f4; color: #7d8997; font-size: 10px; line-height: 1.6; }

.goal-table, .record-table, .picker-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.goal-table th, .goal-table td, .record-table th, .record-table td, .picker-table th, .picker-table td { padding: 10px 11px; border-bottom: 1px solid #e9eef2; text-align: left; vertical-align: middle; }
.goal-table th, .record-table th, .picker-table th { background: #f8fafb; color: #657285; font-size: 10px; font-weight: 750; }
.goal-table td, .record-table td, .picker-table td { color: #3f4c5e; font-size: 11px; line-height: 1.5; }
.goal-table tr:last-child td, .record-table tr:last-child td, .picker-table tr:last-child td { border-bottom: 0; }
.record-table tbody tr:hover, .picker-table tbody tr:hover { background: #f8fcfc; }
.picker-table tr.selected { background: #eef9fa; }
.table-primary { color: var(--ws-ink); font-weight: 750; }
.table-secondary { display: block; margin-top: 2px; color: #8490a0; font-size: 10px; }
.table-link { padding: 0; border: 0; background: none; color: var(--ws-primary-dark); font-size: 11px; font-weight: 750; cursor: pointer; }

.linear-progress { display: flex; align-items: center; gap: 9px; }
.linear-progress-track { width: 78px; height: 6px; overflow: hidden; border-radius: 99px; background: #e5ebef; }
.linear-progress-track b { display: block; height: 100%; border-radius: inherit; background: var(--ws-primary); }
.linear-progress span { color: var(--ws-primary-dark); font-size: 10px; font-weight: 750; }

.quick-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-action { min-height: 72px; padding: 12px; border: 1px solid var(--ws-primary); border-radius: 8px; background: #fff; color: var(--ws-primary-dark); cursor: pointer; text-align: left; }
.quick-action.primary { background: var(--ws-primary); color: #fff; }
.quick-action strong { display: block; margin-bottom: 5px; font-size: 13px; }
.quick-action small { display: block; color: inherit; opacity: .72; font-size: 9px; line-height: 1.5; }

.progress-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.progress-stat { padding: 11px; border: 1px solid #e4eaf0; border-radius: 8px; }
.progress-stat small { display: block; min-height: 28px; color: #6f7b8b; font-size: 9px; }
.progress-stat strong { display: block; margin: 2px 0 8px; color: var(--ws-ink); font-size: 21px; line-height: 1; }
.progress-stat em { font-style: normal; color: #8792a0; font-size: 9px; }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; padding: 0 0 15px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::after { content: ""; position: absolute; top: 14px; bottom: 0; left: 5px; width: 1px; background: #dfe6eb; }
.timeline li:last-child::after { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 2px; border: 2px solid var(--ws-green); border-radius: 50%; background: #fff; }
.timeline strong { display: block; color: #3b4859; font-size: 10px; }
.timeline small, .timeline time { color: #8591a0; font-size: 9px; }

.picker-toolbar { display: grid; grid-template-columns: minmax(200px, 1fr) auto; gap: 12px; padding: 14px; border-bottom: 1px solid #e8edf1; }
.picker-search { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 11px; border: 1px solid #ccd6df; border-radius: 8px; color: #8692a1; }
.picker-search input { width: 100%; border: 0; outline: 0; background: none; color: var(--ws-ink); font-size: 12px; }
.picker-search svg { width: 16px; height: 16px; }
.picker-filters { display: flex; gap: 4px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid #edf1f4; scrollbar-width: thin; }
.picker-filter { flex: 0 0 auto; min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: #677486; font-size: 10px; font-weight: 700; cursor: pointer; }
.picker-filter.active { background: var(--ws-primary-soft); color: var(--ws-primary-dark); }
.tool-check { width: 17px; height: 17px; accent-color: var(--ws-primary); cursor: pointer; }
.tool-kind { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 6px; background: #eef4f7; color: #526476; font-size: 9px; font-weight: 750; }

.selection-summary { display: grid; gap: 15px; }
.selection-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.selection-count { padding: 11px 0; border-bottom: 1px solid #e4e9ed; }
.selection-count small { display: block; color: #7a8797; font-size: 10px; }
.selection-count strong { display: block; margin-top: 8px; color: var(--ws-ink); font-size: 26px; }
.selection-count strong span { font-size: 11px; }
.selection-items { display: grid; gap: 7px; }
.selection-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #4d5b6c; font-size: 10px; }
.selection-item button { border: 0; background: none; color: var(--ws-red); cursor: pointer; }
.summary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.ws-form { display: grid; gap: 10px; }
.ws-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ws-field { display: grid; gap: 5px; }
.ws-field label { color: #566477; font-size: 10px; font-weight: 750; }
.ws-field input, .ws-field select, .ws-field textarea { width: 100%; box-sizing: border-box; min-height: 38px; padding: 8px 10px; border: 1px solid #ccd6df; border-radius: 7px; outline: 0; background: #fff; color: var(--ws-ink); font-size: 11px; line-height: 1.5; }
.ws-field textarea { min-height: 68px; resize: vertical; }
.ws-field input:focus, .ws-field select:focus, .ws-field textarea:focus { border-color: var(--ws-primary); box-shadow: 0 0 0 3px rgba(7, 139, 154, .1); }
.form-help { margin: 0; color: #7e8997; font-size: 9px; line-height: 1.5; }
.form-actions { display: flex; gap: 8px; }

.plan-selector { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--ws-line); border-radius: 9px; background: #fff; }
.plan-selector label { color: #536173; font-size: 11px; font-weight: 750; }
.plan-selector select { min-width: 260px; min-height: 34px; padding: 0 9px; border: 1px solid #ced8df; border-radius: 7px; background: #fff; color: var(--ws-ink); font-size: 11px; }
.plan-selector .ws-button { margin-left: auto; }

.ws-dialog { width: min(540px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 12px; box-shadow: 0 24px 80px rgba(17, 36, 48, .28); }
.ws-dialog::backdrop { background: rgba(15, 32, 42, .46); }
.ws-dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--ws-line); }
.ws-dialog-head h2 { margin: 0; font-size: 16px; }
.ws-dialog-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: #f1f4f6; cursor: pointer; }
.ws-dialog-body { padding: 18px; }

.student-loading { display: grid; place-items: center; min-height: 360px; color: var(--ws-muted); font-size: 12px; }
.student-loading::before { content: ""; width: 30px; height: 30px; margin-bottom: 12px; border: 3px solid #dcecef; border-top-color: var(--ws-primary); border-radius: 50%; animation: studentSpin .8s linear infinite; }
@keyframes studentSpin { to { transform: rotate(360deg); } }
.student-error { margin: 50px auto; max-width: 520px; padding: 28px; border: 1px solid #f1c7c7; border-radius: 12px; background: #fff8f8; color: #9e3535; text-align: center; }

@media (max-width: 1160px) {
  .student-workflow { grid-template-columns: repeat(3, 1fr); row-gap: 15px; }
  .workflow-step:nth-child(3)::after { display: none; }
  .student-content-grid { grid-template-columns: 1fr; }
  .student-side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .student-progress-lookup { grid-template-columns: 1fr; gap: 12px; }
  .student-identity { align-items: flex-start; flex-wrap: wrap; }
  .student-identity-main { flex: 1 1 calc(100% - 90px); }
  .student-identity-actions { width: 100%; padding-left: 80px; }
  .student-workflow { grid-template-columns: repeat(2, 1fr); }
  .workflow-step:nth-child(2n)::after { display: none; }
  .workflow-step:nth-child(3)::after { display: block; }
  .student-tabs { gap: 18px; overflow-x: auto; }
  .student-tab { flex: 0 0 auto; }
  .student-side-stack { grid-template-columns: 1fr; }
  .picker-toolbar { grid-template-columns: 1fr; }
  .picker-table, .record-table, .goal-table { min-width: 720px; }
  .ws-panel-body.table-scroll { overflow-x: auto; }
}

@media (max-width: 560px) {
  .student-progress-lookup { padding: 13px; }
  .student-progress-result { grid-template-columns: 1fr 76px; }
  .student-progress-result > small { display: none; }
  .student-back { margin-bottom: 8px; }
  .student-identity-avatar { width: 54px; height: 54px; flex-basis: 54px; }
  .student-identity-main { flex-basis: calc(100% - 70px); }
  .student-identity-title h1 { font-size: 20px; }
  .student-identity-actions { padding-left: 0; }
  .student-identity-actions .ws-button { flex: 1; padding: 0 10px; }
  .student-workflow { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .workflow-step { min-width: 142px; scroll-snap-align: start; }
  .workflow-step::after { display: block !important; }
  .workflow-step:last-child::after { display: none !important; }
  .quick-action-grid, .progress-summary, .selection-counts, .summary-actions, .ws-form-row { grid-template-columns: 1fr; }
  .plan-selector { align-items: stretch; flex-direction: column; }
  .plan-selector select { min-width: 0; width: 100%; }
  .plan-selector .ws-button { margin-left: 0; }
  .ws-panel-head { align-items: flex-start; }
}
