:root {
  color-scheme: light;
  --bg: #edf7ff;
  --surface: #ffffff;
  --surface-strong: #fff8dc;
  --text: #182033;
  --muted: #647087;
  --line: #e5eaf3;
  --accent: #35c976;
  --accent-strong: #149c54;
  --accent-soft: #e5f9ef;
  --blue: #3f8cff;
  --coral: #ff705d;
  --yellow: #ffc84a;
  --teal: #14b8a6;
  --warning: #b45309;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(31, 47, 79, 0.13);
  --small-shadow: 0 10px 25px rgba(31, 47, 79, 0.1);
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 200, 74, 0.28), transparent 28rem),
    linear-gradient(180deg, #edf7ff 0%, #f8fbff 42%, #ffffff 100%);
  color: var(--text);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

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

.center-state,
.login-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel,
.message-panel,
.panel {
  width: min(100%, 1120px);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.login-panel {
  width: min(100%, 460px);
  display: grid;
  gap: 22px;
  padding: 32px;
}

.message-panel {
  width: min(100%, 560px);
  padding: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
}

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

label {
  display: grid;
  gap: 7px;
  color: #394553;
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(63, 140, 255, 0.14);
}

.primary-button,
.secondary-button,
.text-button,
.back-button {
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  box-shadow: var(--small-shadow);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--accent-strong), var(--teal));
}

.secondary-button,
.back-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(63, 140, 255, 0.16);
  box-shadow: 0 8px 20px rgba(31, 47, 79, 0.08);
}

.secondary-button:hover,
.back-button:hover {
  border-color: #bbc7d3;
}

.text-button {
  color: #2367c7;
  background: rgba(233, 242, 255, 0.9);
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(31, 47, 79, 0.06);
}

.text-button:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
}

.button-row,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.form-error,
.inline-error {
  margin: 0;
  border-radius: 18px;
  padding: 12px;
  color: var(--danger);
  background: #fff1f0;
  border: 1px solid #ffd5d1;
}

.admin-actions span {
  color: var(--muted);
  font-weight: 900;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

.admin-main {
  min-width: 0;
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 24px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 10px;
}

.brand-logo {
  display: block;
  width: min(190px, 52vw);
  height: auto;
  object-fit: contain;
}

.admin-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.04;
}

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

.home-menu {
  display: grid;
  gap: 18px;
}

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

.home-menu-card {
  display: grid;
  gap: 10px;
  min-height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  padding: 24px;
  text-align: left;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.76)),
    #fff;
  box-shadow: var(--shadow);
}

.home-menu-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.home-menu-card span {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.home-menu-card h3 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.08;
}

.home-menu-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.home-menu-card strong {
  align-self: end;
  color: var(--accent-strong);
  font-size: 0.95rem;
}

.home-menu-card:nth-child(1) {
  background:
    radial-gradient(circle at top right, rgba(53, 201, 118, 0.18), transparent 16rem),
    rgba(255, 255, 255, 0.86);
}

.home-menu-card:nth-child(2) {
  background:
    radial-gradient(circle at top right, rgba(255, 200, 74, 0.24), transparent 16rem),
    rgba(255, 255, 255, 0.86);
}

.dashboard-grid {
  width: 100%;
  margin: 0;
  padding-bottom: 40px;
  display: grid;
  gap: 18px;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

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

.summary-strip article {
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  box-shadow: var(--small-shadow);
}

.summary-strip span {
  display: block;
  margin-bottom: 4px;
  font-size: 1.9rem;
  font-weight: 900;
}

.summary-strip p {
  margin: 0;
  color: var(--muted);
}

.panel {
  padding: 22px;
}

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

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

.form-action-card {
  display: grid;
  gap: 9px;
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 22px;
  padding: 18px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--small-shadow);
}

.form-action-card:hover {
  border-color: var(--accent);
}

.form-action-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(47, 133, 90, 0.12);
}

