:root {
  --page: #f4f7fb;
  --page-warm: #f7faff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-tint: #f1f6ff;
  --ink: #172033;
  --ink-soft: #3f4b5f;
  --muted: #738096;
  --line: rgba(16, 24, 40, 0.1);
  --line-strong: rgba(16, 24, 40, 0.16);
  --primary: #1677ff;
  --primary-2: #0f5fd7;
  --primary-soft: #edf5ff;
  --accent: #278bff;
  --accent-soft: #eef7ff;
  --warning: #f59e0b;
  --warning-soft: #fff4d7;
  --danger: #e54863;
  --danger-soft: #fff1f4;
  --brand-ink: #154c9b;
  --ring: rgba(22, 119, 255, 0.24);

  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-1: 0 24px 60px rgba(31, 47, 70, 0.09);
  --shadow-2: 0 16px 36px rgba(31, 47, 70, 0.08);
  --shadow-soft: 0 8px 22px rgba(31, 47, 70, 0.07);
  --font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .85, .2, 1);
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-family);
  letter-spacing: -0.01em;
  background:
    radial-gradient(860px 540px at 8% 0%, rgba(22, 119, 255, 0.11), transparent 60%),
    radial-gradient(760px 500px at 92% 12%, rgba(83, 177, 253, 0.1), transparent 56%),
    linear-gradient(135deg, #f8fbff 0%, #f3f6fb 52%, #f8fafc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(22, 119, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 119, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  width: min(1420px, calc(100% - 24px));
  margin: 12px auto 36px;
  padding: clamp(14px, 2vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(20px);
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 34px rgba(16, 24, 40, 0.08);
  backdrop-filter: blur(24px);
}

.topbar-hidden {
  display: none;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-weight: 900;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.72), transparent 18%),
    linear-gradient(135deg, #1677ff 0%, #43a4ff 100%);
  box-shadow: 0 14px 30px rgba(22, 119, 255, 0.22);
}

.topbar h1 {
  margin: 0;
  color: var(--brand-ink);
  font-size: clamp(1.16rem, 2.5vw, 1.72rem);
  font-weight: 850;
  letter-spacing: -0.035em;
}

.product-kicker {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid rgba(35, 103, 244, 0.12);
  border-radius: 999px;
  color: #28518d;
  background: rgba(232, 240, 255, 0.82);
  font-size: 0.8rem;
  font-weight: 650;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.88);
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease);
}

.nav a:hover {
  transform: translateY(-1px);
  color: var(--brand-ink);
  background: white;
  box-shadow: var(--shadow-soft);
}

.nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 28px rgba(22, 119, 255, 0.2);
}

.content {
  min-height: 460px;
  animation: fadeIn 420ms var(--ease);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-4);
}

.card {
  grid-column: span 6;
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: clamp(18px, 2vw, 24px);
  border: 1px solid rgba(232, 238, 247, 0.95);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(31, 47, 70, 0.06);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.card:nth-child(1) { grid-column: span 7; }
.card:nth-child(2) { grid-column: span 5; }
.card:nth-child(n + 3) { grid-column: span 6; }

.card h2,
.card h3 {
  margin: 0 0 var(--space-2);
  color: var(--brand-ink);
  letter-spacing: -0.035em;
}

.card h2 {
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.card h3 {
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  line-height: 1.25;
}

.card p {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  line-height: 1.72;
}

.card .meta-list {
  margin: 0;
  padding: 0;
  color: var(--ink-soft);
  list-style: none;
}

.card .meta-list li {
  position: relative;
  margin: 0.52rem 0;
  padding-left: 18px;
}

.card .meta-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  background:
    radial-gradient(450px 240px at 82% 12%, rgba(95, 165, 250, 0.32), transparent 58%),
    radial-gradient(420px 260px at 8% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(135deg, #1455c0 0%, #1677ff 58%, #53b5ff 100%);
}

.hero-card h2,
.hero-card h3,
.hero-card p,
.hero-card .small,
.hero-card .muted,
.hero-card .meta-list {
  color: rgba(255, 255, 255, 0.92);
}

.hero-card h2 {
  color: white;
  max-width: 11em;
}

.hero-card::before {
  content: "";
  position: absolute;
  right: -64px;
  bottom: -84px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 80px;
  transform: rotate(24deg);
}

.hero-eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: var(--space-3);
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  font-weight: 700;
}

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: var(--space-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 24px rgba(22, 119, 255, 0.2);
  cursor: pointer;
  font-weight: 760;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), opacity 150ms var(--ease);
}

.btn.secondary {
  color: var(--brand-ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(16, 24, 40, 0.1);
  box-shadow: none;
}

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

.btn:hover:enabled {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(22, 119, 255, 0.24);
}

.btn.secondary:hover:enabled {
  box-shadow: var(--shadow-soft);
}

.role-card {
  min-width: 160px;
  justify-content: flex-start;
  color: var(--brand-ink);
  background: var(--surface-solid);
  border: 1px solid rgba(22, 119, 255, 0.12);
  box-shadow: var(--shadow-soft);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 0.78fr);
  gap: var(--space-4);
  align-items: stretch;
}

.login-brand-panel {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 620px;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(26px, 4vw, 44px);
  border-radius: 30px;
  color: white;
  background:
    radial-gradient(520px 300px at 86% 18%, rgba(96, 199, 255, 0.38), transparent 58%),
    radial-gradient(460px 320px at 10% 0%, rgba(255, 255, 255, 0.22), transparent 56%),
    linear-gradient(135deg, #123f9a 0%, #1677ff 58%, #4db8ff 100%);
  box-shadow: var(--shadow-1);
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  right: -110px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 118px;
  transform: rotate(24deg);
}

.login-brand-panel h2 {
  max-width: 8em;
  margin: 0 0 18px;
  color: white;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.login-brand-panel p {
  max-width: 34em;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.8;
}

.login-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  margin-top: var(--space-6);
}

.login-proof-grid div {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

.login-proof-grid strong {
  display: block;
  color: white;
  font-size: 2rem;
  line-height: 1;
  font-weight: 920;
}

.login-proof-grid span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
}

.login-panel {
  display: grid;
  align-content: start;
  gap: var(--space-5);
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid rgba(232, 238, 247, 0.95);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-2);
}

.login-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.login-panel h2 {
  margin: 4px 0 0;
  color: var(--brand-ink);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: -0.055em;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-field {
  display: grid !important;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink-soft);
  background: transparent;
  cursor: default;
}

.login-field:hover {
  transform: none;
  border-color: transparent;
  background: transparent;
}

.login-field span {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 800;
}

.login-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid rgba(199, 211, 229, 0.9);
  border-radius: 16px;
  color: var(--ink);
  background: #f8fbff;
  outline: none;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background 160ms var(--ease);
}

