:root {
  --bg: #f4f7fb;
  --bg-soft: #eef3fa;
  --sidebar: #0f1f36;
  --sidebar-strong: #0a1629;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --panel: #ffffff;
  --panel-soft: #f8fbff;
  --panel-border: #e4ebf5;
  --text: #1d2a3b;
  --muted: #74839a;
  --blue: #287dff;
  --blue-deep: #1655c9;
  --blue-soft: rgba(40, 125, 255, 0.1);
  --green: #17a673;
  --green-soft: rgba(23, 166, 115, 0.12);
  --orange: #ff8e3c;
  --orange-soft: rgba(255, 142, 60, 0.12);
  --red: #eb5757;
  --red-soft: rgba(235, 87, 87, 0.12);
  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, 0.12);
  --pink: #ec4899;
  --pink-soft: rgba(236, 72, 153, 0.12);
  --shadow-lg: 0 24px 50px rgba(21, 38, 71, 0.08);
  --shadow-md: 0 14px 30px rgba(16, 38, 74, 0.06);
  --shadow-sm: 0 4px 12px rgba(16, 38, 74, 0.04);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Noto Sans SC", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(40, 125, 255, 0.12), transparent 35%),
    radial-gradient(circle at 100% 0%, rgba(139, 92, 246, 0.08), transparent 30%),
    radial-gradient(circle at 100% 100%, rgba(23, 166, 115, 0.06), transparent 25%),
    radial-gradient(circle at 0% 100%, rgba(236, 72, 153, 0.04), transparent 20%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #eef2f7 100%);
  background-attachment: fixed;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.hidden {
  display: none !important;
}

.dashboard-shell {
  min-height: 100vh;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.12;
}

p {
  margin: 0;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #3e97ff);
  box-shadow: 0 14px 28px rgba(40, 125, 255, 0.22);
}

.primary-btn:hover {
  box-shadow: 0 18px 36px rgba(40, 125, 255, 0.3);
}

.secondary-btn {
  color: var(--text);
  border: 1px solid var(--panel-border);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.secondary-btn:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 16px rgba(40, 125, 255, 0.12);
}

.secondary-btn.active-toggle {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), #3e97ff);
  box-shadow: 0 14px 28px rgba(40, 125, 255, 0.18);
}

.warn-btn {
  color: var(--red);
  background: #fff;
  border: 1px solid rgba(235, 87, 87, 0.18);
}

.ghost-btn {
  color: var(--text);
  border: 1px dashed #cfd9e8;
  background: #f8fbff;
}

.wide-btn {
  width: 100%;
}

.message-text,
.teacher-meta,
.student-meta,
.session-meta,
.hero-copy,
.week-day-meta,
.planner-meta,
.slot-meta,
.slot-booking-name,
.slot-booking-cta {
  color: var(--muted);
}

.login-screen {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  place-items: center;
}

.login-stage {
  width: min(1360px, 100%);
  display: grid;
  grid-template-columns: 1.4fr minmax(360px, 420px);
  gap: 24px;
}

.login-brand,
.login-panel {
  border: 1px solid rgba(228, 235, 245, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: 34px;
  min-height: 640px;
  background:
    linear-gradient(180deg, rgba(11, 26, 46, 0.04), rgba(255, 255, 255, 0)),
    linear-gradient(135deg, #ffffff 0%, #f3f8ff 100%);
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 280px;
  height: 280px;
  border-radius: 38px;
  background: linear-gradient(135deg, rgba(40, 125, 255, 0.12), rgba(23, 166, 115, 0.08));
  transform: rotate(-12deg);
  animation: float 6s ease-in-out infinite;
}

.login-brand::before {
  content: "";
  position: absolute;
  left: -60px;
  top: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.06));
  animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-12deg); }
  50% { transform: translateY(-10px) rotate(-8deg); }
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(244, 248, 255, 0.9);
  border: 1px solid #e7eef8;
}

.brand-mark,
.sidebar-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #53a6ff);
  box-shadow: 0 8px 20px rgba(40, 125, 255, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.brand-mark:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(40, 125, 255, 0.45);
}

.login-brand h1 {
  font-size: clamp(28px, 4vw, 44px);
}

.login-brand h2 {
  max-width: 780px;
  margin-top: 34px;
  font-size: clamp(30px, 4vw, 54px);
}

.hero-copy {
  max-width: 760px;
  margin-top: 18px;
  line-height: 1.8;
  font-size: 16px;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
  position: relative;
  z-index: 1;
}

.metric-card,
.account-card {
  padding: 20px;
  border-radius: 18px;
  border: 1px solid #e5edf8;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.metric-card::before,
.account-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric-card:hover,
.account-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(21, 38, 71, 0.12);
}

.metric-card:hover::before,
.account-card:hover::before {
  opacity: 1;
}

