:root {
  --tp-blue: #0069d9;
  --tp-deep: #003989;
  --tp-sky: #eaf4ff;
  --tp-border: #cfe0ef;
  --tp-ink: #0a2540;
  --tp-muted: #5c7188;
  --tp-surface: #ffffff;
  --tp-bg: #f5f9fc;
  --tp-green: #169b52;
  --tp-orange: #e77817;
  --tp-red: #dc3545;
  --tp-purple: #7b4ce2;
}

.teacher-profile-workspace {
  color: var(--tp-ink);
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 18px 22px 34px;
}

.teacher-profile-workspace *,
.teacher-profile-workspace *::before,
.teacher-profile-workspace *::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

.tp-page-head,
.tp-page-head > div,
.tp-head-actions,
.tp-hero-person,
.tp-hero-copy > p,
.tp-hero-badges,
.tp-section-head,
.tp-card > header,
.tp-filterbar,
.tp-donut-wrap,
.tp-document-list > div,
.tp-activity-list > div,
.tp-history-detail .tp-section-head {
  display: flex;
  align-items: center;
}

.tp-page-head {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.tp-page-head > div:first-child {
  gap: 12px;
}

.tp-page-head h2 {
  margin: 0 0 4px;
  font-size: 25px;
  line-height: 1.15;
}

.tp-page-head p {
  margin: 0;
  color: var(--tp-muted);
  font-size: 13px;
}

.tp-page-head p span {
  margin: 0 7px;
  color: #9cb0c2;
}

.tp-back,
.tp-icon-button,
.tp-row-action {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--tp-border);
  background: #fff;
  color: var(--tp-ink);
  cursor: pointer;
}

.tp-back {
  width: 38px;
  height: 38px;
  border-radius: 6px;
}

.tp-head-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.tp-button,
.tp-small-button,
.tp-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid #afd0ee;
  border-radius: 6px;
  background: #fff;
  color: #075fac;
  font-weight: 700;
  cursor: pointer;
}

.tp-button {
  padding: 9px 15px;
  font-size: 13px;
}

.tp-button.primary {
  background: var(--tp-blue);
  border-color: var(--tp-blue);
  color: #fff;
  box-shadow: 0 5px 13px rgba(0, 105, 217, 0.18);
}

.tp-small-button {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.tp-text-button {
  min-height: auto;
  padding: 3px;
  border: 0;
  background: transparent;
}

.tp-button:hover,
.tp-small-button:hover,
.tp-back:hover,
.tp-icon-button:hover,
.tp-row-action:hover {
  background: #e7f3ff;
  border-color: #75b5ed;
}

.tp-button.primary:hover {
  background: #005dbf;
  color: #fff;
}

.tp-icon,
.tp-button svg,
.tp-small-button svg,
.tp-row-action svg,
.tp-icon-button svg,
.tp-back svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tp-actions-wrap {
  position: relative;
}

.tp-icon-button {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

.tp-actions-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: 218px;
  padding: 6px;
  border: 1px solid var(--tp-border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(10, 37, 64, 0.16);
}

.tp-actions-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--tp-ink);
  text-align: left;
  cursor: pointer;
}

.tp-actions-menu button:hover {
  background: var(--tp-sky);
}

.tp-actions-menu button.danger {
  color: var(--tp-red);
}

.tp-hero {
  min-height: 222px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 24px 30px;
  border-radius: 7px;
  background: var(--tp-deep);
  color: #fff;
  box-shadow: 0 7px 20px rgba(0, 57, 137, 0.18);
}

.tp-hero-person {
  min-width: 0;
  flex: 1;
  gap: 26px;
}

.tp-hero-photo {
  width: 142px;
  height: 142px;
  flex: 0 0 142px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #dbeafe;
}

.tp-hero-photo-wrap {
  position: relative;
  flex: 0 0 142px;
}

.tp-photo-actions {
  position: absolute;
  left: 50%;
  bottom: -12px;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
}

.tp-photo-actions button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 5px;
  background: #fff;
  color: #005A94;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.tp-photo-actions button:hover {
  background: #EAF4FF;
}

.tp-photo-fallback {
  display: grid;
  place-items: center;
  font-size: 38px;
  font-weight: 800;
  color: var(--tp-deep);
}

.tp-hero-copy {
  min-width: 0;
  flex: 1;
}

.tp-hero-copy h1 {
  margin: 0 0 7px;
  font-size: clamp(25px, 2.2vw, 35px);
  line-height: 1.1;
  color: #fff;
}

.tp-hero-copy > p {
  flex-wrap: wrap;
  gap: 9px;
  margin: 0;
  font-size: 15px;
}

.tp-hero-copy > p span {
  color: #79bbff;
}

.tp-hero-badges {
  gap: 9px;
  margin-top: 12px;
}

.tp-hero-copy dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 20px;
  margin: 20px 0 0;
}

