:root {
  --ema-color-bg: #f8fafc;
  --ema-color-card: #ffffff;
  --ema-color-border: #d1d5db;
  --ema-color-text: #111827;
  --ema-color-muted: #6b7280;
  --ema-color-white: #ffffff;
  --ema-color-progress-track: #e5e7eb;
  --ema-color-table-head: #f3f4f6;
  --ema-color-membership-bg: #fffbeb;
  --ema-color-student: #2563eb;
  --ema-color-coach: #0d9488;
  --ema-color-parent: #d97706;
  --ema-color-active: #16a34a;
  --ema-color-pending: #d97706;
  --ema-color-suspended: #dc2626;
}
* {
	box-sizing: border-box;
}
.ema-layout {
  display: flex;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.ema-sidebar {
  width: 240px;
}

.ema-auth {
  display: flex;
  justify-content: center;
  padding: 24px 12px;
  background: var(--ema-color-bg);
}

.ema-auth,
.ema-auth * {
  box-sizing: border-box;
}

.ema-auth__card {
  width: 100%;
  background: var(--ema-color-card);
  border: 1px solid var(--ema-color-border);
  border-radius: 12px;
  padding: 16px;
}

.ema-auth__title {
  margin: 0 0 8px;
  color: var(--ema-color-text);
  font-size: 24px;
}

.ema-auth__subtitle,
.ema-auth__footer,
.ema-form__label {
  color: var(--ema-color-muted);
}

.ema-auth__logo {
  text-align: center;
  margin-bottom: 12px;
}

.ema-auth__logo img {
  max-height: 60px;
  width: auto;
}

.ema-auth__link {
  color: var(--ema-color-coach);
  text-decoration: none;
}

.ema-auth__link--button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.ema-auth__link:hover {
  text-decoration: underline;
}

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

.ema-form__row > * {
  min-width: 0;
}

.ema-form__field {
  margin-bottom: 12px;
}

.ema-form__label {
  display: block;
  margin-bottom: 6px;
}

.ema-form__checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ema-form__input,
.ema-form select,
.ema-form textarea {
  width: 100%;
  border: 1px solid var(--ema-color-border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ema-color-text);
  background: var(--ema-color-card);
}

.ema-form__input:focus,
.ema-form select:focus,
.ema-form textarea:focus {
  outline: none;
  border-color: var(--ema-color-coach);
}

.ema-form__actions {
  margin-top: 10px;
}

.ema-form__notice {
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--ema-color-border);
  border-radius: 10px;
  color: var(--ema-color-muted);
}

.ema-form__message {
  margin-top: 8px;
  min-height: 18px;
}

.ema-form__message--error {
  color: var(--ema-color-suspended);
}

.ema-form__message--success {
  color: var(--ema-color-active);
}

.ema-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid var(--ema-color-border);
  padding: 10px 16px;
  background: var(--ema-color-card);
  color: var(--ema-color-text);
  cursor: pointer;
  text-decoration: none;
}

.ema-btn--primary,
.ema-btn--coach {
  background: var(--ema-color-coach);
  border-color: var(--ema-color-coach);
  color: var(--ema-color-white);
}

.ema-btn--student {
  background: var(--ema-color-student);
  border-color: var(--ema-color-student);
  color: var(--ema-color-white);
}

.ema-btn--parent {
  background: var(--ema-color-parent);
  border-color: var(--ema-color-parent);
  color: var(--ema-color-white);
}

.ema-section {
  margin-top: 16px;
}

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

.ema-progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--ema-color-progress-track);
}

.ema-progress__bar {
  height: 100%;
  background: var(--ema-color-coach);
}

.ema-progress__bar--student {
  background: var(--ema-color-student);
}

.ema-progress__bar--parent {
  background: var(--ema-color-parent);
}

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

.ema-course-card,
.ema-feedback-item,
.ema-notice {
  border: 1px solid var(--ema-color-border);
  border-radius: 10px;
  background: var(--ema-color-card);
  padding: 12px;
}

.ema-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--ema-color-white);
  font-size: 12px;
  font-weight: 700;
}

.ema-status-badge--active {
  background: var(--ema-color-active);
}

.ema-status-badge--pending {
  background: var(--ema-color-pending);
}

.ema-status-badge--suspended {
  background: var(--ema-color-suspended);
}

.ema-notice--membership {
  border-color: var(--ema-color-parent);
  background: var(--ema-color-membership-bg);
}

.ema-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.ema-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.ema-modal__dialog {
  position: relative;
  max-width: 560px;
  width: calc(100% - 24px);
  margin: 8vh auto 0;
  background: var(--ema-color-card);
  border: 1px solid var(--ema-color-border);
  border-radius: 12px;
  padding: 20px;
}

.ema-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--ema-color-muted);
}

.ema-modal__title {
  margin: 0 0 12px;
  color: var(--ema-color-text);
}

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

body.ema-modal-open {
  overflow: hidden;
}