.metric-card span,
.account-card span {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

.metric-card strong,
.account-card strong {
  font-size: 17px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.login-panel {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.login-panel-head p:last-child {
  margin-top: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid #dfe7f2;
  background: #fbfdff;
  color: var(--text);
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.field textarea {
  resize: vertical;
}

.field input:hover,
.field textarea:hover {
  border-color: #c5d4e8;
  background: #ffffff;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(40, 125, 255, 0.12), 0 4px 12px rgba(40, 125, 255, 0.08);
  background: #ffffff;
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.workspace-sidebar {
  padding: 20px 18px;
  color: #e4edf8;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 14%),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-strong) 100%);
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 8px 20px;
}

.sidebar-brand .eyebrow,
.sidebar-footnote .eyebrow {
  color: rgba(228, 237, 248, 0.58);
}

.sidebar-brand h2 {
  color: #fff;
  font-size: 22px;
}

.nav-menu {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px;
  border-radius: 14px;
  color: rgba(228, 237, 248, 0.82);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.nav-item:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(40, 125, 255, 0.28), rgba(40, 125, 255, 0.12));
  border-color: rgba(91, 160, 255, 0.22);
}

.nav-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.22);
}

.sidebar-footnote {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footnote ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: rgba(228, 237, 248, 0.8);
  line-height: 1.8;
}

/* Sidebar Logout Button - Desktop Only */
.sidebar-logout {
  margin-top: auto;
  margin-top: 20px;
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  min-height: 44px;
  border-radius: 12px;
  font-size: 14px;
}

.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.workspace-main {
  min-width: 0;
  padding: 22px;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 6px 24px;
}

.workspace-header h1 {
  font-size: clamp(28px, 4vw, 40px);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-badge,
.session-card {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
}

.session-card {
  display: grid;
  gap: 4px;
}

.workspace-content,
.role-view {
  display: grid;
  gap: 18px;
}

.panel {
  border-radius: 22px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.panel:hover {
  box-shadow: 0 20px 50px rgba(21, 38, 71, 0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 20px 22px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: var(--shadow-md);
}

.stat-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  font-size: 30px;
}

.stat-card em {
  display: block;
  margin-top: 10px;
  font-style: normal;
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  gap: 18px;
}

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

.admin-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.95fr);
}

.content-stack {
  display: grid;
  gap: 18px;
}

.admin-subview {
  display: grid;
  gap: 18px;
}

.student-subview {
  display: grid;
  gap: 18px;
}

.teacher-subview {
  display: grid;
  gap: 18px;
}

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

.system-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.system-notice {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(28, 161, 116, 0.22);
  background: linear-gradient(180deg, #f1fff8 0%, #e8fbf2 100%);
  color: #156848;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 14px 28px rgba(21, 104, 72, 0.08);
}

.system-notice strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.system-action-btn {
  min-height: 52px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.system-action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(40, 125, 255, 0.22);
  box-shadow: 0 14px 28px rgba(40, 125, 255, 0.1);
}

.system-action-btn.warn-action {
  color: var(--red);
  background: linear-gradient(180deg, #fff7f6 0%, #fff1ef 100%);
  border-color: rgba(224, 78, 57, 0.14);
}

.system-action-btn.primary-action {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #66aeff);
  border-color: transparent;
}

.system-action-icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(40, 125, 255, 0.1);
  color: var(--blue-deep);
}

.system-action-btn.warn-action .system-action-icon {
  background: rgba(224, 78, 57, 0.12);
  color: var(--red);
}

.system-action-btn.primary-action .system-action-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.system-action-copy {
  display: grid;
  gap: 4px;
}

.system-action-copy strong {
  font-size: 14px;
}

.system-action-copy em {
  font-style: normal;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.system-action-btn.warn-action .system-action-copy em,
.system-action-btn.primary-action .system-action-copy em {
  color: inherit;
  opacity: 0.88;
}

.overview-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.overview-card h4 {
  margin-bottom: 10px;
}

.overview-card p {
  color: var(--muted);
  line-height: 1.7;
}

.log-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.log-summary-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.log-summary-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.log-summary-card strong {
  display: block;
  font-size: 22px;
}

.log-summary-card em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.sidebar-panel,
.feature-panel,
.admin-panel,
.booking-panel,
.teacher-panel {
  padding: 22px;
}

.panel-head,
.toolbar,
.table-header,
.teacher-card-head,
.teacher-admin-head,
.booking-card-head,
.slot-row,
.student-row,
.teacher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar {
  flex-wrap: wrap;
}

.pagination-bar {
  justify-content: space-between;
  margin-top: 12px;
}

.inline-field {
  width: auto;
  min-width: 140px;
}

.inline-field span {
  font-size: 12px;
}

.teacher-list,
.admin-teacher-list,
.booking-board,
.student-table,
.teacher-week-grid {
  display: grid;
  gap: 14px;
}

#bookingBoard {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.teacher-directory-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.compact-five-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.teacher-card,
.teacher-admin-card,
.booking-card,
.student-row,
.log-item,
.week-day-card {
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.teacher-card {
  padding: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.teacher-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.teacher-card:hover,
.teacher-card.active {
  transform: translateY(-4px);
  border-color: rgba(40, 125, 255, 0.3);
  box-shadow: 0 24px 40px rgba(40, 125, 255, 0.15);
}

.teacher-card:hover::before,
.teacher-card.active::before {
  opacity: 1;
}

.teacher-directory-card {
  position: relative;
  min-height: 156px;
  padding: 12px;
}

.teacher-directory-card.active {
  border-color: rgba(40, 125, 255, 0.46);
  background: linear-gradient(180deg, #f7fbff 0%, #edf5ff 100%);
  box-shadow: 0 18px 30px rgba(40, 125, 255, 0.16);
}

.teacher-directory-card.active::after {
  content: "当前查看";
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.teacher-admin-card,
.booking-card,
.week-day-card {
  padding: 18px;
}

.teacher-admin-card {
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.teacher-admin-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.teacher-admin-card:hover {
  transform: translateY(-4px);
  border-color: rgba(40, 125, 255, 0.3);
  box-shadow: 0 24px 40px rgba(40, 125, 255, 0.12);
}

.teacher-admin-card:hover::before {
  opacity: 1;
}

.teacher-admin-card.is-selected {
  border-color: rgba(40, 125, 255, 0.42);
  background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
  box-shadow: 0 20px 36px rgba(40, 125, 255, 0.16);
}

.teacher-admin-card.is-selected::after {
  content: "当前查看";
  position: absolute;
  top: 16px;
  right: 16px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(40, 125, 255, 0.24);
}

#adminTeacherList.compact-five-grid .teacher-admin-card {
  padding: 12px;
}

#adminTeacherList.compact-five-grid .teacher-name {
  font-size: 15px;
}

#adminTeacherList.compact-five-grid .teacher-meta {
  font-size: 12px;
  line-height: 1.45;
}

#adminTeacherList.compact-five-grid .avatar-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

#adminTeacherList.compact-five-grid .teacher-admin-card.is-selected::after {
  top: 10px;
  right: 10px;
  min-height: 24px;
  padding: 0 10px;
  font-size: 11px;
}

.booking-summary-card {
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.booking-summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(40, 125, 255, 0.22);
  box-shadow: 0 18px 30px rgba(40, 125, 255, 0.1);
}

.booking-summary-card.is-selected {
  border-color: rgba(40, 125, 255, 0.42);
  background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
  box-shadow: 0 20px 36px rgba(40, 125, 255, 0.16);
}

.avatar-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #66aeff);
}

.avatar-placeholder {
  gap: 2px;
  padding: 4px;
}

.avatar-placeholder em {
  font-size: 9px;
  font-style: normal;
  opacity: 0.88;
}

.teacher-avatar {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: #eef4ff;
}

.teacher-avatar.compact-avatar,
.avatar-placeholder.compact-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.avatar-placeholder.compact-avatar em {
  display: none;
}

.teacher-name {
  font-size: 20px;
  font-weight: 800;
}

.teacher-directory-card .teacher-name {
  font-size: 15px;
}

.teacher-directory-card .teacher-meta {
  font-size: 12px;
  line-height: 1.45;
}

.teacher-directory-card .teacher-select-row {
  gap: 6px;
}

.tag-list,
.teacher-select-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.teacher-profile-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tag,
.status-pill,
.teacher-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag {
  color: var(--blue-deep);
  background: var(--blue-soft);
  transition: all 0.2s ease;
}

.tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(40, 125, 255, 0.15);
}

.status-pill {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.hidden-status {
  color: var(--red);
  background: var(--red-soft);
}

.teacher-detail {
  display: grid;
  gap: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
}

.detail-card,
.schedule-card,
.table-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: var(--panel-soft);
}

.detail-card p,
.schedule-card p {
  line-height: 1.8;
}

.detail-copy.collapsed {
  max-height: 112px;
  overflow: hidden;
  position: relative;
}

.detail-copy.collapsed::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48px;
  background: linear-gradient(180deg, transparent, #f8fbff);
}

.empty-state {
  padding: 20px;
  border-radius: 16px;
  border: 1px dashed #cad7e8;
  background: #f8fbff;
  color: var(--muted);
}

.panel-tip {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.directory-toolbar {
  margin-bottom: 16px;
}

.form-card {
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: var(--panel-soft);
}

.compact-field span {
  font-size: 13px;
}

.form-card h4 {
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slot-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.slot-list,
.slot-list-column,
.booking-list,
.teacher-slot-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.slot-row,
.booking-item {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: #fff;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.slot-row:hover,
.booking-item:hover {
  border-color: rgba(40, 125, 255, 0.25);
  box-shadow: 0 8px 20px rgba(40, 125, 255, 0.08);
  transform: translateX(4px);
}

.slot-row.action-slot {
  background: linear-gradient(135deg, rgba(40, 125, 255, 0.05), rgba(23, 166, 115, 0.04));
  border-color: rgba(40, 125, 255, 0.12);
}

.admin-selection-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) auto;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(40, 125, 255, 0.18);
  background: linear-gradient(135deg, rgba(40, 125, 255, 0.08), rgba(102, 174, 255, 0.04));
}

.admin-selection-copy {
  display: grid;
  gap: 6px;
}

.admin-selection-copy strong {
  font-size: 22px;
}

.admin-selection-copy p {
  color: var(--muted);
}

.admin-selection-stats {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-selection-chip {
  min-width: 112px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(40, 125, 255, 0.12);
}

.admin-selection-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.admin-selection-chip strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.slot-booking-cta {
  margin-top: 6px;
  color: var(--blue);
  font-weight: 700;
}

.bulk-balance-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.student-row {
  padding: 16px;
}

.student-row-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-core {
  display: grid;
  gap: 4px;
}

.inline-input {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #dbe5f2;
  background: #fff;
}

.log-item {
  padding: 16px;
  display: grid;
  gap: 6px;
}

.log-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.log-item-time {
  color: var(--muted);
  font-size: 12px;
}

.log-type {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  align-items: center;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 700;
}

.teacher-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-schedule-board {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.summary-chip {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.summary-chip strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.week-day-meta {
  margin: 8px 0 14px;
}

.teacher-slot-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: #fff;
}

.teacher-slot-item.available-item {
  background: rgba(23, 166, 115, 0.05);
}

.teacher-status {
  width: fit-content;
  color: var(--orange);
  background: var(--orange-soft);
}

.teacher-status.available {
  color: var(--green);
  background: var(--green-soft);
}

.planner-meta {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--panel-border);
  line-height: 1.7;
}

.planner-range-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.planner-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: #f8fbff;
}

.planner-table {
  min-width: 920px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.planner-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 14px 12px;
  background: #eef4ff;
  border-bottom: 1px solid var(--panel-border);
  color: var(--text);
  font-size: 13px;
}

.planner-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 92px;
  min-width: 92px;
  padding: 12px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  background: #f7faff;
  border-right: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}

.admin-schedule-wrap {
  background: #f4f8ff;
}

.admin-schedule-table {
  min-width: 980px;
}

.admin-schedule-table thead th,
.admin-schedule-table tbody th,
.admin-schedule-table td {
  font-size: 12px;
}

.admin-schedule-table thead th {
  padding: 10px 8px;
}

.admin-schedule-table tbody th {
  width: 86px;
  min-width: 86px;
  padding: 10px 6px;
  font-weight: 700;
}

.admin-schedule-head {
  display: grid;
  gap: 3px;
  line-height: 1.25;
}

.admin-schedule-head strong {
  font-size: 12px;
}

.admin-schedule-head span,
.admin-time-end {
  color: var(--muted);
  font-size: 11px;
}

.admin-schedule-cell {
  min-width: 112px;
  height: 54px;
  padding: 4px 6px;
  border-right: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  background: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-schedule-cell:hover {
  background: #f0f7ff;
  box-shadow: inset 0 0 0 2px rgba(40, 125, 255, 0.2);
}

.admin-schedule-cell-inner {
  height: 100%;
  border-radius: 10px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 4px;
  text-align: center;
  line-height: 1.2;
}

.admin-schedule-cell .cell-main {
  font-size: 12px;
  font-weight: 700;
}

.admin-schedule-cell .cell-sub {
  font-size: 10px;
  color: inherit;
  opacity: 0.88;
}

.admin-schedule-cell.is-empty .admin-schedule-cell-inner {
  color: #6f8098;
  background: #f8fbff;
  border: 1px dashed #d6e1ef;
}

.admin-schedule-cell.is-empty:hover .admin-schedule-cell-inner {
  color: var(--blue);
  background: rgba(40, 125, 255, 0.06);
  border-color: rgba(40, 125, 255, 0.22);
}

.admin-schedule-cell.is-open .admin-schedule-cell-inner {
  color: var(--green);
  background: rgba(23, 166, 115, 0.12);
}

.admin-schedule-cell.is-open:hover .admin-schedule-cell-inner {
  box-shadow: inset 0 0 0 1px rgba(23, 166, 115, 0.24);
}

.admin-schedule-cell.is-booked {
  cursor: default;
}

.admin-schedule-cell.is-booked .admin-schedule-cell-inner {
  color: var(--orange);
  background: rgba(255, 142, 60, 0.14);
}

.admin-schedule-cell.is-locked {
  cursor: default;
}

.admin-schedule-cell.is-locked .admin-schedule-cell-inner {
  color: #98a6ba;
  background: rgba(191, 201, 216, 0.26);
}

.teacher-schedule-table .admin-schedule-cell {
  cursor: default;
}

.student-booking-table .admin-schedule-cell.is-open {
  cursor: pointer;
}

.student-booking-table .admin-schedule-cell.is-open:hover .admin-schedule-cell-inner {
  box-shadow: inset 0 0 0 1px rgba(23, 166, 115, 0.24);
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 22, 38, 0.6);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(480px, calc(100vw - 32px));
  margin: 10vh auto 0;
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 32px 64px rgba(12, 22, 38, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-copy {
  color: var(--text);
  line-height: 1.8;
}

.modal-copy strong {
  display: block;
  margin: 6px 0;
  font-size: 20px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.planner-cell {
  min-width: 128px;
  height: 52px;
  padding: 6px 8px;
  border-right: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  background: #fff;
  transition: background 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
}

.planner-cell-inner {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
}

.planner-cell.is-available .planner-cell-inner {
  color: var(--green);
  background: rgba(23, 166, 115, 0.12);
  font-weight: 700;
}

.planner-cell.is-booked .planner-cell-inner {
  color: var(--orange);
  background: rgba(255, 142, 60, 0.14);
  font-weight: 700;
}

.planner-cell.is-locked .planner-cell-inner {
  color: #9ba9bd;
  background: rgba(191, 201, 216, 0.26);
}

.planner-cell.is-selected {
  background: rgba(40, 125, 255, 0.08);
  box-shadow: inset 0 0 0 2px rgba(40, 125, 255, 0.28);
}

@media (max-width: 900px) {
  .admin-selection-banner {
    grid-template-columns: 1fr;
  }
}

.planner-cell.can-select {
  cursor: crosshair;
}

.planner-cell.can-select:hover {
  background: rgba(40, 125, 255, 0.05);
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.role-view,
.login-stage,
.panel,
.stat-card {
  animation: riseIn 0.45s ease;
}

.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.primary-btn:active {
  transform: translateY(0) scale(0.98);
}

.metric-card:active,
.account-card:active,
.teacher-card:active,
.teacher-admin-card:active,
.stat-card:active {
  transform: translateY(-2px) scale(0.98);
}

@media (max-width: 1280px) {
  .login-stage,
  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .stats-grid,
  .admin-grid,
  .student-grid,
  .detail-grid,
  .teacher-summary-bar,
  .overview-grid,
  .system-actions-grid,
  .log-summary-grid {
    grid-template-columns: 1fr;
  }

  .compact-five-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .login-screen,
  .workspace-main {
    padding: 16px;
  }

  .login-brand,
  .login-panel,
  .sidebar-panel,
  .feature-panel,
  .admin-panel,
  .booking-panel,
  .teacher-panel {
    padding: 18px;
  }

  .login-metrics,
  .account-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .workspace-header,
  .header-tools,
  .panel-head,
  .toolbar,
  .teacher-header,
  .student-row,
  .slot-row,
  .booking-item {
    flex-direction: column;
    align-items: stretch;
  }

  .slot-input-row {
    grid-template-columns: 1fr;
  }

  .teacher-list,
  .admin-teacher-list,
  .booking-board,
  .student-table {
    gap: 12px;
  }

  .compact-five-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-slot-item {
    grid-template-columns: 1fr;
  }

  .teacher-profile-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-dialog {
    margin-top: 8vh;
  }
}

/* ========== Rich Editor Styles ========== */
.rich-editor-wrapper {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--panel);
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--panel-border);
}

.toolbar-group {
  display: flex;
  gap: 4px;
  padding-right: 8px;
  margin-right: 8px;
  border-right: 1px solid var(--panel-border);
}

.toolbar-group:last-child {
  border-right: none;
  margin-right: 0;
  padding-right: 0;
}

.editor-btn {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
}

.editor-btn:hover {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.editor-btn:active {
  transform: translateY(1px);
}

.editor-btn strong,
.editor-btn em,
.editor-btn u {
  font-style: normal;
  text-decoration: none;
}

#teacherBioEditor {
  width: 100%;
  min-height: 180px;
  padding: 14px;
  border: none;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
}

#teacherBioEditor:focus {
  outline: none;
}

/* Bio Content Display Styles */
.bio-content h1,
.bio-content h2,
.bio-content h3,
.bio-content h4 {
  margin-top: 20px;
  margin-bottom: 12px;
  color: var(--sidebar);
  font-weight: 700;
}

.bio-content h1 {
  font-size: 24px;
}

.bio-content h2 {
  font-size: 20px;
}

.bio-content h3 {
  font-size: 18px;
}

.bio-content h4 {
  font-size: 16px;
}

.bio-content p {
  margin-bottom: 12px;
  line-height: 1.7;
}

.bio-content ul,
.bio-content ol {
  margin: 12px 0;
  padding-left: 24px;
}

.bio-content li {
  margin-bottom: 6px;
}

.bio-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  display: block;
}

.bio-content video {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  display: block;
}

.bio-content iframe {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  aspect-ratio: 16 / 9;
  width: 100%;
  min-height: 280px;
}

/* Teacher Detail Panel Bio Styles */
.teacher-detail .bio-content {
  color: var(--text);
}

.teacher-detail .bio-content strong {
  color: var(--sidebar);
}

.teacher-detail .bio-content em {
  color: var(--muted);
  font-style: italic;
}

.teacher-detail .bio-content u {
  text-decoration: underline;
}

/* Admin Booking Schedule Meta Styles */
.admin-schedule-meta {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
}

.admin-schedule-meta-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-schedule-meta-head strong {
  color: var(--sidebar);
  font-size: 14px;
}

.admin-schedule-week-tools {
  display: flex;
  gap: 8px;
}

.admin-schedule-week-tools .secondary-btn {
  font-size: 13px;
  padding: 6px 12px;
}

/* Booking Status Tag Styles */
.status-tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.status-tag.status-success {
  background: var(--green-soft);
  color: var(--green);
}

.status-tag.status-warning {
  background: var(--orange-soft);
  color: var(--orange);
}

/* ========== English Test Styles ========== */
.test-intro {
  padding: 40px 20px;
  text-align: center;
}

.test-intro-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px;
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
  border-radius: var(--radius-md);
  border: 2px solid var(--blue);
}

.test-intro-card h4 {
  font-size: 20px;
  color: var(--sidebar);
  margin-bottom: 16px;
}

.test-intro-card ul {
  text-align: left;
  margin: 20px 0;
  padding-left: 20px;
}

.test-intro-card li {
  margin: 10px 0;
  line-height: 1.6;
}

.test-tip {
  font-size: 14px;
  color: var(--muted);
  margin-top: 20px;
  font-style: italic;
}

.test-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--panel-border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  transition: width 0.3s ease;
}

.question-card {
  padding: 24px;
  background: var(--panel);
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  margin-bottom: 20px;
}

.question-card.answered {
  border-color: var(--green);
}

.question-level {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.question-level.level-basic {
  background: var(--green-soft);
  color: var(--green);
}

.question-level.level-intermediate {
  background: var(--blue-soft);
  color: var(--blue);
}

.question-level.level-advanced {
  background: var(--purple-soft);
  color: var(--purple);
}

.question-text {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.5;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 2px solid var(--panel-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-item:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.option-item.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.option-item.correct {
  border-color: var(--green);
  background: var(--green-soft);
}

.option-item.wrong {
  border-color: var(--red);
  background: var(--red-soft);
}

.option-item input[type="radio"] {
  margin-right: 12px;
}

.option-label {
  font-size: 15px;
  color: var(--text);
}

.answer-explanation {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--green);
}

.answer-explanation strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
}

.explanation-text {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.question-actions {
  margin-top: 20px;
  text-align: center;
}

.test-navigation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.test-result-card {
  padding: 30px;
  background: var(--panel);
  border-radius: var(--radius-md);
  border: 2px solid;
}

.test-result-card .result-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--panel-border);
}

.result-header h3 {
  font-size: 24px;
  color: var(--sidebar);
  margin-bottom: 12px;
}

.result-level {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 700;
}

.result-level.level-basic {
  background: var(--green-soft);
  color: var(--green);
}

.result-level.level-intermediate {
  background: var(--blue-soft);
  color: var(--blue);
}

.result-level.level-advanced {
  background: var(--purple-soft);
  color: var(--purple);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}

.stat-item {
  text-align: center;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
}

.level-description {
  margin-bottom: 30px;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.level-description h4 {
  color: var(--sidebar);
  margin-bottom: 10px;
}

.level-description p {
  color: var(--text);
  line-height: 1.7;
}

.detailed-stats {
  margin-bottom: 30px;
}

.detailed-stats h4 {
  color: var(--sidebar);
  margin-bottom: 12px;
}

.level-stat {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ========== Survey Styles ========== */
.survey-intro-card,
.survey-thanks-card {
  max-width: 700px;
  margin: 40px auto;
  padding: 40px;
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.survey-intro-card h4,
.survey-thanks-card h4 {
  color: var(--sidebar);
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
}

.survey-notice {
  background: var(--bg-soft);
  padding: 24px;
  border-radius: var(--radius-md);
  margin: 20px 0;
}

.survey-notice p {
  color: var(--text);
  line-height: 1.8;
  margin: 12px 0;
}

.survey-commitment {
  background: var(--panel);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
}

.survey-commitment ul {
  margin: 12px 0;
  padding-left: 20px;
}

.survey-commitment li {
  color: var(--text);
  line-height: 2;
}

.survey-commitment strong {
  color: var(--blue);
}

.survey-teacher-info {
  background: var(--panel-soft);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  border-left: 4px solid var(--blue);
}

.survey-teacher-info p {
  margin: 8px 0;
}

.teacher-list {
  color: var(--blue);
  font-weight: 500;
}

.survey-target {
  color: var(--muted);
  font-size: 14px;
}

.survey-tip {
  color: var(--green);
  font-weight: 500;
  margin-top: 16px !important;
}

.survey-form-container {
  max-width: 900px;
  margin: 0 auto;
}

.survey-header {
  background: var(--blue-soft);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border-left: 4px solid var(--blue);
}

.survey-disclaimer {
  color: var(--blue-deep);
  font-weight: 500;
  margin: 0;
  line-height: 1.6;
}

.survey-part {
  background: var(--panel);
  padding: 24px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.survey-part-title {
  color: var(--sidebar);
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-soft);
}

.survey-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.survey-checkbox-label {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.survey-checkbox-label:hover {
  background: var(--blue-soft);
}

.survey-checkbox-label input[type="checkbox"] {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.survey-checkbox-label span {
  color: var(--text);
  line-height: 1.5;
}

.survey-textarea-group {
  margin-top: 12px;
}

.survey-textarea-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.survey-textarea-group textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.survey-submit-section {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--bg-soft);
}

.survey-submit-section .primary-btn {
  padding: 14px 48px;
  font-size: 16px;
}

.thanks-icon {
  font-size: 64px;
  text-align: center;
  margin-bottom: 16px;
}

.survey-thanks-card p {
  color: var(--text);
  text-align: center;
  line-height: 1.8;
  margin: 12px 0;
}

.thanks-note {
  color: var(--muted);
  font-size: 14px;
}

.survey-thanks-card .secondary-btn {
  margin-top: 20px;
}

/* ========== Admin Survey Management Styles ========== */
.surveys-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.surveys-stats .stat-item {
  background: var(--bg-soft);
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
}

.surveys-stats .stat-item .label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.surveys-stats .stat-item .value {
  display: block;
  color: var(--blue);
  font-size: 32px;
  font-weight: 600;
}

.surveys-list h4 {
  color: var(--sidebar);
  font-size: 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--panel-border);
}

.survey-item {
  background: var(--panel);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  border-left: 3px solid var(--blue);
}

.survey-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
}

.survey-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.survey-user {
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
}

.survey-student-no {
  color: var(--muted);
  font-size: 14px;
}

.survey-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-group {
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.answer-group.positive {
  background: var(--green-soft);
  border-left: 3px solid var(--green);
}

.answer-group.negative {
  background: var(--orange-soft);
  border-left: 3px solid var(--orange);
}

.answer-group.suggestions {
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
}

.answer-label {
  font-weight: 600;
  margin-right: 8px;
  display: inline-block;
}

.answer-group.positive .answer-label {
  color: var(--green);
}

.answer-group.negative .answer-label {
  color: var(--orange);
}

.answer-group.suggestions .answer-label {
  color: var(--blue);
}

.answer-list {
  color: var(--text);
  line-height: 1.6;
}

.answer-text {
  color: var(--text);
  line-height: 1.6;
  font-style: italic;
}

/* Survey Pagination */
.surveys-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
}

.pagination-info {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.surveys-pagination .secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.survey-date {
  color: var(--muted);
  font-size: 13px;
  margin-left: auto;
}

/* ========== H5 Mobile Styles ========== */

/* Mobile Login Page */
@media (max-width: 768px) {
  .login-screen {
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  }

  .login-stage {
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
    min-height: 100vh;
  }

  .login-brand {
    min-height: auto;
    padding: 32px 24px 24px;
    border-radius: 0;
    border: none;
    background: linear-gradient(180deg, #0f1f36 0%, #1a3a5c 100%);
    color: #fff;
    position: relative;
  }

  .login-brand::after,
  .login-brand::before {
    display: none;
  }

  .login-brand h1 {
    color: #fff;
    font-size: 28px;
  }

  .login-brand h2 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 20px;
    margin-top: 16px;
  }

  .hero-copy {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
  }

  .brand-pill {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .brand-pill .eyebrow {
    color: rgba(255, 255, 255, 0.6);
  }

  .login-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 20px;
  }

  .metric-card {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    padding: 14px 16px;
  }

  .metric-card span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
  }

  .metric-card strong {
    color: #fff;
    font-size: 14px;
  }

  .account-grid {
    display: none;
  }

  .login-panel {
    padding: 24px;
    border-radius: 24px 24px 0 0;
    margin-top: -20px;
    background: #fff;
    position: relative;
    z-index: 10;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
  }

  .login-panel-head h3 {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .field input {
    min-height: 52px;
    font-size: 16px;
    border-radius: 12px;
  }

  .primary-btn.wide-btn {
    min-height: 52px;
    font-size: 16px;
    border-radius: 12px;
    margin-top: 8px;
  }
}

/* Mobile Workspace - Common */
@media (max-width: 768px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .workspace-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 8px 12px;
    background: #fff;
    border-right: none;
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  }

  .sidebar-brand,
  .sidebar-footnote,
  .sidebar-logout {
    display: none;
  }

  .nav-menu {
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin: 0;
    width: 100%;
    justify-content: space-around;
  }

  .nav-item {
    flex-direction: column;
    padding: 8px 12px;
    gap: 4px;
    font-size: 11px;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    flex: 1;
    text-align: center;
  }

  .nav-item::before {
    display: none;
  }

  .nav-item:hover {
    transform: none;
    background: var(--bg-soft);
  }

  .nav-item.active {
    background: linear-gradient(135deg, var(--blue), var(--blue-deep));
    color: #fff;
    box-shadow: 0 4px 12px rgba(40, 125, 255, 0.3);
  }

  .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    background: var(--red);
  }

  .workspace-main {
    padding: 16px 16px 100px;
  }

  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 0 0 16px;
  }

  .workspace-header h1 {
    font-size: 24px;
  }

  .header-tools {
    width: 100%;
    justify-content: space-between;
  }

  .session-card {
    display: none;
  }
}

/* Mobile Student View - Redesigned */
@media (max-width: 768px) {
  .student-subview {
    gap: 0;
    background: #f5f5f5;
    min-height: 100vh;
  }

  /* Mobile Overview Header */
  .mobile-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
  }

  .mobile-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-user-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
  }

  .mobile-user-meta {
    font-size: 13px;
    color: #999;
  }

  .mobile-logout-btn {
    padding: 8px 16px;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    font-size: 14px;
    font-weight: 500;
  }

  .mobile-logout-btn:active {
    background: #f5f5f5;
  }

  /* Mobile Quick Actions Grid */
  .mobile-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background: #fff;
    margin-bottom: 12px;
  }

  .mobile-quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 16px;
    border: 1px solid #e8eaff;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-quick-action-card:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
  }

  .mobile-quick-action-card .quick-icon {
    font-size: 28px;
  }

  .mobile-quick-action-card span:last-child {
    font-size: 13px;
    color: #666;
    font-weight: 500;
  }

  /* Mobile Stats Cards - Horizontal Scroll */
  .stats-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    background: #fff;
  }

  .stats-grid::-webkit-scrollbar {
    display: none;
  }

  .stat-card {
    flex: 0 0 140px;
    padding: 20px 16px;
    border-radius: 16px;
    scroll-snap-align: start;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(40, 125, 255, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }

  .stat-card strong {
    font-size: 32px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .stat-card span {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
  }

  .stat-card em {
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
  }

  /* Mobile Panel Redesign */
  .panel {
    border-radius: 24px;
    padding: 20px;
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(21, 38, 71, 0.06);
    border: 1px solid rgba(228, 235, 245, 0.8);
  }

  .panel-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--panel-border);
  }

  /* Mobile: Hide panel-head in student subviews to avoid duplicate titles */
  .student-subview .panel-head {
    display: none;
  }

  .panel-head h3 {
    font-size: 18px;
    font-weight: 700;
  }

  .panel-kicker {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  /* Mobile Teacher Cards - 3x3 Grid */
  .teacher-directory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .teacher-directory-grid.mobile-teacher-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card {
    flex-direction: column;
    padding: 16px 8px;
    text-align: center;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
  }

  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card .teacher-select-row {
    flex-direction: column;
    gap: 8px;
  }

  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card .avatar-badge {
    width: 56px;
    height: 56px;
    font-size: 20px;
  }

  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card .teacher-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card .teacher-meta {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Mobile Simple Card - Only avatar and name */
  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card.mobile-simple-card {
    flex-direction: column;
    padding: 16px 8px;
    text-align: center;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    background: #fff;
    gap: 12px;
    min-height: 120px;
    justify-content: center;
    transition: all 0.2s ease;
  }

  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card.mobile-simple-card:active {
    transform: scale(0.95);
    background: var(--blue-soft);
    border-color: var(--blue);
  }

  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card.mobile-simple-card.active {
    background: linear-gradient(135deg, var(--blue-soft) 0%, var(--purple-soft) 100%);
    border-color: var(--blue);
    box-shadow: 0 4px 16px rgba(40, 125, 255, 0.25);
  }

  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card.mobile-simple-card .avatar-badge {
    width: 64px;
    height: 64px;
    font-size: 24px;
    border-radius: 50%;
    margin: 0 auto;
  }

  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card.mobile-simple-card .teacher-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
  }

  .teacher-directory-grid.mobile-teacher-grid .teacher-directory-card.mobile-simple-card .teacher-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 4px;
  }

  .teacher-directory-grid.compact-five-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
    padding: 16px !important;
  }

  .teacher-directory-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--panel-border);
    box-shadow: 0 2px 12px rgba(21, 38, 71, 0.04);
    transition: all 0.3s ease;
  }

  .teacher-directory-card:active {
    transform: scale(0.98);
    background: var(--blue-soft);
    border-color: var(--blue);
  }

  .teacher-directory-card .teacher-select-row {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .teacher-directory-card .teacher-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
  }

  .teacher-directory-card .teacher-meta {
    font-size: 13px;
    color: var(--muted);
  }

  .teacher-directory-card .avatar-badge {
    width: 56px;
    height: 56px;
    font-size: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(40, 125, 255, 0.25);
  }

  .teacher-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    object-fit: cover;
  }

  /* Mobile Teacher Detail Panel */
  #teacherDetailPanel {
    margin: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  }

  #teacherDetailPanel.hidden {
    display: none;
  }

  #teacherDetailPanel .teacher-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  #teacherDetailPanel .teacher-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  #teacherDetailPanel .teacher-profile-block {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  #teacherDetailPanel .teacher-profile-block .avatar-badge,
  #teacherDetailPanel .teacher-profile-block .teacher-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    font-size: 28px;
  }

  #teacherDetailPanel .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  #teacherDetailPanel .tag-list .tag {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
  }

  #teacherDetailPanel .detail-card {
    background: #f8f9ff;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #e8eaff;
  }

  #teacherDetailPanel .detail-card h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
  }

  #teacherDetailPanel .detail-copy {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
  }

  /* Mobile Search Bar */
  .directory-toolbar {
    margin-bottom: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    padding: 8px 0;
  }

  .inline-input {
    width: 100%;
    min-height: 52px;
    padding: 0 20px;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    background: #ffffff;
    font-size: 15px;
    box-shadow: 0 2px 12px rgba(21, 38, 71, 0.04);
  }

  .inline-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft), 0 4px 20px rgba(40, 125, 255, 0.15);
  }

  /* Mobile Feature Panel */
  .feature-panel {
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #f8fbff 0%, #f0f7ff 100%);
    border: 1px dashed var(--blue);
  }

  .feature-panel h3 {
    font-size: 16px;
    color: var(--blue-deep);
  }

  /* Mobile Detail Cards */
  .detail-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .detail-card,
  .schedule-card {
    padding: 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--panel-border);
  }

  .detail-card h4 {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .detail-card p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
  }

  /* Mobile Tags */
  .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tag {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--blue-soft);
    color: var(--blue-deep);
    font-weight: 600;
  }

  /* Mobile Booking Items */
  .booking-item {
    padding: 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(21, 38, 71, 0.04);
  }

  .booking-item h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
  }

  .booking-item .booking-meta {
    font-size: 13px;
    color: var(--muted);
  }

  /* Mobile Section Headers */
  .mobile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .mobile-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
  }

  .mobile-section-action {
    font-size: 14px;
    color: var(--blue);
    font-weight: 600;
  }
}