.tp-hero-copy dt {
  color: #bddcff;
  font-size: 12px;
}

.tp-hero-copy dd {
  margin: 5px 0 0;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tp-qr {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
}

.tp-qr svg {
  width: 108px;
  height: 108px;
  padding: 10px;
  border-radius: 6px;
  background: #fff;
  fill: #051f3a;
  shape-rendering: crispEdges;
}

.tp-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 7px;
  margin: 18px 0 20px;
  padding: 5px;
  border: 1px solid #BFDDF8;
  border-radius: 7px;
  background: #F8FBFF;
}

.tp-tabs::-webkit-scrollbar {
  display: none;
}

.tp-tabs button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #BFDDF8;
  border-radius: 6px;
  background: #EAF4FF;
  color: #0B5EAE;
  font-size: 12px;
  cursor: pointer;
}

.tp-tabs button:hover {
  border-color: #8EC5F3;
  background: #DCEEFF;
}

.tp-tabs button.active {
  border-color: #1783E6;
  background: #1783E6;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(23, 131, 230, .2);
}

.tp-tabs button:focus-visible {
  outline: 3px solid rgba(23, 131, 230, .28);
  outline-offset: 2px;
}

.tp-tab-panel {
  display: grid;
  gap: 16px;
}

.tp-section-head {
  justify-content: space-between;
  gap: 15px;
}

.tp-section-head h2,
.tp-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.tp-section-head p {
  margin: 4px 0 0;
  color: var(--tp-muted);
  font-size: 13px;
}

.tp-stat-grid {
  display: grid;
  gap: 12px;
}

.tp-stat-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tp-stat-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tp-stat,
.tp-card,
.tp-empty,
.tp-filterbar {
  border: 1px solid var(--tp-border);
  border-radius: 7px;
  background: var(--tp-surface);
  box-shadow: 0 3px 10px rgba(10, 37, 64, 0.045);
}

.tp-stat {
  min-height: 104px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
}

.tp-stat-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--tp-blue);
  background: #e8f3ff;
}

.tp-stat-icon svg {
  width: 24px;
  height: 24px;
}

.tp-tone-green { color: var(--tp-green); background: #e8f7ef; }
.tp-tone-purple { color: var(--tp-purple); background: #f1ecff; }
.tp-tone-orange { color: var(--tp-orange); background: #fff3e8; }
.tp-tone-red { color: var(--tp-red); background: #ffebed; }

.tp-stat div {
  min-width: 0;
}

.tp-stat span:not(.tp-stat-icon) {
  display: block;
  color: #49657d;
  font-size: 12px;
}

.tp-stat strong {
  display: block;
  margin: 4px 0;
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.tp-stat small {
  display: block;
  color: var(--tp-muted);
  font-size: 11px;
}

.tp-card {
  min-width: 0;
  padding: 15px;
}

.tp-card > .tp-section-head,
.tp-card > header {
  margin-bottom: 12px;
}

.tp-card > header {
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0ebf3;
}

.tp-card > header h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 15px;
}

.tp-overview-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 1fr;
  gap: 14px;
}

.tp-donut-wrap {
  justify-content: center;
  gap: 24px;
  min-height: 190px;
}

.tp-donut {
  --value: 0;
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: conic-gradient(var(--tp-blue) calc(var(--value) * 1%), #e5edf5 0);
  position: relative;
}

.tp-donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: #fff;
}

.tp-donut strong,
.tp-donut span {
  position: relative;
  z-index: 1;
}

.tp-donut strong { font-size: 22px; }
.tp-donut span { color: var(--tp-muted); font-size: 11px; }

.tp-donut-wrap ul {
  min-width: 145px;
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tp-donut-wrap li {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}

.tp-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--tp-blue);
}

.dot-1 { background: var(--tp-green); }
.dot-2 { background: var(--tp-purple); }
.dot-3 { background: var(--tp-orange); }

.tp-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #d7e4ef;
  border-radius: 6px;
}

.tp-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 12px;
}

.tp-table th {
  padding: 10px;
  background: #eef6fd;
  color: #123b63;
  text-align: left;
  white-space: nowrap;
}

.tp-table td {
  padding: 10px;
  border-top: 1px solid #dce8f1;
  vertical-align: middle;
}

.tp-table tbody tr:nth-child(even) {
  background: #f7fbfe;
}

.tp-table tbody tr:hover {
  background: #eaf4ff;
}

.tp-table td > small {
  display: block;
  color: var(--tp-muted);
  margin-top: 3px;
}

.tp-table-empty {
  padding: 25px !important;
  text-align: center;
  color: var(--tp-muted);
}

.tp-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.tp-link:hover {
  color: var(--tp-blue);
  text-decoration: underline;
}

.tp-row-action {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  border-radius: 5px;
}

