/*
 * JoyToy Education Members — compact corporate workspace
 * Keeps the existing brand, typography and colour system while reducing
 * oversized promotional spacing inside authenticated, task-oriented screens.
 */

/* Shared controls */
.member-app .button,
.member-app button.button {
  min-height: 38px;
  padding: .52rem .88rem;
  border-radius: 10px;
  font-size: .76rem;
  letter-spacing: .01em;
}

.member-app .app-content {
  padding: clamp(1.35rem, 2.5vw, 2.6rem);
}

.member-app .app-page-heading,
.member-app .welcome-row {
  margin-bottom: 1.25rem;
  align-items: center;
  gap: 1.25rem;
}

.member-app .app-page-heading h1,
.member-app .welcome-row h1 {
  margin: .2rem 0 .35rem;
  font-size: clamp(2rem, 3.2vw, 3.35rem);
  line-height: .98;
  letter-spacing: -.035em;
}

.member-app .app-page-heading p,
.member-app .welcome-row p {
  max-width: 780px;
  margin: .25rem 0;
  font-size: .9rem;
  line-height: 1.5;
}

.member-app .section-label {
  font-size: .61rem;
  letter-spacing: .14em;
}

/* Compact dashboard metrics */
.member-app .stat-grid {
  gap: .72rem;
}

.member-app .stat-grid article {
  min-height: 94px;
  padding: .78rem .85rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  gap: .35rem .8rem;
  align-items: center;
  border-width: 1.5px;
  border-radius: 14px;
  box-shadow: 0 5px 16px rgba(32, 24, 18, .06);
}

.member-app .stat-grid article > span {
  align-self: start;
  font-size: .68rem;
  color: #5f5851;
}

.member-app .stat-grid article.attention > span {
  color: rgba(255,255,255,.82);
}

.member-app .stat-grid article > strong {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  align-self: end;
  font-size: 1.95rem;
  line-height: .9;
}

.member-app .stat-grid article > a {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: end;
  padding: .43rem .62rem;
  border: 1px solid rgba(32,24,18,.35);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  font-size: .66rem;
  text-decoration: none;
}

.member-app .stat-grid article.attention > a {
  border-color: rgba(255,255,255,.55);
}

/* School administration home: operational cards, not promotional tiles */
.member-app .school-control-actions {
  margin-top: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .72rem;
}

.member-app .school-control-actions > a {
  min-height: 96px;
  padding: .82rem .9rem;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  gap: .35rem .8rem;
  align-items: center;
  border-width: 1.5px;
  border-radius: 14px;
  box-shadow: 0 5px 16px rgba(32,24,18,.07);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.member-app .school-control-actions > a:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 8px 20px rgba(32,24,18,.10);
}

.member-app .school-control-actions > a > span {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #edf3ff;
  font-size: .62rem;
}

.member-app .school-control-actions > a > strong {
  grid-column: 2;
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.15;
}

.member-app .school-control-actions > a > small {
  grid-column: 2;
  margin: 0;
  align-self: start;
  font-size: .75rem;
  line-height: 1.4;
}

.member-app .school-control-actions > a > b {
  grid-column: 3;
  grid-row: 1 / span 2;
  margin: 0;
  align-self: center;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  font-size: .68rem;
  white-space: nowrap;
}

/* Corporate filters and list density */
.member-app .lesson-filters,
.member-app .assignment-filters,
.member-app .history-year-filter,
.member-app .admin-stats-filters,
.member-app .student-registry-filters,
.member-app .crm-filters,
.member-app .admin-activity-filters,
.member-app .admin-lesson-filters {
  margin-bottom: 1rem;
  padding: .8rem;
  gap: .6rem;
  border-width: 1.5px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(32,24,18,.05);
}

.member-app .lesson-filters label,
.member-app .assignment-filters label,
.member-app .history-year-filter label,
.member-app .admin-stats-filters label,
.member-app .student-registry-filters label,
.member-app .crm-filters label,
.member-app .admin-activity-filters label,
.member-app .admin-lesson-filters label {
  gap: .25rem;
  font-size: .64rem;
  letter-spacing: .02em;
}

.member-app .lesson-filters select,
.member-app .assignment-filters select,
.member-app .history-year-filter select,
.member-app .admin-stats-filters select,
.member-app .student-registry-filters input,
.member-app .student-registry-filters select,
.member-app .crm-filters input,
.member-app .crm-filters select,
.member-app .admin-activity-filters input,
.member-app .admin-activity-filters select,
.member-app .admin-lesson-filters select {
  min-height: 38px;
  padding: .48rem .62rem;
  border-color: #b9b2a9;
  border-radius: 8px;
  font-size: .78rem;
}