/* Mobile Teacher View */
@media (max-width: 768px) {
  .teacher-subview {
    gap: 12px;
  }

  .teacher-summary-bar {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .summary-chip {
    padding: 12px;
    border-radius: 14px;
    text-align: center;
  }

  .summary-chip span {
    font-size: 11px;
  }

  .summary-chip strong {
    font-size: 18px;
  }

  .planner-meta {
    padding: 12px;
    font-size: 13px;
  }

  .planner-wrap {
    border-radius: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .planner-table {
    min-width: 700px;
  }

  .planner-cell {
    min-width: 100px;
    height: 48px;
    padding: 4px;
  }

  .planner-cell-inner {
    font-size: 11px;
    border-radius: 8px;
  }

  .week-day-card {
    padding: 14px;
  }

  .week-day-card h4 {
    font-size: 15px;
  }

  .teacher-slot-item {
    padding: 12px;
  }

  .form-card {
    padding: 16px;
  }

  .form-card h4 {
    font-size: 16px;
  }

  .slot-input-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .slot-list {
    gap: 8px;
  }

  .slot-row {
    padding: 12px;
    flex-direction: row;
    align-items: center;
  }
}

/* Mobile Admin View - Redesigned */
@media (max-width: 768px) {
  .admin-subview {
    gap: 16px;
  }

  .admin-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Mobile System Actions - Grid Layout */
  .system-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .system-action-btn {
    min-height: auto;
    padding: 20px 16px;
    border-radius: 20px;
    flex-direction: column;
    text-align: center;
    gap: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--panel-border);
    box-shadow: 0 4px 20px rgba(21, 38, 71, 0.06);
  }

  .system-action-btn.primary-action {
    background: linear-gradient(135deg, var(--blue), var(--blue-deep));
    color: #fff;
    border-color: transparent;
  }

  .system-action-btn.warn-action {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border-color: var(--red);
  }

  .system-action-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 24px;
  }

  .system-action-copy strong {
    font-size: 14px;
  }

  .system-action-copy em {
    display: none;
  }

  .system-notice {
    padding: 16px 20px;
    font-size: 13px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--green-soft) 0%, rgba(23, 166, 115, 0.08) 100%);
    border: 1px solid var(--green);
    color: var(--green);
  }

  /* Mobile Overview Cards */
  .overview-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .overview-card {
    padding: 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    box-shadow: 0 2px 12px rgba(21, 38, 71, 0.04);
  }

  .overview-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .overview-card p {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
  }

  /* Mobile Log Summary - Horizontal Scroll */
  .log-summary-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 4px 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .log-summary-grid::-webkit-scrollbar {
    display: none;
  }

  .log-summary-card {
    flex: 0 0 140px;
    padding: 20px 16px;
    border-radius: 20px;
    text-align: center;
    scroll-snap-align: start;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(40, 125, 255, 0.1);
    box-shadow: 0 4px 20px rgba(21, 38, 71, 0.06);
  }

  .log-summary-card span {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
  }

  .log-summary-card strong {
    font-size: 28px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .log-summary-card em {
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
  }

  /* Mobile Admin Selection Banner */
  .admin-selection-banner {
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--blue-soft) 0%, var(--purple-soft) 100%);
    border: 1px solid rgba(40, 125, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .admin-selection-copy strong {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .admin-selection-copy p {
    font-size: 14px;
    color: var(--muted);
  }

  .admin-selection-stats {
    display: flex;
    gap: 12px;
  }

  .admin-selection-chip {
    flex: 1;
    padding: 16px;
    border-radius: 16px;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--panel-border);
  }

  .admin-selection-chip span {
    font-size: 12px;
    color: var(--muted);
  }

  .admin-selection-chip strong {
    font-size: 24px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  /* Mobile Schedule - Simplified List View */
  .admin-schedule-wrap,
  .planner-wrap {
    display: none !important;
  }

  /* Mobile Schedule List */
  .mobile-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-schedule-day {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
  }

  .mobile-schedule-day-header {
    padding: 16px;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-schedule-day-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
  }

  .mobile-schedule-day-header span {
    font-size: 13px;
    color: #999;
  }

  .mobile-schedule-slots {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .mobile-schedule-slot {
    padding: 12px 8px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    background: #fff;
  }

  .mobile-schedule-slot.available {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
  }

  .mobile-schedule-slot.booked {
    background: #fff3e0;
    border-color: #ff9800;
    color: #e65100;
  }

  .mobile-schedule-slot.locked {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #999;
  }

  .mobile-admin-schedule {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* Mobile Schedule List Items */
  .mobile-schedule-list-items {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-schedule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e8eaff;
  }

  .mobile-schedule-time {
    font-size: 16px;
    font-weight: 700;
    color: var(--blue);
    min-width: 60px;
  }

  .mobile-schedule-info {
    flex: 1;
  }

  .mobile-schedule-teacher {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
  }

  .mobile-schedule-title {
    font-size: 13px;
    color: #999;
  }

  .mobile-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 16px;
    border: 1px solid #f0f0f0;
  }

  .mobile-schedule-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
  }

  .mobile-schedule-week-tools {
    display: flex;
    gap: 8px;
  }

  .mobile-week-btn {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-week-btn:active {
    background: var(--blue-soft);
    border-color: var(--blue);
  }

  .mobile-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px dashed var(--panel-border);
  }

  .mobile-empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
  }

  .mobile-empty-state h4 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
  }

  .mobile-empty-state p {
    font-size: 14px;
    color: #999;
  }

  /* Mobile Student List */
  .student-row {
    padding: 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(21, 38, 71, 0.04);
  }

  .student-row-head {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
  }

  .student-core strong {
    font-size: 17px;
    font-weight: 700;
  }

  .student-core span {
    font-size: 14px;
    color: var(--muted);
  }

  .student-row .action-row {
    width: 100%;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--panel-border);
  }

  /* Mobile Log Items */
  .log-item {
    padding: 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    margin-bottom: 12px;
  }

  .log-item-head {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }

  .log-type {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
  }

  .log-item-time {
    font-size: 13px;
  }

  .log-item p {
    font-size: 14px;
    line-height: 1.6;
  }

  /* Mobile Teacher Admin Cards */
  .teacher-admin-card {
    padding: 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(21, 38, 71, 0.04);
  }

  .teacher-admin-card.is-selected {
    background: linear-gradient(135deg, var(--blue-soft) 0%, var(--purple-soft) 100%);
    border-color: var(--blue);
  }

  .teacher-admin-card.is-selected::after {
    top: 16px;
    right: 16px;
    font-size: 12px;
    padding: 6px 14px;
  }

  /* Mobile Bulk Balance Bar */
  .bulk-balance-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--panel-border);
  }

  .bulk-balance-bar .field {
    width: 100%;
  }

  .bulk-balance-bar input {
    min-height: 52px;
    border-radius: 16px;
  }

  .inline-field {
    width: 100%;
    min-width: auto;
  }
}