.call-assist-card {
  background: linear-gradient(180deg, #fff, #f8fff9);
}

.form-action-card span {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.form-action-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.form-action-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.call-assist {
  display: grid;
  gap: 18px;
}

.call-assist-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.call-assist-header h2 {
  margin-bottom: 6px;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.sales-rule-card,
.next-step-card {
  display: grid;
  gap: 8px;
  border: 1px solid #ffd789;
  border-radius: 20px;
  padding: 16px;
  background: #fff8e8;
}

.sales-rule-card span,
.next-step-card span {
  color: var(--warning);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sales-rule-card strong {
  font-size: 1.08rem;
}

.sales-rule-card p,
.next-step-card p {
  margin: 0;
  color: #5d4b2a;
  line-height: 1.45;
}

.call-flow-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

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

.call-branch-button {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
}

.call-branch-button:hover,
.call-branch-button.is-active {
  border-color: var(--accent);
}

.call-branch-button.is-active {
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(47, 133, 90, 0.12);
}

.call-branch-button span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.call-script-panel {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.script-stack {
  display: grid;
  gap: 12px;
}

.script-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
}

.script-card summary {
  padding: 13px 14px;
  color: var(--accent-strong);
  font-weight: 900;
  cursor: pointer;
}

.script-card p {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 14px;
  line-height: 1.55;
}

.decision-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.decision-row article {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: #fff;
}

.decision-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.package-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: #fff;
}

.package-card-featured {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.package-card span {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.package-card h3,
.package-card p {
  margin: 0;
}

.package-card strong {
  color: var(--accent-strong);
  line-height: 1.35;
}

.embedded-form-panel {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.embedded-form-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.embedded-form-header h3 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.iframe-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f7fafc;
}

.iframe-wrap iframe {
  display: block;
  width: 100%;
  min-height: 800px;
  border: 0;
  background: #fff;
}

.form-fallback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 18px;
  padding: 12px;
  background: #f7fafc;
}

.form-fallback p {
  margin: 0;
  color: var(--muted);
}

.fallback-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.fallback-link:hover {
  background: var(--accent-strong);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  color: #2367c7;
  background: rgba(233, 242, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 900;
}

.panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.search-box {
  width: min(100%, 320px);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 22px;
  box-shadow: var(--small-shadow);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.86);
}

th,
td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: #f8fbff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

.user-cell,
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-cell strong,
.user-cell span {
  display: block;
}

.user-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--small-shadow);
}

.avatar-fallback {
  display: inline-grid;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 900;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  color: #2367c7;
  background: rgba(233, 242, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 800;
}

.detail-panel {
  display: grid;
  gap: 20px;
}

.back-button {
  justify-self: start;
}

.detail-header {
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-header .avatar {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.level-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(255, 200, 74, 0.2), transparent 13rem),
    rgba(255, 255, 255, 0.86);
  box-shadow: var(--small-shadow);
}

.level-card-empty {
  background: rgba(255, 255, 255, 0.78);
}

.level-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.level-card-header h3 {
  margin: 0 0 5px;
  font-size: 1.12rem;
}

.level-card-header span {
  color: #2367c7;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.level-card-header strong {
  color: var(--accent-strong);
  font-size: 2rem;
  line-height: 1;
}

.level-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf2;
}

.level-progress div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f4b942);
}

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

.level-stats article,
.level-current,
.level-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.level-stats article {
  display: grid;
  gap: 6px;
}

.level-stats span,
.level-current span,
.level-section h4 {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.level-stats strong,
.level-current strong {
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.level-current {
  display: grid;
  gap: 5px;
}

.level-current small {
  color: var(--muted);
  font-weight: 700;
}

.level-section {
  display: grid;
  gap: 10px;
}

.level-section h4 {
  margin: 0;
}

.module-list {
  display: grid;
  gap: 7px;
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.module-list li {
  display: grid;
  gap: 2px;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f7fafc;
}

.module-list span {
  font-weight: 800;
}

.module-list small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.technical-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.technical-details summary {
  color: var(--accent-strong);
  font-weight: 900;
  cursor: pointer;
}

pre {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  border-radius: 8px;
  padding: 10px;
  background: #f6f8fa;
  color: #26313d;
  font-size: 0.82rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef7ff;
  color: #24435f;
  font-size: 0.82rem;
  font-weight: 800;
}

.empty-state {
  border: 1px dashed #c6d0da;
  border-radius: 8px;
  padding: 28px;
  text-align: center;
  background: #fbfcfd;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.spinner {
  width: 38px;
  height: 38px;
  border: 4px solid rgba(47, 133, 90, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .form-action-grid,
  .home-menu-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 18px;
  }

  .admin-header,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions {
    justify-content: space-between;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .panel,
  .login-panel,
  .message-panel {
    padding: 20px;
  }

  .search-box {
    width: 100%;
  }

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

  .embedded-form-header,
  .call-assist-header,
  .form-fallback {
    align-items: stretch;
    flex-direction: column;
  }

  .call-flow-layout,
  .package-grid {
    grid-template-columns: 1fr;
  }

  .iframe-wrap iframe {
    min-height: 720px;
  }
}

@media (max-width: 520px) {
  .admin-main {
    padding: 12px;
  }

  .center-state,
  .login-layout {
    padding: 10px;
  }

  .admin-header h1 {
    font-size: 1.65rem;
  }

  .admin-actions,
  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .secondary-button,
  .primary-button,
  .fallback-link {
    width: 100%;
  }

  .iframe-wrap iframe {
    min-height: 660px;
  }
}