.tp-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.tp-badge-green { background: #dff6e8; color: #087a3d; }
.tp-badge-red { background: #ffe6e9; color: #bd1e2f; }
.tp-badge-orange { background: #fff0dc; color: #b85700; }
.tp-badge-purple { background: #eee8ff; color: #5c35c5; }
.tp-badge-sky { background: #dceeff; color: #075fac; }
.tp-badge-blue { background: #dceeff; color: #075fac; }
.tp-badge-gray { background: #edf1f5; color: #526579; }

.tp-document-list,
.tp-activity-list {
  display: grid;
  gap: 3px;
}

.tp-document-list > div,
.tp-activity-list > div {
  gap: 10px;
  min-height: 42px;
  padding: 7px 0;
  border-bottom: 1px solid #e4edf4;
}

.tp-document-list > div:last-child,
.tp-activity-list > div:last-child {
  border-bottom: 0;
}

.tp-document-list > div > svg,
.tp-activity-list > div > span {
  color: var(--tp-blue);
}

.tp-document-list > div > span,
.tp-activity-list p {
  min-width: 0;
  flex: 1;
  margin: 0;
}

.tp-document-list strong,
.tp-document-list small,
.tp-activity-list strong,
.tp-activity-list small {
  display: block;
}

.tp-document-list strong,
.tp-activity-list strong {
  font-size: 12px;
}

.tp-document-list small,
.tp-activity-list small,
.tp-document-list time {
  color: var(--tp-muted);
  font-size: 10px;
}

.tp-quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.tp-quick-links button,
.tp-account-actions button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid #d3e2ef;
  border-radius: 6px;
  background: #f8fbfe;
  color: #123b63;
  cursor: pointer;
}

.tp-key-values,
.tp-detail-list {
  margin: 0;
}

.tp-key-values > div,
.tp-detail-list > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(120px, 1.2fr);
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid #e2ebf2;
}

.tp-key-values > div:last-child,
.tp-detail-list > div:last-child {
  border-bottom: 0;
}

.tp-key-values dt,
.tp-detail-list dt {
  color: #4d6880;
  font-size: 12px;
}

.tp-key-values dd,
.tp-detail-list dd {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tp-personal-grid,
.tp-professional-grid,
.tp-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tp-personal-grid > article:nth-child(2) {
  grid-row: span 2;
}

.tp-photo-card {
  text-align: center;
}

.tp-personal-photo {
  width: min(100%, 330px);
  height: 260px;
  object-fit: cover;
  border-radius: 6px;
  background: #edf4f9;
}

.tp-photo-card p {
  margin: 10px 0 2px;
  font-weight: 700;
}

.tp-photo-card small {
  color: var(--tp-muted);
}

.tp-filterbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 13px;
}

.tp-filterbar label {
  min-width: 190px;
  display: grid;
  gap: 5px;
  color: #436077;
  font-size: 11px;
  font-weight: 700;
}

.tp-filterbar select,
.tp-filterbar input,
.tp-edit-grid input,
.tp-history-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #bed6e8;
  border-radius: 6px;
  background: #fff;
  color: var(--tp-ink);
  font: inherit;
}

.tp-attendance-grid,
.tp-timetable-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 0.9fr);
  gap: 14px;
}

.tp-side-stack {
  display: grid;
  align-content: start;
  gap: 14px;
}

.tp-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(74px, 1fr));
  min-width: 650px;
  border: 1px solid #d9e5ee;
  border-radius: 6px;
  overflow: hidden;
}

.tp-calendar > div {
  min-height: 74px;
  padding: 8px;
  border-right: 1px solid #dfe9f1;
  border-bottom: 1px solid #dfe9f1;
}

.tp-calendar > .head {
  min-height: auto;
  background: #eef6fd;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.tp-calendar .tp-badge {
  margin-top: 8px;
  font-size: 9px;
  padding: 3px 5px;
}

.tp-empty {
  min-height: 330px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 35px;
  text-align: center;
}

.tp-empty-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tp-sky);
  color: var(--tp-blue);
}

.tp-empty-icon svg {
  width: 34px;
  height: 34px;
}

.tp-empty h3 {
  margin: 3px 0 0;
  font-size: 21px;
}

.tp-empty p {
  max-width: 620px;
  margin: 0;
  color: var(--tp-muted);
}

.tp-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 8px;
}

.tp-week-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tp-week-board section {
  min-height: 150px;
  padding: 10px;
  border: 1px solid #d7e4ef;
  border-radius: 6px;
}

.tp-week-board h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.tp-week-board section > div {
  display: grid;
  gap: 3px;
  margin-bottom: 7px;
  padding: 8px;
  border-left: 3px solid var(--tp-blue);
  border-radius: 4px;
  background: var(--tp-sky);
  font-size: 11px;
}

.tp-week-board time {
  color: var(--tp-muted);
}

.tp-success-note {
  padding: 12px;
  border-radius: 6px;
  background: #e8f7ef;
  color: #087a3d;
}