/* Mobile Modal */
@media (max-width: 768px) {
  .modal-dialog {
    width: calc(100vw - 32px);
    margin: auto;
    padding: 20px;
    border-radius: 20px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .modal-copy strong {
    font-size: 18px;
  }

  .modal-actions {
    flex-direction: column;
    gap: 10px;
  }

  .modal-actions button {
    width: 100%;
  }
}

/* Mobile Pagination */
@media (max-width: 768px) {
  .pagination-bar {
    flex-direction: row;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    margin: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--panel-border);
  }

  .pagination-bar .student-meta {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
  }

  .pagination-bar button {
    flex: 1;
    min-height: 44px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(40, 125, 255, 0.3);
    transition: all 0.2s ease;
  }

  .pagination-bar button:disabled {
    background: #e0e0e0;
    color: #999;
    box-shadow: none;
    cursor: not-allowed;
  }

  .pagination-bar button:not(:disabled):active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(40, 125, 255, 0.2);
  }

  .pagination-info {
    font-size: 12px;
  }
}

/* Mobile Touch Optimizations */
@media (max-width: 768px) {
  .teacher-card,
  .teacher-directory-card,
  .teacher-admin-card,
  .booking-summary-card {
    -webkit-tap-highlight-color: transparent;
  }

  .teacher-card:active,
  .teacher-directory-card:active,
  .teacher-admin-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  .nav-item {
    -webkit-tap-highlight-color: transparent;
  }

  .primary-btn,
  .secondary-btn {
    -webkit-tap-highlight-color: transparent;
  }

  .primary-btn:active {
    transform: scale(0.98);
  }

  /* Pull to refresh indicator style */
  .refresh-indicator {
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 14px;
  }

  /* Mobile card swipe hint */
  .swipe-hint {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    margin-top: 8px;
  }

  .swipe-hint-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--panel-border);
  }

  .swipe-hint-dot.active {
    background: var(--blue);
  }
}