.login-field input:focus {
  border-color: rgba(22, 119, 255, 0.55);
  background: white;
  box-shadow: 0 0 0 5px var(--ring);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inline-check {
  display: inline-flex !important;
  gap: 8px;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
}

.inline-check:hover {
  transform: none;
  background: transparent;
  border-color: transparent;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.login-error {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 0.86rem;
}

.login-submit {
  width: 100%;
  min-height: 50px;
}

.demo-accounts {
  display: grid;
  gap: 12px;
  padding-top: var(--space-4);
  border-top: 1px solid rgba(16, 24, 40, 0.08);
}

.demo-accounts-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.demo-accounts-title strong {
  color: var(--brand-ink);
}

.demo-accounts-title span {
  color: var(--muted);
  font-size: 0.82rem;
}

.demo-account-list {
  display: grid;
  gap: 10px;
}

.demo-account {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(199, 211, 229, 0.82);
  border-radius: 18px;
  color: var(--ink-soft);
  background: rgba(248, 251, 255, 0.86);
  cursor: pointer;
  text-align: left;
  transition: transform 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease), box-shadow 150ms var(--ease);
}

.demo-account:hover,
.demo-account.active {
  transform: translateY(-1px);
  border-color: rgba(22, 119, 255, 0.36);
  background: white;
  box-shadow: var(--shadow-soft);
}

.demo-account.active .account-avatar {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.demo-account-copy {
  display: grid;
  gap: 3px;
}

.demo-account-copy strong {
  color: var(--brand-ink);
}

.demo-account-copy span {
  color: var(--muted);
  font-size: 0.84rem;
}

body.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    radial-gradient(880px 560px at 50% 18%, rgba(22, 119, 255, 0.08), transparent 62%),
    linear-gradient(180deg, #eef2f7 0%, #e7ebf1 100%);
}

body.login-page::before {
  opacity: 0.42;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

body.login-page .app-shell {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 28px 80px rgba(21, 39, 68, 0.18);
}

body.login-page .content {
  min-height: unset;
}

body.login-page .login-layout {
  grid-template-columns: minmax(390px, 0.92fr) minmax(440px, 1fr);
  gap: 0;
  min-height: 790px;
  overflow: hidden;
  border-radius: 14px;
  background: white;
}

body.login-page .login-panel {
  align-content: stretch;
  grid-template-rows: auto 1fr auto auto auto auto;
  gap: 20px;
  padding: clamp(30px, 5vw, 56px);
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.login-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #121826;
  font-size: 1.02rem;
  font-weight: 900;
}

.login-logo-row .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

body.login-page .login-panel-head {
  display: grid;
  align-content: end;
  gap: 9px;
  margin-top: auto;
  text-align: center;
}

body.login-page .login-panel h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

body.login-page .login-panel-head p {
  margin: 0;
  color: #8a93a3;
  font-size: 0.94rem;
}

body.login-page .login-form {
  align-self: start;
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  gap: 13px;
}

body.login-page .login-field span {
  color: #283244;
  font-size: 0.78rem;
}

body.login-page .login-field input {
  min-height: 42px;
  border-color: #e7ebf2;
  border-radius: 5px;
  background: #fff;
  font-size: 0.9rem;
}

body.login-page .login-field input::placeholder {
  color: #b0b8c6;
}

body.login-page .login-options {
  margin-top: -2px;
}

body.login-page .inline-check,
body.login-page .text-button {
  font-size: 0.8rem;
}

body.login-page .login-submit {
  min-height: 42px;
  border-radius: 5px;
  background: linear-gradient(180deg, #4c46ff 0%, #372fe7 100%);
  box-shadow: 0 12px 26px rgba(55, 47, 231, 0.26);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  width: 100%;
  margin: -2px auto 0;
  color: #a0a8b6;
  font-size: 0.78rem;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #edf0f5;
}

.login-sso-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
}

.sso-button {
  min-height: 40px;
  border: 1px solid #e6eaf1;
  border-radius: 7px;
  color: #293348;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

body.login-page .demo-accounts {
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  padding-top: 16px;
}

body.login-page .demo-account-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.login-page .demo-account {
  min-height: 58px;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  padding: 9px;
  border-radius: 9px;
  background: #fbfcff;
}

body.login-page .demo-account .account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #eef3ff;
  font-size: 0.78rem;
}

body.login-page .demo-account-copy strong {
  font-size: 0.82rem;
}

body.login-page .demo-account-copy span {
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.login-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  color: #a0a8b6;
  font-size: 0.78rem;
}

body.login-page .login-brand-panel {
  min-height: unset;
  margin: 18px;
  padding: clamp(34px, 5vw, 64px);
  border-radius: 14px;
  background:
    radial-gradient(520px 420px at 62% 4%, rgba(255, 255, 255, 0.12), transparent 54%),
    radial-gradient(440px 400px at 106% 64%, rgba(255, 255, 255, 0.11), transparent 60%),
    linear-gradient(135deg, #332cff 0%, #3831ea 48%, #2520c8 100%);
}

body.login-page .login-brand-panel::before {
  left: -90px;
  right: auto;
  bottom: -110px;
  width: 360px;
  height: 360px;
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  transform: none;
}

body.login-page .login-brand-panel h2 {
  max-width: 12em;
  font-size: clamp(1.95rem, 3.6vw, 3.05rem);
  line-height: 1.16;
  letter-spacing: -0.055em;
  text-wrap: pretty;
}

body.login-page .login-brand-panel p {
  max-width: 35em;
  font-size: 0.96rem;
}

.login-preview-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 360px;
}

.preview-main-card {
  position: relative;
  width: min(460px, 92%);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 70px rgba(7, 10, 96, 0.28);
}

.preview-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #637089;
  font-size: 0.82rem;
}

.preview-card-head strong {
  color: #392ee8;
  font-size: 2.1rem;
  line-height: 1;
}

.preview-bars {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 110px;
  margin: 18px 0;
  padding: 14px;
  border-radius: 12px;
  background: #f4f6fb;
}

.preview-bars i {
  display: block;
  flex: 1;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #645cff, #2f86ff);
}

.preview-table {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  color: #7a8495;
  font-size: 0.82rem;
}

.preview-table strong {
  color: #182133;
}

.preview-float-card {
  position: absolute;
  right: 2%;
  bottom: 58px;
  min-width: 150px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 55px rgba(7, 10, 96, 0.26);
}

.preview-float-card span {
  display: block;
  color: #778195;
  font-size: 0.78rem;
}

.preview-float-card strong {
  display: block;
  margin-top: 6px;
  color: #392ee8;
  font-size: 2rem;
  line-height: 1;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: var(--space-4);
}

.account-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 20px;
  color: white;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 26px rgba(10, 55, 122, 0.16);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms var(--ease), background 160ms var(--ease), box-shadow 160ms var(--ease);
}

.account-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 18px 34px rgba(10, 55, 122, 0.22);
}