.tp-history-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.7fr);
  gap: 14px;
}

.tp-history-list {
  overflow: hidden;
  border: 1px solid var(--tp-border);
  border-radius: 7px;
  background: #fff;
}

.tp-history-search {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px;
  border-bottom: 1px solid var(--tp-border);
}

.tp-history-list > button {
  width: 100%;
  display: grid;
  grid-template-columns: 105px 1fr 85px 18px;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 0;
  border-bottom: 1px solid #e1ebf2;
  background: #fff;
  color: var(--tp-ink);
  text-align: left;
  cursor: pointer;
}

.tp-history-list > button.active,
.tp-history-list > button:hover {
  background: var(--tp-sky);
}

.tp-history-list button span,
.tp-history-list button small {
  color: var(--tp-muted);
  font-size: 10px;
}

.tp-permissions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.tp-permissions > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  border: 1px solid #d9e5ee;
  border-radius: 5px;
  font-size: 11px;
}

.tp-permissions > div > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tp-account-actions {
  display: grid;
  gap: 8px;
}

.tp-edit-modal {
  width: min(720px, calc(100vw - 30px));
}

.tp-action-modal-body {
  display: grid;
  gap: 14px;
  max-height: min(66vh, 680px);
  padding: 18px;
  overflow-y: auto;
}

.tp-action-modal-body .tp-edit-grid {
  padding: 0;
}

.tp-modal-field {
  display: grid;
  gap: 6px;
  color: #3f5e78;
  font-size: 12px;
  font-weight: 700;
}

.tp-modal-field input,
.tp-modal-field select,
.tp-modal-field textarea,
.tp-edit-grid input,
.tp-edit-grid select,
.tp-edit-grid textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #BFD7EA;
  border-radius: 6px;
  background: #fff;
  color: #0A2540;
  font: inherit;
}

.tp-modal-field textarea {
  min-height: 88px;
  resize: vertical;
}

.tp-check-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #294760;
  font-size: 12px;
}

.tp-check-line input {
  margin-top: 2px;
}

.tp-warning-box,
.tp-modal-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid #F6C86C;
  border-radius: 6px;
  background: #FFF8E8;
  color: #704900;
}

.tp-warning-box p {
  margin: 4px 0 0;
}

.tp-modal-error {
  min-height: 18px;
  margin: 0;
  color: #D92D20;
  font-size: 12px;
  font-weight: 700;
}

.tp-permission-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 13px;
  border: 1px solid #BFD7EA;
  border-radius: 6px;
}

.tp-permission-fieldset legend {
  padding: 0 6px;
  color: #0A2540;
  font-size: 12px;
  font-weight: 800;
}

.tp-permission-fieldset label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #DCE8F2;
  border-radius: 5px;
  background: #F8FBFE;
  color: #294760;
  font-size: 12px;
}

.tp-document-actions-modal {
  display: grid;
  gap: 8px;
}

.tp-document-actions-modal button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #BFD7EA;
  border-radius: 6px;
  background: #fff;
  color: #075FAC;
  font-weight: 700;
  cursor: pointer;
}

.tp-document-actions-modal button:hover {
  background: #EAF4FF;
}

.tp-document-actions-modal button.danger {
  border-color: #F3B8B5;
  color: #D92D20;
}

.tp-button.danger {
  border-color: #D92D20;
  background: #D92D20;
  color: #fff;
}

.tp-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  padding: 18px;
}

.tp-edit-grid label {
  display: grid;
  gap: 5px;
  color: #3f5e78;
  font-size: 12px;
  font-weight: 700;
}

.tp-edit-modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 18px;
  border-top: 1px solid var(--tp-border);
}