/* Extra Small Screens */
@media (max-width: 380px) {
  .workspace-main {
    padding: 12px 12px 100px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card strong {
    font-size: 20px;
  }

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

  .nav-item {
    padding: 6px 8px;
    font-size: 10px;
  }

  .workspace-header h1 {
    font-size: 20px;
  }

  .panel {
    padding: 14px;
  }

  .panel-head h3 {
    font-size: 16px;
  }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
  .workspace-sidebar {
    position: relative;
    flex-direction: row;
    padding: 12px;
  }

  .nav-menu {
    justify-content: center;
  }

  .nav-item {
    flex-direction: row;
    padding: 10px 16px;
  }

  .workspace-main {
    padding-bottom: 16px;
  }
}

/* Mobile Booking Page */
@media (max-width: 768px) {
  .mobile-booking-container {
    padding: 16px;
    background: #f5f5f5;
    min-height: 100vh;
  }

  /* Teacher Header */
  .mobile-teacher-header {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--panel-border);
  }

  .mobile-teacher-header .avatar-badge,
  .mobile-teacher-header .teacher-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 32px;
    margin-bottom: 12px;
    border: 2px solid #eee;
  }

  .mobile-teacher-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
  }

  .mobile-teacher-tags {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
  }

  .mobile-teacher-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
  }

  /* Week Navigation */
  .mobile-week-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--panel-border);
  }

  .mobile-week-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
  }

  /* Date Bar */
  .mobile-date-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 16px;
    padding: 12px 8px;
    border: 1px solid var(--panel-border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-date-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
    padding: 8px 4px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
  }

  .mobile-date-item.active {
    background: #e0e0e0;
  }

  .mobile-date-name {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
  }

  .mobile-date-num {
    font-size: 13px;
    font-weight: 600;
    color: #333;
  }

  .mobile-date-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4cd964;
  }

  /* Time Grid */
  .mobile-time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .mobile-time-card {
    height: 56px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    background: #fff;
    transition: all 0.2s ease;
  }

  .mobile-time-card.available {
    background: #fff;
    border-color: #e0e0e0;
  }

  .mobile-time-card.available:active {
    transform: scale(0.95);
    background: #ffcc00;
    border-color: #ffcc00;
  }

  .mobile-time-card.mine {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
  }

  .mobile-time-card.booked {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
  }

  .mobile-time-card.empty {
    background: #fafafa;
    border-color: #f0f0f0;
    cursor: default;
  }

  .mobile-time-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
  }

  .mobile-time-status {
    font-size: 10px;
    margin-top: 2px;
    color: #999;
  }

  .mobile-time-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4cd964;
  }

  /* My Bookings */
  .mobile-my-bookings {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--panel-border);
  }

  .mobile-my-bookings h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
  }

  .mobile-booking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-booking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e8eaff;
  }

  .mobile-booking-time {
    font-size: 15px;
    font-weight: 600;
    color: #333;
  }

  .mobile-cancel-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: #ffebee;
    color: #c62828;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
  }

  .mobile-cancel-btn:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
  }

  .mobile-empty-text {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 20px;
  }
}