.member-app .data-table-wrap,
.member-app .admin-stats-table-wrap {
  border-width: 1.5px;
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(32,24,18,.06);
}

.member-app .data-table th,
.member-app .data-table td,
.member-app .admin-stats-table th,
.member-app .admin-stats-table td {
  padding: .7rem .8rem;
}

.member-app .data-table th,
.member-app .admin-stats-table th {
  font-size: .61rem;
  letter-spacing: .04em;
}

.member-app .status {
  padding: .27rem .45rem;
  font-size: .59rem;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Educators directory — a real operational list, not a grid of tiles. */
.teacher-directory {
  overflow: hidden;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(32,24,18,.07);
}

.teacher-directory-toolbar {
  padding: .85rem;
  display: grid;
  grid-template-columns: auto minmax(520px,1fr);
  gap: 1rem;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.teacher-directory-summary {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.teacher-directory-summary > div {
  min-width: 86px;
  padding: .55rem .7rem;
  display: grid;
  gap: .05rem;
  border-right: 1px solid var(--line);
}

.teacher-directory-summary > div:last-child {
  border-right: 0;
}

.teacher-directory-summary strong {
  font-size: 1.25rem;
  line-height: 1;
}

.teacher-directory-summary span {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.teacher-directory-filters {
  display: grid;
  grid-template-columns: minmax(220px,1fr) 170px auto auto;
  gap: .5rem;
  align-items: end;
}

.teacher-directory-filters label {
  display: grid;
  gap: .22rem;
}

.teacher-directory-filters label > span {
  color: var(--muted);
  font-size: .59rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.teacher-directory-filters input,
.teacher-directory-filters select {
  width: 100%;
  min-height: 37px;
  padding: .48rem .58rem;
  border: 1px solid #b9b2a9;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .75rem;
}

.teacher-directory-filters button,
.teacher-directory-filters > a {
  min-height: 37px;
  padding: .48rem .7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: .67rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.teacher-directory-filters > a {
  background: #fff;
  color: var(--ink);
}

.teacher-directory-table-wrap {
  overflow-x: auto;
}

.teacher-directory-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.teacher-directory-table th {
  padding: .62rem .75rem;
  border-bottom: 1px solid var(--line);
  background: #f2efe9;
  color: #655e57;
  font-size: .59rem;
  font-weight: 950;
  letter-spacing: .055em;
  text-align: left;
  text-transform: uppercase;
}

.teacher-directory-table td {
  padding: .72rem .75rem;
  border-bottom: 1px solid #ebe6de;
  color: var(--ink);
  font-size: .75rem;
  vertical-align: middle;
}

.teacher-directory-table tbody tr:last-child td {
  border-bottom: 0;
}

.teacher-directory-table tbody tr:hover {
  background: #fffdf4;
}

.teacher-directory-table td > strong,
.teacher-directory-table td > small,
.teacher-directory-table td > a {
  display: block;
}

.teacher-directory-table td > a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.teacher-directory-table td > small,
.teacher-identity small {
  margin-top: .2rem;
  color: var(--muted);
  font-size: .65rem;
}

.teacher-identity {
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: .65rem;
}

.teacher-identity > span {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e8efff;
  color: var(--blue);
  font-size: .67rem;
  font-weight: 950;
}

.teacher-identity strong,
.teacher-identity small {
  display: block;
}

.teacher-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: .35rem;
  white-space: nowrap;
}

.teacher-row-actions form {
  margin: 0;
}

.teacher-row-actions a,
.teacher-row-actions button {
  min-height: 31px;
  padding: .38rem .5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .63rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.teacher-row-actions a {
  border-color: var(--ink);
  background: var(--cream);
}

.teacher-row-actions button:hover {
  border-color: var(--red);
  color: var(--red);
}

/* School years, classrooms, teachers and student registry */
.member-app .school-year-layout {
  grid-template-columns: 220px minmax(0,1fr);
  gap: .9rem;
}

.member-app .school-year-list {
  gap: .5rem;
}

.member-app .school-year-card {
  padding: .75rem .8rem;
  gap: .15rem;
  border-width: 1.5px;
  border-radius: 12px;
  box-shadow: none;
}

.member-app .school-year-card.active {
  box-shadow: 3px 3px 0 var(--ink);
}

.member-app .school-year-card strong {
  font-size: 1.05rem;
}

.member-app .year-summary {
  margin-bottom: .75rem;
  padding: .95rem 1rem;
  border-width: 1.5px;
  border-radius: 13px;
}

.member-app .year-summary h2 {
  margin: .25rem 0 .15rem;
  font-size: 1.65rem;
}

.member-app .registry-classroom-grid {
  gap: .75rem;
}

.member-app .registry-classroom-grid > article,
.member-app .teacher-edit-form,
.member-app .profile-card,
.member-app .registry-edit-card,
.member-app .student-edit-summary {
  padding: .95rem;
  border-width: 1.5px;
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(32,24,18,.05);
}

.member-app .registry-classroom-grid h3 {
  margin: .65rem 0 .15rem;
  font-size: 1.3rem;
}

.member-app .classroom-row,
.member-app .classroom-roster-grid,
.member-app .featured-member-lessons,
.member-app .member-lesson-grid,
.member-app .assignment-grid {
  gap: .72rem;
}

.member-app .classroom-row article,
.member-app .classroom-roster-card,
.member-app .compact-lesson,
.member-app .member-lesson-card,
.member-app .assignment-card {
  border-width: 1.5px;
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(32,24,18,.05);
}

.member-app .compact-lesson {
  min-height: 132px;
  padding: .9rem;
}

.member-app .compact-lesson strong {
  margin-top: 1.4rem;
  font-size: 1.05rem;
}

.member-app .dashboard-section,
.member-app .classroom-admin-section {
  margin-top: 1.55rem;
}

.member-app .dashboard-section-head h2 {
  font-size: 1.55rem;
}

/* CRM-style lists: contacts, actions and excursions */
.member-app .contact-card-grid,
.member-app .activity-card-grid {
  gap: .72rem;
}

.member-app .contact-record-card,
.member-app .activity-record-card {
  padding: .9rem;
  border-width: 1.5px;
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(32,24,18,.05);
}

.member-app .activity-record-card {
  border-top-width: 5px;
}

.member-app .contact-record-card h2,
.member-app .activity-record-card h2 {
  margin: .55rem 0 .25rem;
  font-size: 1.1rem;
}

.member-app .contact-record-card p,
.member-app .activity-record-card p,
.member-app .contact-record-card footer,
.member-app .activity-record-card footer {
  font-size: .7rem;
}

.member-app .activity-record-meta {
  margin: .55rem 0;
  gap: .35rem;
}

.member-app .activity-record-meta span {
  padding: .42rem;
  border-radius: 8px;
  font-size: .62rem;
}

.member-app .activity-record-meta b {
  font-size: .82rem;
}

.member-app .crm-panel {
  border-radius: 16px;
  box-shadow: 8px 8px 0 rgba(32,24,18,.24);
}

.member-app .crm-form {
  padding: clamp(1.1rem,2.5vw,2rem);
}

.member-app .crm-form > h2 {
  margin-bottom: .9rem;
  font-size: 1.65rem;
}

.member-app .crm-form input,
.member-app .crm-form select,
.member-app .crm-form textarea {
  padding: .58rem .65rem;
  border-width: 1.5px;
  border-radius: 8px;
  font-size: .82rem;
}

/* Teacher lesson list: denser controls, tables and cards. */
.lesson-studio-page .studio-home-hero {
  margin-bottom: 1rem;
  align-items: center;
}

.lesson-studio-page .studio-home-hero h1 {
  font-size: clamp(2.2rem,3.5vw,3.8rem);
}

.lesson-studio-page .studio-home-hero p {
  font-size: .9rem;
}

.lesson-studio-page .studio-primary,
.lesson-studio-page .studio-empty a {
  padding: .65rem .9rem;
  border-radius: 9px;
  box-shadow: 2px 2px 0 var(--studio-ink);
  font-size: .76rem;
}

.lesson-studio-page .studio-value-strip {
  margin-bottom: 1rem;
  padding: .8rem 1rem;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  border-width: 1.5px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(32,24,18,.05);
}

.lesson-studio-page .studio-value-strip b {
  font-size: 2rem;
}

.lesson-studio-page .studio-teacher-filters {
  margin-bottom: .8rem;
  padding: .75rem;
  gap: .55rem;
  border-width: 1.5px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(32,24,18,.05);
}

.lesson-studio-page .studio-teacher-filters input,
.lesson-studio-page .studio-teacher-filters select {
  min-height: 38px;
  padding: .48rem .58rem;
  font-size: .78rem;
}

.lesson-studio-page .studio-teacher-filters button,
.lesson-studio-page .studio-teacher-filters a {
  min-height: 38px;
  font-size: .72rem;
}

.lesson-studio-page .studio-teacher-table-wrap {
  border-width: 1.5px;
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(32,24,18,.06);
}

.lesson-studio-page .studio-teacher-table th,
.lesson-studio-page .studio-teacher-table td {
  padding: .68rem .72rem;
}

.lesson-studio-page .studio-table-actions a,
.lesson-studio-page .studio-school-review.compact button {
  padding: .43rem .58rem;
  border-radius: 7px;
  font-size: .65rem;
}

.lesson-studio-page .studio-lesson-grid {
  gap: .75rem;
}

.lesson-studio-page .studio-lesson-card {
  padding: .9rem;
  border-width: 1.5px;
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(32,24,18,.05);
}

.lesson-studio-page .studio-lesson-card > small {
  margin: .8rem 0 .35rem;
}

.lesson-studio-page .studio-lesson-card h2 {
  font-size: 1.35rem;
}

.lesson-studio-page .studio-lesson-card p {
  min-height: 42px;
  font-size: .78rem;
}

.lesson-studio-page .studio-lesson-card footer {
  margin-top: .7rem;
}

.lesson-studio-page .studio-lesson-card footer a {
  padding: .5rem;
  border-radius: 7px;
  font-size: .68rem;
}

/* Login role chooser and the school / teacher sign-in forms */
.login-choice-wrap {
  padding: clamp(1rem, 2.5vw, 2.4rem);
}

.login-choice-intro {
  margin: clamp(1.8rem, 3vw, 3rem) 0 1.25rem;
}

.login-choice-intro h1 {
  font-size: clamp(2.6rem, 4.2vw, 4.4rem);
  line-height: .94;
}

.login-choice-grid {
  gap: .75rem;
}

.login-choice-card {
  min-height: 270px;
  padding: 1.1rem;
  border-width: 2px;
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
}

.login-choice-card .choice-icon {
  width: 52px;
  height: 52px;
  margin: 1rem 0 .65rem;
  border-width: 2px;
  border-radius: 13px;
  font-size: 1rem;
}

.login-choice-card h2 {
  font-size: clamp(1.55rem, 2.2vw, 2.35rem);
}

.login-choice-card p {
  margin: .45rem 0;
  font-size: .86rem;
  line-height: 1.45;
}

.login-choice-card > a,
.login-choice-card .school-choice-actions a {
  font-size: .78rem;
}

.auth-page .auth-layout {
  grid-template-columns: minmax(0, .9fr) minmax(420px, .55fr);
}

.auth-page .auth-visual {
  min-height: 100vh;
  padding: clamp(1.5rem, 3.5vw, 3.5rem);
}

.auth-page .auth-visual h1 {
  font-size: clamp(2.8rem, 4.5vw, 4.7rem);
  line-height: .92;
}

.auth-page .auth-visual > div > p:last-child,
.auth-page .auth-visual blockquote {
  font-size: .98rem;
  line-height: 1.5;
}

.auth-page .auth-panel {
  padding: clamp(1.3rem, 3vw, 2.5rem);
}

.auth-page .auth-box {
  width: min(410px,100%);
}

.auth-page .back-link {
  margin-bottom: 2rem;
  font-size: .76rem;
}

.auth-page .auth-box h2 {
  margin: .25rem 0 1rem;
  font-size: 1.75rem;
}

.auth-page .stack-form {
  gap: .75rem;
}

.auth-page .stack-form input {
  min-height: 42px;
  padding: .62rem .72rem;
  border-width: 1.5px;
  border-radius: 8px;
}

.auth-page .stack-form .button {
  min-height: 42px;
  border-radius: 9px;
}

/* Student / parent sign-in follows the same calmer workspace scale. */
.student-login-shell {
  padding: clamp(1rem, 2.5vw, 2.4rem);
}

.student-login-card {
  width: min(1120px,100%);
  grid-template-columns: minmax(0,1fr) minmax(340px,.6fr);
  border-width: 2px;
  border-radius: 20px;
  box-shadow: 7px 7px 0 var(--ink);
}

.student-login-copy {
  padding: clamp(1.7rem, 4vw, 4rem);
}

.student-login-copy h1 {
  font-size: clamp(2.7rem, 4.8vw, 5rem);
  line-height: .92;
}

.student-login-copy > p:last-of-type {
  font-size: .98rem;
}

.student-login-benefits {
  margin-top: 1.5rem;
}

.student-login-benefits span {
  padding: .48rem .65rem;
  border-width: 1.5px;
  font-size: .69rem;
}

.student-access-form {
  padding: clamp(1.5rem, 3vw, 2.7rem);
}

.student-access-form h2 {
  font-size: clamp(1.9rem, 3vw, 3rem);
}

.student-access-form > p:not(.section-label) {
  margin: .5rem 0 1.2rem;
  font-size: .86rem;
}

.student-access-form input,
.student-access-form button {
  min-height: 44px;
  padding: .65rem .75rem;
  border-width: 1.5px;
  border-radius: 9px;
  font-size: .9rem;
  box-shadow: none;
}

@media (max-width: 1100px) {
  .member-app .school-control-actions {
    grid-template-columns: 1fr 1fr;
  }

  .member-app .school-year-layout {
    grid-template-columns: 1fr;
  }

  .member-app .school-year-list {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }

  .teacher-directory-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .member-app .app-page-heading,
  .member-app .welcome-row {
    align-items: stretch;
    gap: .8rem;
  }

  .member-app .school-control-actions,
  .member-app .school-year-list,
  .member-app .registry-classroom-grid {
    grid-template-columns: 1fr;
  }

  .member-app .stat-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .member-app .school-control-actions > a {
    min-height: 88px;
  }

  .member-app .school-control-actions > a > b {
    padding: .4rem;
    font-size: 0;
  }

  .member-app .school-control-actions > a > b::after {
    content: "→";
    font-size: .8rem;
  }

  .auth-page .auth-layout,
  .student-login-card {
    grid-template-columns: 1fr;
  }

  .auth-page .auth-visual {
    min-height: 380px;
  }

  .student-login-copy {
    min-height: 360px;
  }

  .teacher-directory {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .teacher-directory-toolbar {
    border: 1.5px solid var(--ink);
    border-radius: 12px;
  }

  .teacher-directory-filters {
    grid-template-columns: 1fr 1fr;
  }

  .teacher-directory-filters label:first-child {
    grid-column: 1 / -1;
  }

  .teacher-directory-table-wrap {
    overflow: visible;
  }

  .teacher-directory-table,
  .teacher-directory-table tbody,
  .teacher-directory-table tr,
  .teacher-directory-table td {
    width: 100%;
    display: block;
  }

  .teacher-directory-table {
    min-width: 0;
  }

  .teacher-directory-table thead {
    display: none;
  }

  .teacher-directory-table tr {
    margin-top: .65rem;
    padding: .65rem;
    border: 1.5px solid var(--ink);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(32,24,18,.05);
  }

  .teacher-directory-table td {
    padding: .55rem .45rem .55rem 8.5rem;
    position: relative;
    border-bottom: 1px solid #ebe6de;
  }

  .teacher-directory-table td::before {
    content: attr(data-label);
    position: absolute;
    left: .45rem;
    top: .62rem;
    width: 7.4rem;
    color: var(--muted);
    font-size: .58rem;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .teacher-directory-table td:last-child {
    padding-left: .45rem;
    border-bottom: 0;
  }

  .teacher-directory-table td:last-child::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .member-app .stat-grid article {
    min-height: 78px;
    padding: .65rem .7rem;
  }

  .member-app .stat-grid article > strong {
    font-size: 1.55rem;
  }

  .member-app .stat-grid article > a {
    padding: .32rem .42rem;
    font-size: .59rem;
  }

  .member-app .school-control-actions > a {
    grid-template-columns: 30px minmax(0,1fr) auto;
    padding: .8rem;
  }

  .member-app .school-control-actions > a > span {
    width: 30px;
    height: 30px;
  }

  .teacher-directory-summary {
    display: grid;
    grid-template-columns: repeat(3,1fr);
  }

  .teacher-directory-summary > div {
    min-width: 0;
  }

  .teacher-directory-filters {
    grid-template-columns: 1fr;
  }

  .teacher-directory-filters label:first-child {
    grid-column: auto;
  }

  .teacher-directory-table td {
    padding-left: .45rem;
  }

  .teacher-directory-table td::before {
    position: static;
    width: auto;
    margin-bottom: .25rem;
    display: block;
  }
}

/* ================================================================
   v160 · Unified corporate registries
   One calm, dense language for school, teacher and student records.
   ================================================================ */
.member-app .corporate-registry,
.lesson-studio-page .corporate-registry {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto 1.25rem;
  border: 1px solid #d9d1c6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(32,24,18,.055);
  overflow: hidden;
}

.member-app .corporate-table-wrap,
.lesson-studio-page .corporate-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.member-app .corporate-table,
.lesson-studio-page .corporate-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: .79rem;
}

.member-app .corporate-table th,
.lesson-studio-page .corporate-table th {
  padding: .7rem .8rem;
  border-bottom: 1px solid #d9d1c6;
  background: #f5f1e9;
  color: #6c6258;
  font-size: .59rem;
  font-weight: 950;
  letter-spacing: .075em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.member-app .corporate-table td,
.lesson-studio-page .corporate-table td {
  padding: .74rem .8rem;
  border-bottom: 1px solid #ebe6de;
  color: var(--ink);
  line-height: 1.35;
  vertical-align: middle;
}

.member-app .corporate-table tbody tr:last-child td,
.lesson-studio-page .corporate-table tbody tr:last-child td {
  border-bottom: 0;
}

.member-app .corporate-table tbody tr:hover,
.lesson-studio-page .corporate-table tbody tr:hover {
  background: #fffdf6;
}

.member-app .corporate-table tr.is-muted,
.lesson-studio-page .corporate-table tr.is-muted {
  opacity: .62;
}

.member-app .corporate-table td > strong,
.member-app .corporate-table td > small,
.lesson-studio-page .corporate-table td > strong,
.lesson-studio-page .corporate-table td > small {
  display: block;
}

.member-app .corporate-table td > strong,
.lesson-studio-page .corporate-table td > strong {
  font-size: .82rem;
  font-weight: 900;
}

.member-app .corporate-table td > small,
.lesson-studio-page .corporate-table td > small {
  max-width: 36rem;
  margin-top: .16rem;
  color: #776d63;
  font-size: .67rem;
  line-height: 1.35;
}

.member-app .corporate-action,
.lesson-studio-page .corporate-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: .38rem .62rem;
  border: 1px solid #cfc6ba;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: .67rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.member-app .corporate-action:hover,
.lesson-studio-page .corporate-action:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.member-app .corporate-action.secondary,
.lesson-studio-page .corporate-action.secondary {
  background: #f7f3ec;
}

.corporate-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.corporate-contact-links {
  display: grid;
  gap: .16rem;
}

.corporate-contact-links a,
.corporate-contact-links span {
  color: inherit;
  font-size: .71rem;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.member-app .registry-count {
  width: max-content;
  min-width: 118px;
  margin: 0 0 .55rem auto;
  padding: .4rem .68rem;
  display: flex;
  align-items: baseline;
  gap: .35rem;
  border: 1px solid #d8cfc3;
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
}

.member-app .registry-count strong {
  font-size: 1rem;
}

.member-app .registry-count span {
  font-size: .64rem;
  font-weight: 800;
}

.member-app .empty-state.compact {
  min-height: 160px;
  padding: 1.5rem;
}

/* Filters behave as compact toolbars rather than oversized form cards. */
.member-app .crm-filters,
.member-app .student-registry-filters,
.member-app .assignment-filters,
.lesson-studio-page .studio-teacher-filters {
  max-width: 1500px;
  margin-inline: auto;
  padding: .72rem;
  gap: .55rem;
  border: 1px solid #d9d1c6;
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(32,24,18,.035);
}

.member-app .crm-filters input,
.member-app .crm-filters select,
.member-app .student-registry-filters input,
.member-app .student-registry-filters select,
.member-app .assignment-filters select,
.lesson-studio-page .studio-teacher-filters input,
.lesson-studio-page .studio-teacher-filters select {
  min-height: 36px;
  padding: .42rem .55rem;
  border: 1px solid #bfb5a8;
  border-radius: 8px;
  box-shadow: none;
  font-size: .75rem;
}

.member-app .crm-filters .button,
.member-app .student-registry-filters .button,
.member-app .assignment-filters button,
.lesson-studio-page .studio-teacher-filters button {
  min-height: 36px;
  padding: .45rem .72rem;
  border-radius: 8px;
  box-shadow: none;
  font-size: .7rem;
}

/* Assignments are operational rows, with details opening only on demand. */
.member-app .assignment-grid {
  max-width: 1500px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
}

.member-app .assignment-card {
  padding: .8rem .9rem;
  display: grid;
  grid-template-columns: minmax(210px,1.5fr) minmax(150px,.7fr) minmax(190px,.9fr);
  gap: .55rem 1rem;
  border: 1px solid #d9d1c6;
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(32,24,18,.04);
}

.member-app .assignment-card-head {
  grid-column: 1 / -1;
  justify-content: flex-start;
  gap: .6rem;
}

.member-app .assignment-card h2 {
  grid-column: 1;
  margin: .15rem 0 0;
  font-size: 1rem;
}

.member-app .assignment-card > p {
  grid-column: 1;
  font-size: .72rem;
}

.member-app .assignment-code {
  grid-column: 2;
  grid-row: 2 / span 2;
  margin: 0;
  padding: .55rem .7rem;
  border: 1px solid #d7c477;
  border-radius: 9px;
}

.member-app .assignment-code strong {
  font-size: 1.15rem;
}

.member-app .assignment-mail-status {
  grid-column: 3;
  align-self: center;
  font-size: .67rem;
}

.member-app .assignment-roster {
  grid-column: 1 / -1;
  margin: .1rem 0;
}

.member-app .assignment-roster summary {
  padding: .5rem .65rem;
  border: 1px solid #ded6ca;
  border-radius: 8px;
  background: #f9f6f0;
  font-size: .7rem;
}

.member-app .assignment-card > footer {
  grid-column: 1 / -1;
  padding-top: .55rem;
  font-size: .69rem;
}

.member-app .assignment-actions button {
  min-height: 30px;
  padding: .35rem .55rem;
  border: 1px solid #d2c8bb;
  border-radius: 7px;
}

.member-app .submission-list {
  max-width: 1500px;
  margin-inline: auto;
  gap: .55rem;
}

.member-app .submission-card {
  grid-template-columns: 62px minmax(260px,1fr) minmax(220px,.65fr);
  padding: .7rem .8rem;
  border: 1px solid #d9d1c6;
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(32,24,18,.035);
}

.member-app .submission-score {
  width: 54px;
  height: 54px;
  border-width: 1px;
  font-size: .78rem;
}

/* Teacher lesson lists share the same table rhythm. */
.lesson-studio-page .studio-my-lessons .corporate-table {
  min-width: 900px;
}

.lesson-studio-page .studio-my-lessons .corporate-table td:first-child {
  width: 34%;
}

.lesson-studio-page .studio-review-note {
  margin-top: .35rem !important;
  padding: .35rem .45rem !important;
  border-left: 3px solid #bd7b00;
  background: #fff7da;
}

/* Student portal: compact dashboard indicators and task rows. */
.student-portal-wrap {
  width: min(1320px,calc(100% - 2rem));
}

.student-welcome {
  min-height: 142px;
  padding: 1.15rem 1.3rem;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 1rem;
  border-width: 1.5px;
  border-radius: 16px;
  box-shadow: 4px 4px 0 var(--ink);
}

.student-welcome h1 {
  margin: .22rem 0;
  font-size: clamp(2rem,4.2vw,3.5rem);
  line-height: .95;
}

.student-welcome p:last-child {
  margin-bottom: 0;
  font-size: .86rem;
}

.student-avatar {
  width: clamp(74px,8vw,104px);
  height: clamp(74px,8vw,104px);
  border-width: 1.5px;
  font-size: clamp(2.3rem,4vw,3.5rem);
  box-shadow: 4px 4px 0 #fff;
}

.student-status-grid {
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: .65rem;
}

.student-status-grid a {
  min-height: 92px;
  padding: .8rem .9rem;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: .2rem .75rem;
  border-width: 1px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(32,24,18,.04);
}

.student-status-grid a span,
.student-status-grid a small {
  grid-column: 1;
}

.student-status-grid a strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 2rem;
}

.student-task-section {
  padding: 1rem;
  border-width: 1.5px;
  border-radius: 15px;
}

.student-task-section h2 {
  font-size: clamp(1.65rem,3vw,2.6rem);
}

.student-task-section > header > span {
  padding: .4rem .6rem;
  border-width: 1px;
}

.student-task-list {
  gap: .55rem;
}

.student-task-card {
  padding: .72rem .8rem;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: .75rem;
  border-width: 1px;
  border-radius: 11px;
  box-shadow: 0 4px 14px rgba(32,24,18,.035);
}

.student-task-mark {
  width: 38px;
  height: 38px;
  border-width: 1px;
  border-radius: 9px;
  font-size: 1.05rem;
}

.student-task-copy h3 {
  margin: .22rem 0 .1rem;
  font-size: 1rem;
}

.student-task-copy > p {
  font-size: .76rem;
}

.student-task-copy footer {
  margin-top: .35rem;
}

.student-task-action a,
.student-task-action span {
  min-width: 108px;
  padding: .5rem .65rem;
  border-width: 1px;
  border-radius: 8px;
  font-size: .62rem;
}

@media (max-width: 1000px) {
  .member-app .assignment-card {
    grid-template-columns: minmax(0,1fr) 170px;
  }

  .member-app .assignment-code {
    grid-column: 2;
  }

  .member-app .assignment-mail-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .member-app .corporate-registry,
  .lesson-studio-page .corporate-registry {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .member-app .corporate-table-wrap,
  .lesson-studio-page .corporate-table-wrap {
    overflow: visible;
  }

  .member-app .corporate-table,
  .member-app .corporate-table tbody,
  .member-app .corporate-table tr,
  .member-app .corporate-table td,
  .lesson-studio-page .corporate-table,
  .lesson-studio-page .corporate-table tbody,
  .lesson-studio-page .corporate-table tr,
  .lesson-studio-page .corporate-table td {
    width: 100%;
    display: block;
  }

  .member-app .corporate-table,
  .lesson-studio-page .corporate-table {
    min-width: 0;
  }

  .member-app .corporate-table thead,
  .lesson-studio-page .corporate-table thead {
    display: none;
  }

  .member-app .corporate-table tr,
  .lesson-studio-page .corporate-table tr {
    margin-bottom: .6rem;
    padding: .55rem .65rem;
    border: 1px solid #d9d1c6;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(32,24,18,.04);
  }

  .member-app .corporate-table td,
  .lesson-studio-page .corporate-table td {
    min-height: 32px;
    padding: .46rem .35rem .46rem 7.6rem;
    position: relative;
    border-bottom: 1px solid #eee9e1;
  }

  .member-app .corporate-table td::before,
  .lesson-studio-page .corporate-table td::before {
    content: attr(data-label);
    width: 6.7rem;
    position: absolute;
    top: .51rem;
    left: .35rem;
    color: #766c62;
    font-size: .56rem;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .member-app .corporate-table td:last-child,
  .lesson-studio-page .corporate-table td:last-child {
    border-bottom: 0;
  }

  .member-app .crm-filters,
  .member-app .student-registry-filters,
  .member-app .assignment-filters,
  .lesson-studio-page .studio-teacher-filters {
    grid-template-columns: 1fr 1fr;
  }

  .member-app .assignment-card {
    display: block;
  }

  .member-app .assignment-card > * + * {
    margin-top: .55rem;
  }

  .member-app .assignment-code {
    width: min(210px,100%);
  }

  .member-app .assignment-card > footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .member-app .submission-card {
    grid-template-columns: 48px minmax(0,1fr);
  }

  .member-app .submission-card > :last-child {
    grid-column: 1 / -1;
  }

  .student-status-grid {
    grid-template-columns: 1fr;
  }

  .student-task-card {
    grid-template-columns: 38px minmax(0,1fr);
  }

  .student-task-action {
    grid-column: 2;
  }
}

@media (max-width: 480px) {
  .member-app .corporate-table td,
  .lesson-studio-page .corporate-table td {
    padding-left: .35rem;
  }

  .member-app .corporate-table td::before,
  .lesson-studio-page .corporate-table td::before {
    width: auto;
    margin-bottom: .2rem;
    display: block;
    position: static;
  }

  .member-app .crm-filters,
  .member-app .student-registry-filters,
  .member-app .assignment-filters,
  .lesson-studio-page .studio-teacher-filters {
    grid-template-columns: 1fr;
  }

  .student-portal-wrap {
    width: min(100% - 1rem,1320px);
  }

  .student-welcome {
    min-height: 116px;
    padding: .9rem;
    display: grid;
    grid-template-columns: minmax(0,1fr) 58px;
    align-items: center;
    border-radius: 13px;
  }

  .student-welcome h1 {
    font-size: 1.75rem;
  }

  .student-welcome p:last-child {
    font-size: .73rem;
  }

  .student-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.65rem;
  }

  .student-task-card {
    grid-template-columns: 1fr;
  }

  .student-task-action {
    grid-column: auto;
  }
}