.account-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  color: var(--brand-ink);
  background: white;
  font-weight: 900;
}

.account-copy {
  display: grid;
  gap: 3px;
}

.account-copy strong {
  color: white;
  font-size: 1rem;
}

.account-copy span,
.account-copy small {
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
}

.role-workbench {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-4);
}

.role-workbench .card {
  grid-column: span 6;
}

.role-workbench .role-hero {
  grid-column: span 12;
}

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

.action-list {
  display: grid;
  gap: 10px;
}

.action-card {
  padding: 13px;
  border: 1px solid rgba(22, 119, 255, 0.12);
  border-radius: 16px;
  background: rgba(237, 246, 255, 0.72);
}

.action-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-ink);
}

body.dashboard-page {
  background:
    linear-gradient(180deg, #f6f8fb 0%, #eef2f6 100%);
}

body.dashboard-page::before {
  display: none;
}

body.dashboard-page .app-shell {
  width: min(1360px, calc(100% - 28px));
  margin-top: 14px;
  border: 1px solid #e6ebf2;
  border-radius: 18px;
  background: #f8fafc;
  box-shadow: 0 16px 40px rgba(20, 35, 55, 0.08);
  backdrop-filter: none;
}

body.dashboard-page .topbar {
  position: static;
  margin-bottom: 18px;
  padding: 16px 18px 12px;
  border: 1px solid #e7ecf3;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

body.dashboard-page .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1f6ed4;
  box-shadow: none;
}

body.dashboard-page .product-kicker {
  color: #6b7280;
}

body.dashboard-page .topbar h1 {
  color: #102033;
  font-size: 1.42rem;
  letter-spacing: -0.025em;
}

body.dashboard-page .badge {
  border-color: #d8e0ea;
  color: #38506b;
  background: #f7f9fc;
  box-shadow: none;
}

body.dashboard-page .badge::before {
  background: #6b89ad;
}

body.dashboard-page .nav {
  padding: 4px;
  border-color: #e3e8ef;
  border-radius: 10px;
  background: #f8fafc;
}

body.dashboard-page .nav a {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  color: #4b5563;
}

body.dashboard-page .nav a:hover {
  transform: none;
  box-shadow: none;
}

body.dashboard-page .nav a.active {
  color: #ffffff;
  background: #1f6ed4;
  box-shadow: none;
}

body.dashboard-page .role-workbench {
  gap: 16px;
}

body.dashboard-page .card {
  border-color: #e4e9f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
}

body.dashboard-page .card::after {
  display: none;
}

body.dashboard-page .card h2,
body.dashboard-page .card h3 {
  color: #13243a;
  letter-spacing: -0.025em;
}

body.dashboard-page .role-workbench .role-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 0.95fr);
  gap: 28px;
  align-items: end;
  min-height: auto;
  padding: 26px 28px;
  color: #13243a;
  background:
    linear-gradient(90deg, rgba(31, 110, 212, 0.06), transparent 62%),
    #ffffff;
}

body.dashboard-page .role-hero::before {
  display: none;
}

body.dashboard-page .role-hero h2 {
  max-width: 17em;
  color: #102033;
  font-size: clamp(1.55rem, 2.6vw, 2.35rem);
  line-height: 1.18;
  letter-spacing: -0.05em;
}

body.dashboard-page .role-hero p,
body.dashboard-page .role-hero .small,
body.dashboard-page .role-hero .muted {
  color: #5f6b7a;
}