/* Mobile Booking Page - Simple Version */
@media (max-width: 768px) {
  .mobile-booking-simple {
    padding: 12px;
    background: #f5f5f5;
  }

  /* Mobile Survey Intro - Compact */
  .survey-intro-mobile {
    padding: 16px;
    text-align: center;
  }

  .survey-welcome {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
  }

  .survey-info-box {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid var(--panel-border);
  }

  .survey-info-box p {
    font-size: 13px;
    color: #666;
    margin: 8px 0;
    line-height: 1.4;
  }

  .survey-start-btn {
    width: 100%;
    max-width: 280px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    margin: 0 auto;
    display: block;
  }

  /* Selected Teacher Info */
  .mobile-selected-teacher {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--panel-border);
  }

  .mobile-selected-teacher .avatar-badge,
  .mobile-selected-teacher .teacher-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 22px;
    flex-shrink: 0;
  }

  .mobile-selected-info {
    flex: 1;
    min-width: 0;
  }

  .mobile-selected-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-slot-count {
    font-size: 13px;
    color: #4caf50;
    font-weight: 500;
  }

  .mobile-change-teacher-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--blue);
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
  }

  /* Week Navigation */
  .mobile-week-nav-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--panel-border);
  }

  .mobile-nav-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: #f0f0f0;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
  }

  .mobile-current-week {
    font-size: 15px;
    font-weight: 600;
    color: #333;
  }

  /* Available Slots List */
  .mobile-slots-list {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--panel-border);
  }

  .mobile-slots-list h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
  }

  .mobile-slot-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #f8f9ff;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid #e8eaff;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-slot-item:active {
    background: #ffcc00;
    border-color: #ffcc00;
    transform: scale(0.98);
  }

  .mobile-slot-date {
    font-size: 14px;
    color: #666;
    width: 80px;
    flex-shrink: 0;
  }

  .mobile-slot-time {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
    text-align: center;
  }

  .mobile-slot-book {
    font-size: 13px;
    color: var(--blue);
    font-weight: 500;
    width: 60px;
    text-align: right;
  }

  .mobile-no-slots {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 30px 20px;
  }

  /* My Bookings Simple */
  .mobile-my-bookings-simple {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--panel-border);
  }

  .mobile-my-bookings-simple h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
  }

  .mobile-my-slot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #e8f5e9;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid #c8e6c9;
  }

  .mobile-my-slot-date {
    font-size: 14px;
    font-weight: 500;
    color: #2e7d32;
  }

  .mobile-cancel-btn-simple {
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    background: #ffebee;
    color: #c62828;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
  }

  .mobile-cancel-btn-simple:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
  }

  .mobile-no-bookings {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 20px;
  }
}