.ema-membership-lock {
  font-size: 28px;
  margin-bottom: 6px;
}

.ema-table {
  width: 100%;
  border-collapse: collapse;
}

.ema-table th,
.ema-table td {
  border: 1px solid var(--ema-color-border);
  padding: 8px 10px;
  text-align: left;
}

.ema-table th {
  background: var(--ema-color-table-head);
}

.ema-child-tab.is-active {
  background: var(--ema-color-parent);
  border-color: var(--ema-color-parent);
  color: var(--ema-color-white);
}

.ema-coach-dashboard {
  align-items: flex-start;
}

.ema-coach-sidebar {
  position: sticky;
  top: 20px;
}

.ema-coach-profile {
  padding: 16px;
  border: 1px solid var(--ema-color-border);
  border-radius: 12px;
  background: var(--ema-color-card);
  text-align: center;
  margin-bottom: 12px;
}

.ema-coach-profile__avatar {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  margin-bottom: 8px;
}

.ema-coach-profile__name {
  margin: 0;
}

.ema-coach-profile__meta,
.ema-coach-profile__role {
  margin: 4px 0 0;
  color: var(--ema-color-muted);
}

.ema-coach-nav {
  border: 1px solid var(--ema-color-border);
  border-radius: 12px;
  background: var(--ema-color-card);
  overflow: hidden;
}

.ema-coach-nav__link {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ema-color-text);
  border-bottom: 1px solid var(--ema-color-border);
}

.ema-coach-nav__link:last-child {
  border-bottom: 0;
}

.ema-coach-nav__link.is-active,
.ema-coach-nav__link:hover {
  background: var(--ema-color-coach);
  color: var(--ema-color-white);
}

.ema-coach-main {
  flex: 1;
}

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

.ema-coach-header__title {
  margin: 0;
}

.ema-coach-header__subtitle {
  margin: 4px 0 0;
  color: var(--ema-color-muted);
}

.ema-coach-header__search {
  min-width: 260px;
}

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

.ema-coach-stat__label {
  display: block;
  color: var(--ema-color-muted);
}

.ema-coach-stat__value {
  font-size: 30px;
  font-weight: 700;
}

.ema-coach-stat__value--warn {
  color: var(--ema-color-pending);
}

.ema-coach-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.ema-coach-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ema-coach-card__hint {
  color: var(--ema-color-muted);
  font-size: 12px;
}

.ema-table-wrapper {
  overflow-x: auto;
}

.ema-coach-table tbody tr {
  cursor: pointer;
}

.ema-coach-table tbody tr.is-active {
  background: var(--ema-color-membership-bg);
}

.ema-coach-detail-panel {
  position: sticky;
  top: 20px;
}

.ema-coach-detail__meta {
  margin-top: 4px;
  color: var(--ema-color-muted);
}

.ema-coach-detail__courses {
  margin: 10px 0;
}

.ema-coach-detail__course {
  border: 1px solid var(--ema-color-border);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 8px;
}

.ema-coach-detail__recent h4 {
  margin-bottom: 8px;
}

.ema-coach-shell {
  display: flex;
  min-height: 100vh;
  background: #f8f9fb;
}

.ema-coach-shell__sidebar {
  width: 260px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 20px 14px;
}

.ema-coach-shell__brand {
  padding: 8px 8px 14px;
}

.ema-coach-shell__brand h2 {
  margin: 0;
  color: #0d9488;
}

.ema-coach-shell__brand p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.ema-coach-shell__nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
}

.ema-coach-shell__nav a:hover,
.ema-coach-shell__nav a.is-active {
  background: #ecfeff;
  color: #0d9488;
}

.ema-coach-shell__main {
  flex: 1;
  min-width: 0;
}

.ema-coach-shell__topbar {
  height: 64px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  position: sticky;
  top: 0;
  z-index: 8;
}

.ema-coach-shell__search {
  width: 100%;
  max-width: 420px;
}

.ema-coach-shell__profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ema-coach-shell__profile p {
  margin: 2px 0 0;
  color: #64748b;
  font-size: 12px;
}

.ema-coach-shell__profile img {
  width: 38px;
  height: 38px;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .ema-coach-shell {
    display: block;
  }

  .ema-coach-shell__sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .ema-coach-shell__topbar {
    display: block;
    height: auto;
  }

  .ema-coach-shell__search {
    max-width: none;
    margin-bottom: 8px;
  }

  .ema-layout {
    display: block;
    padding: 12px;
  }

  .ema-sidebar {
    width: 100%;
    margin-bottom: 12px;
  }

  .ema-form__row,
  .ema-course-grid,
  .ema-stat-cards,
  .ema-coach-stats,
  .ema-coach-grid {
    grid-template-columns: 1fr;
  }

  .ema-modal__actions {
    grid-template-columns: 1fr;
  }

  .ema-coach-header {
    display: block;
  }

  .ema-coach-header__search {
    min-width: 0;
    margin-top: 10px;
  }
}