body.dashboard-page .hero-eyebrow {
  margin-bottom: 12px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  color: #1f6ed4;
  background: transparent;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

body.dashboard-page .role-hero .metric {
  align-self: stretch;
}

body.dashboard-page .metric {
  gap: 12px;
}

body.dashboard-page .metric-item {
  padding: 14px 16px;
  border-color: #e4e9f0;
  border-radius: 10px;
  background: #fbfcfe;
}

body.dashboard-page .metric-label {
  color: #667085;
  font-size: 0.78rem;
  font-weight: 650;
}

body.dashboard-page .metric-value {
  margin-top: 8px;
  color: #142235;
  font-size: 1.72rem;
  font-weight: 760;
  letter-spacing: -0.03em;
}

body.dashboard-page .progress {
  height: 7px;
  background: #edf1f6;
}

body.dashboard-page .progress .bar {
  background: #1f6ed4;
}

body.dashboard-page .table {
  border-color: #e5eaf1;
  border-radius: 10px;
  box-shadow: none;
}

body.dashboard-page .table th,
body.dashboard-page .table td {
  padding: 12px 14px;
  border-bottom-color: #edf1f5;
  color: #465467;
  font-size: 0.88rem;
}

body.dashboard-page .table thead th {
  color: #344054;
  background: #f7f9fc;
  font-weight: 700;
}

body.dashboard-page .action-card {
  border-color: #e4e9f0;
  border-radius: 10px;
  background: #fbfcfe;
}

body.dashboard-page .action-card strong {
  color: #13243a;
}

body.dashboard-page .state {
  border-color: #e4e9f0;
  border-radius: 10px;
  background: #fbfcfe;
}

body.app-page {
  background: #b8c0ca;
}

body.app-page::before {
  display: none;
}

body.app-page .app-shell {
  display: grid;
  grid-template-columns: 206px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f3f5f9;
  box-shadow: none;
  backdrop-filter: none;
}

body.app-page .app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 28px;
  margin: 0;
  padding: 28px 24px;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

body.app-page .sidebar-brand {
  display: block;
}

body.app-page .brand-lockup {
  gap: 10px;
}

body.app-page .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #6c5ce7;
  box-shadow: none;
  font-size: 0.86rem;
}

body.app-page .product-kicker {
  margin: 0;
  color: #8b95a5;
  font-size: 0.72rem;
}

body.app-page .topbar h1 {
  margin-top: 2px;
  color: #111827;
  font-size: 1.12rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.sidebar-section {
  display: grid;
  gap: 12px;
}

.sidebar-label {
  color: #a3acba;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.app-page .nav {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.app-page .nav a {
  min-height: 38px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  color: #111827;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 700;
}

body.app-page .nav a:hover {
  transform: none;
  background: #f4f2ff;
  box-shadow: none;
}

body.app-page .nav a.active {
  color: #ffffff;
  background: #6c5ce7;
  box-shadow: none;
}

.sidebar-profile {
  margin-top: auto;
}

.sidebar-user-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.sidebar-user-card > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #3f2bc0;
  background: #eeeaff;
  font-size: 0.78rem;
  font-weight: 850;
}

.sidebar-user-card strong,
.sidebar-user-card small,
.sidebar-build {
  display: block;
}

.sidebar-user-card strong {
  color: #111827;
  font-size: 0.86rem;
}

.sidebar-user-card small,
.sidebar-build {
  color: #9aa4b2;
  font-size: 0.72rem;
  line-height: 1.5;
}

.sidebar-logout {
  width: 100%;
  min-height: 36px;
  margin-top: 12px;
  border: 1px solid #e4e8f0;
  border-radius: 10px;
  color: #c2410c;
  background: #fff7ed;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
}

.sidebar-logout:hover {
  border-color: #fed7aa;
  background: #ffedd5;
}

/* Anomaly highlights for dashboards (lead / boss / brand-admin) */
.data-pill {
  display: inline-flex;
  align-items: center;
  min-width: 36px;
  padding: 2px 10px;
  border-radius: 999px;
  color: #475467;
  background: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.data-pill.is-stable {
  color: #475467;
  background: #f1f5f9;
}

.data-pill.is-warning {
  color: #b35a00;
  background: #fff3e0;
}

.data-pill.is-danger {
  color: #b42318;
  background: #fee4e2;
}

.data-row-alert td:first-child {
  position: relative;
  padding-left: 18px;
}

.data-row-alert td:first-child::before {
  content: '';
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 6px;
  width: 3px;
  border-radius: 2px;
  background: #f0b25e;
}

.data-row-danger td:first-child::before {
  background: #d92d20;
}

body.app-page .metric-item.is-warning {
  border-color: #fcd9a4;
  background: #fff8ec;
}

body.app-page .metric-item.is-warning .metric-value {
  color: #b35a00;
}

body.app-page .metric-item.is-danger {
  border-color: #fda29b;
  background: #fef3f2;
}

body.app-page .metric-item.is-danger .metric-value {
  color: #b42318;
}

body.app-page .content {
  height: 100vh;
  min-height: auto;
  padding: 22px 26px 30px;
  overflow-y: auto;
  animation: fadeIn 280ms var(--ease);
}

.app-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.app-search {
  display: grid !important;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #dfe4ec;
  border-radius: 999px;
  color: #8b95a5;
  background: #ffffff;
}

.app-search:hover {
  transform: none;
  background: #ffffff;
  border-color: #dfe4ec;
}

.app-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #111827;
  background: transparent;
  font-size: 0.86rem;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #e2e7ef;
  border-radius: 50%;
  color: #111827;
  background: #ffffff;
  cursor: pointer;
}