/* Safe Area for Notch Phones */
@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 768px) {
    .login-screen {
      padding-top: env(safe-area-inset-top);
    }

    .workspace-sidebar {
      padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .workspace-main {
      padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
  }
}

/* Mobile Navigation Icons - Disabled */
.nav-icon {
  display: none !important;
}

@media (max-width: 768px) {
  .nav-item {
    font-size: 11px;
    white-space: nowrap;
  }

  /* Mobile floating action button */
  .mobile-fab {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--blue-deep));
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(40, 125, 255, 0.4);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .mobile-fab:active {
    transform: scale(0.95);
  }

  /* Mobile card stack view */
  .mobile-card-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-card-stack .panel {
    margin: 0;
  }

  /* Mobile section title */
  .mobile-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin: 16px 0 8px;
    padding-left: 4px;
  }

  /* Mobile list item enhancement */
  .mobile-list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--panel-border);
  }

  .mobile-list-item:active {
    transform: scale(0.98);
    background: var(--bg-soft);
  }

  .mobile-list-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-soft), var(--purple-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 14px;
    flex-shrink: 0;
  }

  .mobile-list-content {
    flex: 1;
    min-width: 0;
  }

  .mobile-list-content h4 {
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-list-content p {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-list-arrow {
    color: var(--muted);
    font-size: 18px;
    margin-left: 8px;
  }

  /* Mobile status badge */
  .mobile-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
  }

  .mobile-status-badge.success {
    background: var(--green-soft);
    color: var(--green);
  }

  .mobile-status-badge.warning {
    background: var(--orange-soft);
    color: var(--orange);
  }

  .mobile-status-badge.info {
    background: var(--blue-soft);
    color: var(--blue-deep);
  }

  /* Mobile quick actions */
  .mobile-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  }

  .mobile-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: var(--text);
  }

  .mobile-quick-action:active {
    background: var(--bg-soft);
  }

  .mobile-quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    box-shadow: 0 4px 12px rgba(40, 125, 255, 0.3);
  }

  .mobile-quick-action span {
    font-size: 11px;
    font-weight: 600;
  }

  /* Mobile skeleton loading */
  @keyframes mobileShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
  }

  .mobile-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: mobileShimmer 1.5s infinite;
    border-radius: 8px;
  }

  /* Mobile empty state */
  .mobile-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
  }

  .mobile-empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 16px;
  }

  .mobile-empty-state h4 {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .mobile-empty-state p {
    font-size: 14px;
    color: var(--muted);
    max-width: 280px;
  }

  /* Mobile Timeline Schedule */
  .mobile-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    padding-left: 24px;
  }

  .mobile-timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--blue), var(--purple));
    border-radius: 2px;
  }

  .mobile-timeline-item {
    position: relative;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 2px 12px rgba(21, 38, 71, 0.04);
  }

  .mobile-timeline-item::before {
    content: "";
    position: absolute;
    left: -20px;
    top: 24px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--blue);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--blue);
  }

  .mobile-timeline-item.booked::before {
    background: var(--orange);
    box-shadow: 0 0 0 2px var(--orange);
  }

  .mobile-timeline-item.available::before {
    background: var(--green);
    box-shadow: 0 0 0 2px var(--green);
  }

  .mobile-timeline-time {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
  }

  .mobile-timeline-content {
    font-size: 15px;
    color: var(--text);
  }

  .mobile-timeline-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
  }

  .mobile-timeline-status.booked {
    background: var(--orange-soft);
    color: var(--orange);
  }

  .mobile-timeline-status.available {
    background: var(--green-soft);
    color: var(--green);
  }

  /* Mobile Booking Card */
  .mobile-booking-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 24px rgba(21, 38, 71, 0.06);
    border: 1px solid var(--panel-border);
  }

  .mobile-booking-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--panel-border);
  }

  .mobile-booking-avatar {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
  }

  .mobile-booking-info h4 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
  }

  .mobile-booking-info p {
    font-size: 14px;
    color: var(--muted);
  }

  .mobile-booking-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
  }

  .mobile-booking-detail {
    padding: 12px;
    background: var(--bg-soft);
    border-radius: 12px;
  }

  .mobile-booking-detail span {
    font-size: 12px;
    color: var(--muted);
    display: block;
    margin-bottom: 4px;
  }

  .mobile-booking-detail strong {
    font-size: 14px;
    color: var(--text);
  }

  .mobile-booking-actions {
    display: flex;
    gap: 12px;
  }

  .mobile-booking-actions button {
    flex: 1;
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
  }

  /* Mobile Calendar Strip */
  .mobile-calendar-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 4px 12px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-calendar-strip::-webkit-scrollbar {
    display: none;
  }

  .mobile-calendar-day {
    flex: 0 0 64px;
    padding: 12px 8px;
    border-radius: 18px;
    text-align: center;
    background: #ffffff;
    border: 2px solid transparent;
    transition: all 0.2s ease;
  }

  .mobile-calendar-day.active {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(40, 125, 255, 0.3);
  }

  .mobile-calendar-day.has-event::after {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue);
    margin: 4px auto 0;
  }

  .mobile-calendar-day.active.has-event::after {
    background: #fff;
  }

  .mobile-calendar-day .cal-day-name {
    font-size: 11px;
    margin-bottom: 4px;
    opacity: 0.8;
  }

  .mobile-calendar-day .cal-day-date {
    font-size: 20px;
    font-weight: 700;
  }

  /* Mobile Filter Chips */
  .mobile-filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 4px 12px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-filter-chips::-webkit-scrollbar {
    display: none;
  }

  .mobile-filter-chip {
    flex: 0 0 auto;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    background: #ffffff;
    border: 1px solid var(--panel-border);
    white-space: nowrap;
    transition: all 0.2s ease;
  }

  .mobile-filter-chip.active {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(40, 125, 255, 0.3);
  }

  /* Mobile Section Divider */
  .mobile-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .mobile-section-divider::before,
  .mobile-section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--panel-border);
  }

  /* Mobile Float Label Input */
  .mobile-float-label {
    position: relative;
    margin-bottom: 16px;
  }

  .mobile-float-label input,
  .mobile-float-label select {
    width: 100%;
    min-height: 56px;
    padding: 24px 16px 8px;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    background: #ffffff;
    font-size: 16px;
    transition: all 0.2s ease;
  }

  .mobile-float-label label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--muted);
    pointer-events: none;
    transition: all 0.2s ease;
  }

  .mobile-float-label input:focus,
  .mobile-float-label input:not(:placeholder-shown) {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-soft);
  }

  .mobile-float-label input:focus + label,
  .mobile-float-label input:not(:placeholder-shown) + label {
    top: 12px;
    transform: translateY(0);
    font-size: 12px;
    color: var(--blue);
  }

  /* ========== Mobile Teacher Profile Header (参考图片样式) ========== */
  .mobile-teacher-header {
    background: #fff;
    padding: 24px 16px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
  }

  .mobile-teacher-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  }

  .mobile-teacher-name {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
  }

  .mobile-teacher-tags {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
  }

  .mobile-teacher-tag {
    font-size: 14px;
    color: #666;
    position: relative;
  }

  .mobile-teacher-tag:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 14px;
    background: #e0e0e0;
  }

  .mobile-teacher-bio {
    font-size: 14px;
    color: #999;
    line-height: 1.6;
    padding: 0 8px;
  }

  /* Mobile Quick Actions Bar */
  .mobile-quick-actions-bar {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    background: #fff;
    border-bottom: 8px solid #f5f5f5;
  }

  .mobile-quick-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #333;
  }

  .mobile-quick-action-item:active {
    opacity: 0.7;
  }

  .mobile-quick-action-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
  }

  .mobile-quick-action-item.active .mobile-quick-action-icon-circle {
    background: #FFD700;
    border-color: #FFD700;
  }

  .mobile-quick-action-item span {
    font-size: 12px;
    color: #666;
  }

  /* Mobile Date Selector (参考图片样式) */
  .mobile-date-selector {
    background: #fff;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .mobile-date-scroll {
    display: flex;
    overflow-x: auto;
    padding: 0 16px;
    gap: 0;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-date-scroll::-webkit-scrollbar {
    display: none;
  }

  .mobile-date-item {
    flex: 0 0 80px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
  }

  .mobile-date-item.active {
    background: #999;
    color: #fff;
  }

  .mobile-date-item.active::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #999;
  }

  .mobile-date-weekday {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .mobile-date-day {
    font-size: 14px;
  }

  /* Mobile Time Slots Grid (参考图片样式) */
  .mobile-time-slots-section {
    background: #fff;
    padding: 20px 16px;
  }

  .mobile-time-slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .mobile-time-slot-item {
    position: relative;
    padding: 16px 8px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-time-slot-item:active {
    transform: scale(0.95);
  }

  .mobile-time-slot-item.selected {
    background: #FFD700;
    border-color: #FFD700;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
  }

  .mobile-time-slot-item.booked {
    background: #f5f5f5;
    border-color: #e0e0e0;
  }

  .mobile-time-slot-item.booked .mobile-slot-time {
    color: #999;
    text-decoration: line-through;
  }

  .mobile-time-slot-item.booked .mobile-slot-status {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
  }

  .mobile-slot-time {
    font-size: 15px;
    font-weight: 500;
    color: #333;
  }

  .mobile-slot-status {
    display: none;
  }

  .mobile-slot-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4CAF50;
  }

  .mobile-time-slot-item.selected .mobile-slot-dot {
    background: #fff;
  }

  .mobile-time-slot-item.booked .mobile-slot-dot {
    display: none;
  }

  /* Mobile Booking Confirm Button */
  .mobile-booking-footer {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    padding: 16px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    z-index: 50;
  }

  .mobile-booking-btn {
    width: 100%;
    min-height: 48px;
    border-radius: 24px;
    background: #FFD700;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
  }

  .mobile-booking-btn:disabled {
    background: #e0e0e0;
    color: #999;
    box-shadow: none;
  }

  .mobile-booking-btn:active {
    transform: scale(0.98);
  }
}