@media (max-width: 1280px) {
  .tp-stat-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tp-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-hero-copy dl { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
}

@media (max-width: 900px) {
  .teacher-profile-workspace { padding: 14px; }
  .tp-page-head { align-items: flex-start; }
  .tp-page-head,
  .tp-hero { flex-direction: column; }
  .tp-head-actions { justify-content: flex-start; }
  .tp-hero { align-items: stretch; }
  .tp-qr { align-self: center; }
  .tp-stat-grid.five,
  .tp-stat-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-overview-grid,
  .tp-personal-grid,
  .tp-professional-grid,
  .tp-account-grid,
  .tp-attendance-grid,
  .tp-timetable-grid,
  .tp-history-grid { grid-template-columns: 1fr; }
  .tp-personal-grid > article:nth-child(2) { grid-row: auto; }
  .tp-week-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .teacher-profile-workspace { padding: 10px; }
  .tp-page-head h2 { font-size: 21px; }
  .tp-head-actions { width: 100%; }
  .tp-head-actions .tp-button { flex: 1 1 140px; }
  .tp-hero { padding: 20px 16px; }
  .tp-hero-person { flex-direction: column; text-align: center; }
  .tp-hero-photo { width: 112px; height: 112px; flex-basis: 112px; }
  .tp-hero-photo-wrap { flex-basis: 112px; }
  .tp-hero-copy > p,
  .tp-hero-badges { justify-content: center; }
  .tp-hero-copy dl { grid-template-columns: 1fr 1fr; text-align: left; gap: 14px; }
  .tp-qr { display: none; }
  .tp-tabs { margin-left: -10px; margin-right: -10px; padding-left: 10px; }
  .tp-stat-grid.five,
  .tp-stat-grid.four { grid-template-columns: 1fr; }
  .tp-stat { min-height: 88px; }
  .tp-overview-grid,
  .tp-week-board,
  .tp-permissions,
  .tp-permission-fieldset,
  .tp-edit-grid { grid-template-columns: 1fr; }
  .tp-filterbar label { min-width: 100%; }
  .tp-filterbar .tp-button { width: 100%; }
  .tp-history-list > button { grid-template-columns: 90px 1fr 18px; }
  .tp-history-list > button small { display: none; }
}

@media print {
  .sidebar,
  .topbar,
  .tp-page-head,
  .tp-tabs,
  .tp-filterbar,
  .tp-actions-menu,
  .floating-action,
  .tp-small-button,
  .tp-row-action,
  .tp-text-button {
    display: none !important;
  }
  .app-shell,
  .main,
  .content,
  #pageContent {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  .teacher-profile-workspace {
    max-width: none;
    padding: 0;
  }
  .tp-hero {
    min-height: auto;
    padding: 18px;
    box-shadow: none;
    print-color-adjust: exact;
  }
  .tp-card,
  .tp-stat {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* Approved teacher profile workspace — theme-connected refinement. */
.teacher-profile-workspace {
  --tp-blue: var(--color-primary);
  --tp-deep: var(--color-sidebar-bg);
  --tp-sky: var(--color-primary-soft);
  --tp-border: var(--color-border);
  --tp-ink: var(--color-text-primary);
  --tp-muted: var(--color-text-secondary);
  --tp-surface: var(--color-surface);
  --tp-bg: var(--color-page-bg);
  --tp-green: var(--color-success);
  --tp-orange: var(--color-warning);
  --tp-red: var(--color-danger);
  --tp-purple: var(--color-accent);
  max-width: 1780px;
  padding: 16px 20px 30px;
  background: #fff;
}

#pageContent:has(> .teacher-profile-workspace) {
  background: #fff;
}

.teacher-profile-workspace .tp-page-head { margin-bottom: 12px; }
.teacher-profile-workspace .tp-page-head h2 { font-size: var(--ui-font-hero); }
.teacher-profile-workspace .tp-button { min-height: var(--ui-control-height); height: var(--ui-control-height); padding: 0 13px; color: var(--color-primary); border-color: var(--color-border-strong); border-radius: var(--radius-control); background: var(--color-surface); }
.teacher-profile-workspace .tp-button.primary { color: var(--color-sidebar-text); border-color: var(--color-primary); background: var(--color-primary); box-shadow: none; }
.teacher-profile-workspace .tp-icon-button { width: var(--ui-icon-control-size); height: var(--ui-icon-control-size); color: var(--color-primary); border-color: var(--color-border-strong); border-radius: var(--radius-control); background: var(--color-surface); }
.teacher-profile-workspace .tp-actions-menu { color: var(--color-text-primary); border-color: var(--color-border); border-radius: var(--radius-card); background: var(--color-surface-raised); box-shadow: var(--shadow-dropdown); }

.teacher-profile-workspace .tp-hero {
  height: 224px;
  min-height: 224px;
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr) 142px;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: var(--color-sidebar-text);
  border: 1px solid color-mix(in srgb, var(--color-sidebar-text) 18%, var(--color-sidebar-bg));
  border-radius: var(--radius-card);
  background: var(--color-sidebar-bg);
  box-shadow: 0 10px 28px rgba(7, 40, 76, .16);
}

.teacher-profile-workspace .tp-hero-photo-wrap { width: 178px; min-height: 194px; display: grid; align-self: center; justify-items: center; flex: none; }
.teacher-profile-workspace .tp-hero-photo { width: 160px; height: 160px; justify-self: center; flex: none; object-fit: cover; border: 1px solid var(--color-border-strong); border-radius: var(--radius-card) var(--radius-card) 0 0; background: var(--color-surface-muted); }
.teacher-profile-workspace .tp-hero-photo-wrap .ns-photo-picker { width: 160px; gap: 0; }
.teacher-profile-workspace .tp-hero-photo-wrap .ns-photo-picker__preview { width: 160px; height: 160px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-card) var(--radius-card) 0 0; }
.teacher-profile-workspace .tp-hero-photo-wrap .ns-photo-picker__actions { width: 100%; min-height: 34px; gap: 8px; padding-top: 0; }