.toolbar-user {
  display: grid;
  grid-template-columns: 36px auto;
  gap: 10px;
  align-items: center;
  padding-left: 12px;
  border-left: 1px solid #d9dee7;
}

.toolbar-user span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #3f2bc0;
  background: #eeeaff;
  font-size: 0.78rem;
  font-weight: 850;
}

.toolbar-user strong {
  color: #111827;
  font-size: 0.9rem;
}

body.app-page .card-grid,
body.app-page .role-workbench {
  gap: 18px;
}

body.app-page .card,
body.app-page .ai-panel,
body.app-page .practice-side,
body.app-page .quiz-stage {
  border: 1px solid #e4e8f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: none;
}

body.app-page .card::after,
body.app-page .hero-card::before {
  display: none;
}

body.app-page .card h2,
body.app-page .card h3,
body.app-page .ai-panel-title,
body.app-page .chat-title {
  color: #111827;
  letter-spacing: -0.035em;
}

body.app-page .card p {
  color: #667085;
}

body.app-page .hero-card {
  min-height: 176px;
  background:
    radial-gradient(520px 220px at 92% 0%, rgba(108, 92, 231, 0.08), transparent 58%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

body.app-page .hero-card h2,
body.app-page .hero-card h3 {
  color: #111827;
}

body.app-page .hero-card p,
body.app-page .hero-card .small,
body.app-page .hero-card .muted {
  color: #667085;
}

body.app-page .hero-eyebrow {
  margin-bottom: 12px;
  padding: 0 0 0 12px;
  border: 0;
  border-left: 3px solid #6c5ce7;
  border-radius: 0;
  color: #6c5ce7;
  background: transparent;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.app-page .metric-item,
body.app-page .action-card,
body.app-page .analysis-card,
body.app-page .state {
  border-color: #e5eaf1;
  border-radius: 14px;
  background: #fbfcff;
  box-shadow: none;
}

body.app-page .metric-value {
  color: #111827;
  font-weight: 820;
}

body.app-page .chip {
  border: 0;
  color: #6c5ce7;
  background: #f1efff;
}

body.app-page .btn {
  border-radius: 999px;
  background: #111827;
  box-shadow: none;
}

body.app-page .btn.secondary {
  color: #111827;
  background: #ffffff;
  border-color: #dfe4ec;
}

body.app-page .table {
  border-color: #e5eaf1;
  border-radius: 14px;
}

body.app-page .table thead th {
  color: #667085;
  background: #f8fafc;
}

body.app-page .progress {
  height: 6px;
  background: #edf1f6;
}

body.app-page .progress .bar,
body.app-page .quiz-progress-fill {
  background: #6c5ce7;
}

body.app-page .ai-workspace {
  grid-template-columns: minmax(230px, 0.8fr) minmax(420px, 1.35fr) minmax(280px, 0.9fr);
  min-height: 680px;
}

body.app-page .ai-panel {
  overflow: hidden;
}

body.app-page .ai-panel-header,
body.app-page .chat-header,
body.app-page .practice-side-header {
  border-bottom-color: #e8edf4;
  background: #ffffff;
}

body.app-page .lesson-canvas {
  border-color: #e5eaf1;
  background: #f8fafc;
}

body.app-page .lesson-canvas h2 {
  color: #111827;
}

body.app-page .lesson-stat {
  box-shadow: none;
}

body.app-page .lesson-stat strong,
body.app-page .score-ring {
  color: #6c5ce7;
}

body.app-page .score-ring {
  background:
    radial-gradient(circle at center, white 58%, transparent 59%),
    conic-gradient(#6c5ce7 0 87%, #e6edf7 87% 100%);
}

body.app-page .chat-stream {
  background: #f8fafc;
}

body.app-page .message-bubble {
  box-shadow: none;
}

body.app-page .message.user .message-bubble {
  background: #111827;
}

body.app-page .practice-workspace {
  grid-template-columns: minmax(520px, 1fr) 300px;
}

body.app-page .quiz-stage {
  background: #ffffff;
}

body.app-page .quiz-stage.is-focus {
  color: #111827;
  background: #ffffff;
}

body.app-page .quiz-stage.is-focus .quiz-title {
  color: #111827;
}

body.app-page .quiz-stage.is-focus .quiz-subtitle,
body.app-page .quiz-stage.is-focus .quiz-counter,
body.app-page .quiz-stage.is-focus .quiz-feedback {
  color: #667085;
}

body.app-page .quiz-kicker,
body.app-page .quiz-stage.is-focus .quiz-kicker {
  color: #6c5ce7;
}

body.app-page .quiz-option,
body.app-page .quiz-stage.is-focus .quiz-option {
  border-color: #e4e8f0;
  color: #344054;
  background: #ffffff;
}

body.app-page .quiz-option.is-selected,
body.app-page .quiz-stage.is-focus .quiz-option.is-selected {
  border-color: #6c5ce7;
  background: #f3f0ff;
}

body.app-page.teacher-page .card-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.8fr);
  align-items: start;
}

body.app-page.teacher-page .teacher-summary-card {
  grid-column: 1;
  display: grid;
  gap: 18px;
  min-height: 224px;
  padding: 30px 32px;
}

body.app-page.teacher-page .teacher-summary-card h2 {
  max-width: 11em;
  font-size: clamp(2rem, 3.6vw, 3.55rem);
  line-height: 1.02;
  letter-spacing: -0.075em;
}

body.app-page.teacher-page .teacher-summary-card .row {
  margin-top: 0;
}

body.app-page.teacher-page .teacher-summary-card .btn {
  min-height: 42px;
  padding-inline: 18px;
}

body.app-page.teacher-page .teacher-task-card {
  grid-column: 2;
  min-height: 224px;
  padding: 30px 32px;
}

body.app-page.teacher-page .teacher-task-card h3 {
  margin-bottom: 14px;
  font-size: 1.35rem;
}

body.app-page.teacher-page .teacher-task-card p {
  margin-bottom: 16px;
  color: #4f5f73;
  font-size: 1rem;
}

body.app-page.teacher-page .teacher-task-card .meta-list li {
  margin: 0.62rem 0;
  padding-left: 20px;
}

body.app-page.teacher-page .teacher-task-card .meta-list li::before {
  top: 0.62em;
  width: 8px;
  height: 8px;
  background: #6c5ce7;
  box-shadow: 0 0 0 4px #f0edff;
}

body.app-page.teacher-page .card:nth-child(3),
body.app-page.teacher-page .card:nth-child(4) {
  grid-column: span 1;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 10px;
  border: 1px solid rgba(35, 103, 244, 0.12);
  border-radius: 999px;
  color: #28518d;
  background: var(--primary-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

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

.metric-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.92));
}

.metric-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric-value {
  margin-top: 6px;
  color: var(--brand-ink);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.progress .bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #24a8ff);
  transition: width 640ms var(--ease);
}

.state {
  margin-bottom: var(--space-3);
  padding: 14px;
  border: 1px solid rgba(35, 103, 244, 0.14);
  border-radius: 18px;
  color: var(--ink-soft);
  background: linear-gradient(180deg, rgba(232, 240, 255, 0.7), rgba(255, 255, 255, 0.75));
}

.state h3 { margin-top: 0; }

.state.empty {
  border-color: rgba(245, 158, 11, 0.24);
  background: linear-gradient(180deg, var(--warning-soft), rgba(255,255,255,0.78));
}

.state.error {
  border-color: rgba(229, 72, 99, 0.24);
  background: linear-gradient(180deg, var(--danger-soft), rgba(255,255,255,0.82));
}

.skeleton {
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  animation: shimmer 1.15s infinite;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: rgba(35, 103, 244, 0.12);
}

.state-switch {
  display: inline-flex;
  overflow: hidden;
  margin: 8px 0 16px;
  padding: 4px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 16px;
  background: #f2f5fa;
}

.state-switch button {
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.state-switch button.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(35, 103, 244, 0.22);
}

.table {
  width: 100%;
  overflow: hidden;
  margin-top: 10px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 18px;
  background: white;
}

.table th,
.table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
  color: var(--ink-soft);
  text-align: left;
  font-size: 0.9rem;
}

.table thead th {
  color: var(--brand-ink);
  background: #f6f8fc;
  font-weight: 800;
}

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

.small {
  color: var(--muted);
  font-size: 0.9rem;
}

.muted { color: var(--muted); }

label {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 16px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  transition: border-color 150ms var(--ease), transform 150ms var(--ease), background 150ms var(--ease);
}

label:hover {
  transform: translateY(-1px);
  border-color: rgba(35, 103, 244, 0.28);
  background: white;
}

input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.access-denied {
  padding: 18px;
  border: 1px solid rgba(229, 72, 99, 0.28);
  border-radius: 20px;
  background: var(--danger-soft);
}

.ai-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 1.45fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: stretch;
  min-height: 680px;
}

.ai-panel {
  overflow: hidden;
  border: 1px solid rgba(225, 232, 242, 0.96);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 14px 34px rgba(31, 47, 70, 0.065);
}

.ai-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(225, 232, 242, 0.88);
}

.ai-panel-title {
  margin: 0;
  color: var(--brand-ink);
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.lesson-canvas {
  margin: 16px;
  padding: 26px 22px;
  min-height: 300px;
  border: 1px solid #e5ebf4;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(247, 250, 255, 0.92), rgba(239, 244, 250, 0.92)),
    radial-gradient(circle at 95% 18%, rgba(22, 119, 255, 0.12), transparent 24%);
}

.lesson-canvas h2 {
  margin: 0 0 22px;
  max-width: 13em;
  color: #1677ff;
  font-size: clamp(1.28rem, 2.2vw, 1.72rem);
  line-height: 1.24;
  letter-spacing: -0.045em;
}

.lesson-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.lesson-stat {
  padding: 14px 10px;
  border-radius: 12px;
  text-align: center;
  background: white;
  box-shadow: 0 8px 18px rgba(31, 47, 70, 0.07);
}

.lesson-stat strong {
  display: block;
  color: #1677ff;
  font-size: 1.55rem;
  line-height: 1;
}

.lesson-stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.mini-table {
  width: min(220px, 100%);
  margin: 18px auto 6px;
  padding: 10px;
  border-radius: 12px;
  color: #273142;
  background: white;
  box-shadow: 0 8px 18px rgba(31, 47, 70, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}

.mini-table-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 2px;
  border-bottom: 1px solid #edf1f6;
}

.mini-table-row:last-child { border-bottom: 0; }

.cue-card {
  margin: 0 16px 16px;
  padding: 14px;
  border: 1px solid rgba(22, 119, 255, 0.1);
  border-radius: 18px;
  background: var(--primary-soft);
}

.cue-card h3 {
  margin: 0 0 8px;
  color: var(--brand-ink);
  font-size: 0.96rem;
}

.scenario-controls {
  display: grid;
  gap: 12px;
  margin: 16px;
}

.selector-block {
  display: grid;
  gap: 8px;
}

.selector-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.scenario-select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(199, 211, 229, 0.9);
  border-radius: 14px;
  color: var(--ink-soft);
  background: white;
  outline: none;
}

.persona-card {
  padding: 12px;
  border: 1px solid rgba(22, 119, 255, 0.12);
  border-radius: 16px;
  background: #f7fbff;
}

.persona-card strong {
  display: block;
  color: var(--brand-ink);
  margin-bottom: 4px;
}