.teacher-profile-workspace .tp-hero-copy { min-width: 0; height: 100%; display: grid; grid-template-rows: auto 1fr; align-content: center; }
.teacher-profile-workspace .tp-hero-identity { min-width: 0; padding: 3px 0 10px; border-bottom: 1px solid color-mix(in srgb, var(--color-sidebar-text) 22%, transparent); }
.teacher-profile-workspace .tp-hero-identity h1 { margin: 0 0 6px; color: var(--color-sidebar-text); font-size: clamp(22px, 2vw, 29px); line-height: 1.05; }
.teacher-profile-workspace .tp-hero-identity p { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0; color: var(--color-sidebar-text); font-size: 12px; }
.teacher-profile-workspace .tp-hero-identity a { color: var(--color-sidebar-text); font-weight: 800; text-decoration-color: color-mix(in srgb, var(--color-sidebar-text) 55%, transparent); }
.teacher-profile-workspace .tp-hero-identity strong { font-weight: 700; }
.teacher-profile-workspace .tp-hero-details { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); align-items: stretch; margin: 0; padding-top: 10px; }
.teacher-profile-workspace .tp-hero-column { min-width: 0; display: grid; align-content: center; gap: 10px; padding: 0 6px; border-right: 1px solid color-mix(in srgb, var(--color-sidebar-text) 20%, transparent); }
.teacher-profile-workspace .tp-hero-column:first-child { padding-left: 0; }
.teacher-profile-workspace .tp-hero-column:last-child { padding-right: 0; border-right: 0; }
.teacher-profile-workspace .tp-hero-field { min-width: 0; display: grid; grid-template-columns: 18px minmax(0,1fr); align-items: start; gap: 0 4px; }
.teacher-profile-workspace .tp-hero-field-icon { display: grid; place-items: center; color: var(--color-sidebar-text); }
.teacher-profile-workspace .tp-hero-field-icon svg { width: 16px; height: 16px; }
.teacher-profile-workspace .tp-hero-field dt { min-width: 0; grid-column: 2; grid-row: 1; color: color-mix(in srgb, var(--color-sidebar-text) 76%, transparent); font-size: 10px; line-height: 1.1; }
.teacher-profile-workspace .tp-hero-field dd { min-width: 0; grid-column: 1 / -1; grid-row: 2; margin: 3px 0 0; }
.teacher-profile-workspace .tp-hero-field dd > span { max-width: 100%; display: -webkit-box; padding: 4px 5px; overflow: hidden; color: var(--color-sidebar-text); border: 1px solid color-mix(in srgb, var(--color-sidebar-text) 22%, transparent); border-radius: 5px; background: color-mix(in srgb, var(--color-sidebar-text) 10%, transparent); font-size: 10.5px; font-weight: 750; line-height: 1.15; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.teacher-profile-workspace .tp-badge { border-radius: 5px; }
.teacher-profile-workspace .tp-badge-green { color: var(--color-success); background: color-mix(in srgb, var(--color-success) 12%, var(--color-surface)); }
.teacher-profile-workspace .tp-badge-red { color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 12%, var(--color-surface)); }

.teacher-profile-workspace .tp-qr { min-width: 0; display: grid; justify-items: center; gap: 7px; color: var(--color-text-primary); }
.teacher-profile-workspace .tp-qr > svg { width: 116px; height: 116px; padding: 6px; border: 1px solid var(--color-border); border-radius: var(--radius-control); background: var(--color-surface); fill: var(--color-text-primary); box-shadow: var(--shadow-card); }
.teacher-profile-workspace .tp-qr button { min-height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 9px; color: var(--color-primary); border: 1px solid var(--color-border-strong); border-radius: var(--radius-control); background: var(--color-surface); font-size: 10px; font-weight: 750; cursor: pointer; }
.teacher-profile-workspace .tp-qr button svg { width: 14px; height: 14px; padding: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; border: 0; box-shadow: none; }