.cue-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cue-list li {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 680px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid rgba(225, 232, 242, 0.9);
  background: rgba(255, 255, 255, 0.72);
}

.chat-title {
  margin: 0;
  color: var(--brand-ink);
  font-size: 1.2rem;
  letter-spacing: -0.035em;
}

.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding: 22px 18px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.64), rgba(255, 255, 255, 0.88)),
    radial-gradient(circle at 12% 10%, rgba(22, 119, 255, 0.06), transparent 28%);
}

.message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  max-width: 86%;
}

.message.user {
  align-self: flex-end;
  grid-template-columns: minmax(0, 1fr) 38px;
}

.message-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  color: #1677ff;
  background: #eaf4ff;
  font-size: 0.82rem;
  font-weight: 850;
}

.message.user .message-avatar {
  grid-column: 2;
  grid-row: 1;
  color: white;
  background: #1677ff;
}

.message-bubble {
  padding: 12px 14px;
  border: 1px solid rgba(225, 232, 242, 0.92);
  border-radius: 18px 18px 18px 6px;
  color: var(--ink-soft);
  background: white;
  box-shadow: 0 8px 20px rgba(31, 47, 70, 0.055);
}

.message.user .message-bubble {
  grid-column: 1;
  grid-row: 1;
  border-color: rgba(22, 119, 255, 0.18);
  border-radius: 18px 18px 6px 18px;
  color: white;
  background: linear-gradient(135deg, #1677ff, #0f63dc);
}

.message-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.message.user .message-meta {
  color: rgba(255, 255, 255, 0.72);
}

.message-bubble p {
  margin: 0;
  line-height: 1.7;
}

.voice-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(22, 119, 255, 0.08);
  color: #1677ff;
  font-size: 0.8rem;
  font-weight: 800;
}

.message.user .voice-pill {
  color: white;
  background: rgba(255, 255, 255, 0.18);
}

.voice-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.voice-wave i {
  display: block;
  width: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
}

.voice-wave i:nth-child(1) { height: 8px; }
.voice-wave i:nth-child(2) { height: 14px; }
.voice-wave i:nth-child(3) { height: 10px; }
.voice-wave i:nth-child(4) { height: 18px; }
.voice-wave i:nth-child(5) { height: 9px; }

.chat-composer {
  padding: 14px;
  border-top: 1px solid rgba(225, 232, 242, 0.9);
  background: rgba(255, 255, 255, 0.9);
}

.composer-box {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(199, 211, 229, 0.9);
  border-radius: 18px;
  background: #f8fafc;
}

.composer-input {
  width: 100%;
  min-height: 40px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.icon-btn {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(199, 211, 229, 0.86);
  border-radius: 14px;
  color: var(--brand-ink);
  background: white;
  cursor: pointer;
}

.icon-btn.recording {
  color: white;
  background: #ff5f7a;
  border-color: transparent;
  animation: pulseRecord 1s infinite;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quick-prompts button {
  border: 1px solid rgba(22, 119, 255, 0.12);
  border-radius: 999px;
  padding: 7px 10px;
  color: #2a5f9f;
  background: #edf6ff;
  cursor: pointer;
  font-size: 0.8rem;
}

.insight-body {
  padding: 16px;
}

.score-hero {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.score-ring {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border-radius: 50%;
  color: #1677ff;
  background:
    radial-gradient(circle at center, white 58%, transparent 59%),
    conic-gradient(#1677ff 0 87%, #e6edf7 87% 100%);
  font-size: 1.7rem;
  font-weight: 920;
  box-shadow: inset 0 0 0 1px #e5ebf4;
}

.dimension-list {
  display: grid;
  gap: 10px;
}

.dimension-item {
  display: grid;
  gap: 6px;
}

.dimension-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.analysis-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(225, 232, 242, 0.94);
  border-radius: 18px;
  background: #fbfdff;
}

.analysis-card h3 {
  margin: 0 0 8px;
  color: var(--brand-ink);
  font-size: 0.96rem;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.status-strip button {
  border: 1px solid rgba(199, 211, 229, 0.86);
  border-radius: 12px;
  padding: 8px 6px;
  color: var(--ink-soft);
  background: white;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 760;
}

.status-strip button.active {
  color: white;
  background: #1677ff;
  border-color: transparent;
}

.practice-workspace {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 300px;
  gap: 16px;
  align-items: stretch;
  min-height: 650px;
}

.quiz-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  min-height: 650px;
  border: 1px solid rgba(225, 232, 242, 0.96);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 249, 253, 0.94)),
    radial-gradient(circle at 20% 10%, rgba(22, 119, 255, 0.08), transparent 28%);
  box-shadow: 0 14px 34px rgba(31, 47, 70, 0.065);
}

.quiz-stage.is-focus {
  color: white;
  background:
    linear-gradient(rgba(18, 20, 24, 0.84), rgba(18, 20, 24, 0.84)),
    radial-gradient(circle at 24% 18%, rgba(22, 119, 255, 0.28), transparent 34%),
    linear-gradient(135deg, #f4f7fb, #dde7f5);
}

.quiz-top {
  display: grid;
  gap: 10px;
  padding: 22px 24px 12px;
}

.quiz-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.quiz-progress-track {
  overflow: hidden;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.12);
}

.quiz-stage.is-focus .quiz-progress-track {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.18);
}

.quiz-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1677ff, #62b7ff);
  transition: width 280ms var(--ease);
}

.quiz-counter {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.quiz-stage.is-focus .quiz-counter {
  color: rgba(255, 255, 255, 0.72);
}

.quiz-body {
  display: grid;
  align-content: center;
  padding: 20px clamp(24px, 5vw, 72px);
}

.quiz-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: #1677ff;
  font-weight: 850;
}