.teacher-profile-workspace .tp-profile-shell { min-width: 0; display: grid; grid-template-columns: 208px minmax(0,1fr); gap: 16px; margin-top: 16px; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: #fff; box-shadow: 0 10px 28px rgba(7, 40, 76, .09); }
.teacher-profile-workspace .tp-tabs { min-width: 0; align-self: start; position: sticky; top: calc(var(--topbar-height, 72px) + 12px); display: flex !important; flex-direction: column; gap: 0; margin: 0; padding: 8px; overflow: hidden; color: var(--color-sidebar-bg); border: 1px solid var(--color-border) !important; border-radius: var(--radius-card); background: var(--color-surface-muted) !important; box-shadow: var(--shadow-card); }
.teacher-profile-workspace .tp-tabs button { width: 100%; min-height: 43px; flex: 0 0 43px; display: flex; align-items: center; gap: 9px; padding: 0 10px; color: var(--color-sidebar-bg) !important; border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; background: transparent; font-size: 11px; text-align: left; }
.teacher-profile-workspace .tp-tabs button:last-child { border-bottom: 0; }
.teacher-profile-workspace .tp-tabs button:hover { color: var(--color-primary) !important; background: color-mix(in srgb, var(--color-primary) 8%, var(--color-surface-muted)); }
.teacher-profile-workspace .tp-tabs button.active { color: #fff !important; border: 0; border-left: 3px solid color-mix(in srgb, #fff 88%, transparent); background: var(--color-sidebar-active) !important; box-shadow: none; font-weight: 800; }
.teacher-profile-workspace .tp-tabs button svg { width: 18px; height: 18px; flex: 0 0 18px; }
.teacher-profile-workspace .tp-profile-content { min-width: 0; padding-top: 10px; }
.teacher-profile-workspace .tp-tab-panel { min-width: 0; gap: var(--ui-section-gap); }

.teacher-profile-workspace .tp-stat-grid { gap: 12px; }
.teacher-profile-workspace .tp-stat { min-height: 98px; padding: 12px; border-color: var(--color-border); border-radius: var(--radius-card); background: #f3f5f8; box-shadow: var(--shadow-card); }
.teacher-profile-workspace .tp-stat-icon { width: 42px; height: 42px; flex-basis: 42px; color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface)); }
.teacher-profile-workspace .tp-tone-green { color: var(--color-success); background: color-mix(in srgb, var(--color-success) 10%, var(--color-surface)); }
.teacher-profile-workspace .tp-tone-purple { color: var(--color-accent); background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface)); }
.teacher-profile-workspace .tp-tone-orange { color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 10%, var(--color-surface)); }
.teacher-profile-workspace .tp-tone-red { color: var(--color-danger); background: color-mix(in srgb, var(--color-danger) 10%, var(--color-surface)); }
.teacher-profile-workspace .tp-stat strong { font-size: 19px; }
.teacher-profile-workspace .tp-card, .teacher-profile-workspace .tp-empty, .teacher-profile-workspace .tp-filterbar { color: var(--color-text-primary); border-color: var(--color-border); border-radius: var(--radius-card); background: #f3f5f8; box-shadow: var(--shadow-card); }
.teacher-profile-workspace .tp-card { padding: var(--ui-card-padding); }
.teacher-profile-workspace .tp-overview-grid { grid-template-columns: 1.2fr .95fr 1fr; gap: 12px; }
.teacher-profile-workspace .tp-table-scroll { border-color: var(--color-border); }
.teacher-profile-workspace .tp-table th { color: var(--color-text-primary); background: var(--color-table-header); }
.teacher-profile-workspace .tp-table td { border-color: var(--color-border); background: var(--color-surface); }
.teacher-profile-workspace .tp-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--color-surface-muted) 70%, var(--color-surface)); }
.teacher-profile-workspace .tp-donut { background: conic-gradient(var(--color-primary) calc(var(--value) * 1%), var(--color-surface-muted) 0); }
.teacher-profile-workspace .tp-donut::after { background: var(--color-surface); }
.teacher-profile-workspace .tp-filterbar input, .teacher-profile-workspace .tp-filterbar select, .teacher-profile-workspace .tp-edit-grid input, .teacher-profile-workspace .tp-history-search input { min-height: var(--ui-control-height); color: var(--color-text-primary); border-color: var(--color-border); border-radius: var(--radius-control); background: var(--color-input-bg); }
.teacher-profile-workspace .tp-photo-preview { display: grid; place-items: center; }
.teacher-profile-workspace .tp-photo-preview-image { width: min(420px,100%); max-height: 62vh; object-fit: contain; border-radius: var(--radius-card); }

@media (max-width: 1500px) {
  .teacher-profile-workspace .tp-overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .teacher-profile-workspace .tp-assignment-card { grid-column: 1 / -1; }
}