.quiz-stage.is-focus .quiz-kicker {
  color: #62b7ff;
}

.quiz-kicker::before {
  content: "";
  width: 3px;
  height: 24px;
  border-radius: 999px;
  background: currentColor;
}

.quiz-title {
  margin: 0 0 10px;
  color: var(--brand-ink);
  font-size: clamp(1.42rem, 2.7vw, 2.15rem);
  line-height: 1.25;
  letter-spacing: -0.045em;
  text-align: center;
}

.quiz-stage.is-focus .quiz-title {
  color: rgba(255, 255, 255, 0.95);
}

.quiz-subtitle {
  margin: 0 auto 28px;
  max-width: 660px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

.quiz-stage.is-focus .quiz-subtitle {
  color: rgba(255, 255, 255, 0.72);
}

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

.quiz-option {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 13px 15px;
  border: 1px solid rgba(199, 211, 229, 0.92);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease), box-shadow 160ms var(--ease);
}

.quiz-stage.is-focus .quiz-option {
  border-color: rgba(255, 255, 255, 0.24);
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.08);
}

.quiz-option:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 119, 255, 0.38);
  box-shadow: 0 10px 22px rgba(31, 47, 70, 0.08);
}

.quiz-option.is-selected {
  border-color: #1677ff;
  background: #edf6ff;
  box-shadow: 0 10px 24px rgba(22, 119, 255, 0.16);
}

.quiz-stage.is-focus .quiz-option.is-selected {
  background: rgba(22, 119, 255, 0.36);
}

.quiz-option.is-correct {
  border-color: rgba(16, 185, 129, 0.5);
  background: #ecfdf5;
}

.quiz-option.is-wrong {
  border-color: rgba(229, 72, 99, 0.45);
  background: #fff1f4;
}

.option-letter {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: #1677ff;
  background: #edf6ff;
  font-size: 0.8rem;
  font-weight: 900;
}

.quiz-stage.is-focus .option-letter {
  color: white;
  background: rgba(255, 255, 255, 0.16);
}

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 24px 22px;
}

.quiz-feedback {
  min-height: 42px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.quiz-stage.is-focus .quiz-feedback {
  color: rgba(255, 255, 255, 0.74);
}

.practice-side {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(225, 232, 242, 0.96);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(31, 47, 70, 0.065);
}

.practice-side-header {
  padding: 18px;
  border-bottom: 1px solid rgba(225, 232, 242, 0.92);
}

.trophy-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 12px;
  font-size: 1.6rem;
}

.leaderboard {
  overflow: auto;
  padding: 4px 16px 14px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 28px 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(225, 232, 242, 0.7);
}

.leaderboard-rank {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.leaderboard-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #1677ff;
  background: #edf6ff;
  font-size: 0.8rem;
  font-weight: 850;
}

.leaderboard-name {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.leaderboard-score {
  color: var(--brand-ink);
  font-weight: 900;
}

.side-action {
  padding: 16px;
  border-top: 1px solid rgba(225, 232, 242, 0.92);
}

.side-action .btn {
  width: 100%;
}

@keyframes pulseRecord {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 95, 122, 0.28); }
  50% { box-shadow: 0 0 0 8px rgba(255, 95, 122, 0); }
}

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

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@media (max-width: 960px) {
  body.login-page {
    align-items: start;
    padding: 16px 0;
  }

  body.login-page .app-shell {
    width: min(100% - 24px, 100%);
  }

  body.login-page .login-layout {
    grid-template-columns: 1fr;
    min-height: unset;
  }

  body.login-page .login-brand-panel {
    min-height: 460px;
    order: -1;
  }

  body.dashboard-page .role-workbench .role-hero {
    grid-template-columns: 1fr;
  }

  body.app-page.teacher-page .card-grid {
    grid-template-columns: 1fr;
  }

  body.app-page.teacher-page .teacher-summary-card,
  body.app-page.teacher-page .teacher-task-card,
  body.app-page.teacher-page .card:nth-child(3),
  body.app-page.teacher-page .card:nth-child(4) {
    grid-column: 1;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 420px;
  }

  .ai-workspace {
    grid-template-columns: 1fr;
  }

  .practice-workspace {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: 640px;
  }

  .card,
  .card:nth-child(1),
  .card:nth-child(2),
  .card:nth-child(n + 3),
  .role-workbench .card,
  .span-12,
  .span-8,
  .span-7,
  .span-6,
  .span-5,
  .span-4 {
    grid-column: span 12;
  }

  .account-grid,
  .login-proof-grid,
  .forecast-grid {
    grid-template-columns: 1fr;
  }

  .brand-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .meta {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  body.login-page .app-shell {
    width: min(100% - 18px, 100%);
    padding: 8px;
  }

  body.login-page .login-panel {
    padding: 28px 18px;
  }

  body.login-page .login-brand-panel {
    margin: 8px;
    padding: 28px 20px;
  }

  body.login-page .demo-account-list,
  .login-sso-row,
  .login-proof-grid {
    grid-template-columns: 1fr;
  }

  .login-footer-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell {
    width: min(100% - 18px, 100%);
    margin-top: 9px;
    padding: 10px;
    border-radius: 24px;
  }

  .topbar {
    position: static;
    border-radius: 20px;
  }

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

  .lesson-stat-row,
  .quiz-options,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .quiz-body {
    padding: 20px;
  }

  .quiz-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .message,
  .message.user {
    max-width: 100%;
  }

  .composer-box {
    grid-template-columns: auto 1fr auto;
  }

  .composer-box .btn {
    grid-column: 1 / -1;
  }

  .nav a {
    flex: 1 1 auto;
    justify-content: center;
  }
}