@media (max-width: 1280px) {
  .teacher-profile-workspace .tp-hero { grid-template-columns: 158px minmax(0,1fr) 125px; gap: 13px; }
  .teacher-profile-workspace .tp-hero-photo-wrap { width: 158px; }
  .teacher-profile-workspace .tp-hero-column { padding-inline: 5px; }
  .teacher-profile-workspace .tp-hero-field dd > span { font-size: 9.5px; }
  .teacher-profile-workspace .tp-profile-shell { grid-template-columns: 200px minmax(0,1fr); }
  .teacher-profile-workspace .tp-overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 1024px) {
  .teacher-profile-workspace { padding-inline: 14px; }
  .teacher-profile-workspace .tp-hero { height: auto; min-height: 224px; grid-template-columns: 152px minmax(0,1fr) 116px; padding-inline: 13px; }
  .teacher-profile-workspace .tp-hero-photo-wrap { width: 152px; }
  .teacher-profile-workspace .tp-hero-details { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 0; }
  .teacher-profile-workspace .tp-hero-column:nth-child(2) { border-right: 0; }
  .teacher-profile-workspace .tp-hero-column:nth-child(3) { padding-left: 0; }
  .teacher-profile-workspace .tp-qr svg { width: 108px; height: 108px; }
  .teacher-profile-workspace .tp-profile-shell { grid-template-columns: 190px minmax(0,1fr); gap: 12px; }
  .teacher-profile-workspace .tp-stat-grid.five { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .teacher-profile-workspace .tp-page-head { flex-direction: row; flex-wrap: wrap; }
  .teacher-profile-workspace .tp-head-actions { width: 100%; }
  .teacher-profile-workspace .tp-hero { grid-template-columns: 150px minmax(0,1fr); align-items: start; }
  .teacher-profile-workspace .tp-qr { grid-column: 1/-1; display: flex; justify-content: center; }
  .teacher-profile-workspace .tp-qr svg { width: 92px; height: 92px; }
  .teacher-profile-workspace .tp-profile-shell { display: block; }
  .teacher-profile-workspace .tp-tabs { position: static; flex-direction: row; gap: 6px; margin: 0 0 12px; padding: 7px; overflow-x: auto; scrollbar-width: thin; }
  .teacher-profile-workspace .tp-tabs button { width: auto; min-width: max-content; flex: 0 0 auto; padding-inline: 11px; border: 0; border-right: 1px solid var(--color-border); border-radius: var(--radius-control); }
  .teacher-profile-workspace .tp-tabs button.active { border-left: 0; }
}

@media (max-width: 600px) {
  .teacher-profile-workspace { padding: 10px; }
  .teacher-profile-workspace .tp-page-head > div:first-child { width: 100%; }
  .teacher-profile-workspace .tp-page-head p { font-size: 11px; }
  .teacher-profile-workspace .tp-head-actions .tp-button { flex: 1 1 calc(50% - 6px); font-size: 11px; }
  .teacher-profile-workspace .tp-head-actions .tp-button:nth-child(3) { flex-basis: calc(100% - 44px); }
  .teacher-profile-workspace .tp-hero { grid-template-columns: 132px minmax(0,1fr); justify-items: stretch; align-items: start; gap: 12px; padding: 14px; }
  .teacher-profile-workspace .tp-hero-photo-wrap { width: 132px; min-height: 208px; justify-self: center; }
  .teacher-profile-workspace .tp-hero-photo { width: 132px; height: 132px; }
  .teacher-profile-workspace .tp-hero-photo-wrap .ns-photo-picker { width: 132px; }
  .teacher-profile-workspace .tp-hero-photo-wrap .ns-photo-picker__preview { width: 132px; height: 132px; }
  .teacher-profile-workspace .tp-hero-photo-wrap .ns-photo-picker__actions { padding-top: 6px; }
  .teacher-profile-workspace .tp-hero-copy { display: contents; }
  .teacher-profile-workspace .tp-hero-identity { grid-column: 2; align-self: center; text-align: left; }
  .teacher-profile-workspace .tp-hero-identity h1 { font-size: 21px; }
  .teacher-profile-workspace .tp-hero-identity p { justify-content: flex-start; gap: 6px; }
  .teacher-profile-workspace .tp-hero-details { grid-column: 1 / -1; grid-template-columns: repeat(2,minmax(0,1fr)); padding-top: 0; }
  .teacher-profile-workspace .tp-hero-column, .teacher-profile-workspace .tp-hero-column:nth-child(3) { padding: 0 5px; }
  .teacher-profile-workspace .tp-hero-column:nth-child(odd) { padding-left: 0; }
  .teacher-profile-workspace .tp-hero-column:nth-child(even) { padding-right: 0; border-right: 0; }
  .teacher-profile-workspace .tp-qr { display: flex; grid-column: 1 / -1; align-items: center; justify-content: center; }
  .teacher-profile-workspace .tp-qr > svg { width: 78px; height: 78px; }
  .teacher-profile-workspace .tp-stat-grid.five, .teacher-profile-workspace .tp-stat-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .teacher-profile-workspace .tp-stat { min-height: 102px; display: flex; align-items: center; }
  .teacher-profile-workspace .tp-stat strong { font-size: 17px; }
  .teacher-profile-workspace .tp-overview-grid, .teacher-profile-workspace .tp-personal-grid, .teacher-profile-workspace .tp-professional-grid, .teacher-profile-workspace .tp-account-grid { grid-template-columns: 1fr; }
  .teacher-profile-workspace .tp-assignment-card { grid-column: auto; }
  .teacher-profile-workspace .tp-table { min-width: 620px; }
}

@media print {
  .teacher-profile-workspace .tp-profile-shell { display: block; }
  .teacher-profile-workspace .tp-hero { height: auto; min-height: 0; color: #102a43; background: #fff; }
}
