:root {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --ink: #17222b;
  --muted: #647483;
  --line: #dce5ea;
  --teal: #0697a7;
  --teal-dark: #047481;
  --orange: #f97316;
  --green: #16a34a;
  --shadow: 0 20px 60px rgba(23, 34, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  gap: 38px;
  padding: 44px 18px 28px;
  background:
    linear-gradient(90deg, rgba(202, 221, 247, 0.68), rgba(246, 250, 253, 0.96) 48%, #f7fafc),
    #f2f7fb;
}

.login-card {
  display: grid;
  width: min(980px, 100%);
  height: 599.734px;
  grid-template-columns: 546.969px 433.031px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-brand-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  background: linear-gradient(155deg, #177ccd 0%, #075b99 100%);
  color: white;
}

.login-logo {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: 26px;
  background: #fff;
  color: #1f7fca;
  font-size: 26px;
  font-weight: 900;
}

.login-brand-name {
  margin: 0 0 20px;
  color: white;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 6px;
}

.login-brand-panel h1 {
  margin: 0 0 20px;
  max-width: 620px;
  color: white;
  font-size: 40px;
  line-height: 1.06;
}

.login-brand-panel p:last-child {
  max-width: 360px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  line-height: 1.45;
}

.login-form-panel {
  display: flex;
  position: relative;
  min-height: 0;
  flex-direction: column;
  justify-content: flex-start;
  padding: 48px;
}

.login-form-panel h2 {
  margin: 0 0 14px;
  color: #111827;
  font-size: 28px;
  line-height: 1.12;
}

.brand-mark {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.brand-name,
.eyebrow {
  margin: 14px 0 6px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-form-panel h2,
.topbar h1,
.section-heading h2,
.hero-copy h2 {
  margin: 0;
}

.login-form-panel h2 {
  margin-bottom: 14px;
}

.login-copy,
.login-note,
.section-heading p,
.hero-copy p,
.email-preview p {
  color: var(--muted);
  line-height: 1.55;
}

.login-copy {
  max-width: 330px;
  margin: 0 0 22px;
  color: #6b7d92;
  font-size: 16px;
  line-height: 1.45;
}

.microsoft-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  background: white;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.microsoft-button:hover {
  background: #f8fafc;
}

.microsoft-mark {
  display: grid;
  width: 20px;
  height: 20px;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}

.microsoft-mark span:nth-child(1) {
  background: #f25022;
}

.microsoft-mark span:nth-child(2) {
  background: #7fba00;
}

.microsoft-mark span:nth-child(3) {
  background: #00a4ef;
}

.microsoft-mark span:nth-child(4) {
  background: #ffb900;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  color: #7a8795;
  font-size: 13px;
}

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

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 0;
  text-align: left;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #33424f;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 41px;
  border: 1px solid #a8b2c1;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(6, 151, 167, 0.22);
  outline-offset: 2px;
}

.primary-action,
.ghost-button,
.settings-button,
.nav-item,
.icon-button {
  border: 0;
  cursor: pointer;
}

.primary-action {
  min-height: 42px;
  border-radius: 4px;
  background: #1677c9;
  color: white;
  font-size: 16px;
  font-weight: 800;
  transition: background 0.18s ease, transform 0.18s ease;
}

.primary-action:hover {
  background: #126bb5;
  transform: translateY(-1px);
}

.primary-action.compact {
  width: max-content;
  min-height: 40px;
  padding: 0 16px;
  font-size: 16px;
}

.login-note {
  margin: 18px 0 18px;
  color: #718096;
  font-size: 13px;
  line-height: 1.45;
}

.login-language {
  display: none;
}

.login-language span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.login-language select {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.login-footer {
  margin: 0;
  color: #778697;
  font-size: 13px;
}

.auth-status {
  margin: 10px 0 0;
  color: #b45309;
  font-size: 13px;
  line-height: 1.35;
}

.auth-status:empty {
  display: none;
}

.portal-shell {
  min-height: 100vh;
  background: #f3f3f3;
  color: #242424;
}

.portal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  background: #1677c9;
  color: #fff;
  padding: 0 12px;
}

.portal-brand,
.portal-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-brand strong {
  font-size: 14px;
  font-weight: 800;
}

.portal-brand span {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.36);
}

.app-launcher,
.portal-tools button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.portal-logo {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  background: white;
  color: #1677c9;
  font-weight: 900;
}

.avatar-button {
  width: 34px !important;
  height: 34px !important;
  border-radius: 999px;
  background: white !important;
  color: #1677c9 !important;
}

.portal-layout {
  display: grid;
  min-height: calc(100vh - 52px);
  grid-template-columns: 258px minmax(0, 1fr);
}

.portal-sidebar {
  border-right: 1px solid #dddddd;
  background: #fff;
  padding: 18px 10px;
}

.tenant-label {
  margin: 0 0 8px 6px;
  color: #737373;
  font-size: 12px;
  text-transform: uppercase;
}

.tenant-card {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 60px;
  margin-bottom: 20px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #fff;
  color: #242424;
  padding: 10px 32px 10px 12px;
  text-align: left;
}

.tenant-card strong {
  font-size: 15px;
}

.tenant-card span {
  color: #666;
  font-size: 13px;
}

.tenant-card small {
  position: absolute;
  right: 12px;
  top: 22px;
  color: #555;
}

.portal-sidebar nav {
  display: grid;
  gap: 8px;
}

.portal-sidebar .nav-item {
  justify-content: flex-start;
  width: 100%;
  min-height: 46px;
  border-left: 4px solid transparent;
  border-radius: 6px;
  color: #242424;
  font-size: 16px;
  padding: 0 14px;
}

.portal-sidebar .nav-item span:first-child {
  color: #1677c9;
}

.portal-sidebar .nav-item.is-active {
  border-left-color: #1677c9;
  background: #e8f2ff;
  color: #1677c9;
  font-weight: 800;
}

.portal-sidebar .nav-item:hover {
  background: #f3f8ff;
}

.portal-workspace {
  min-width: 0;
  padding: 34px 36px;
}

.portal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.portal-heading h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
}

.portal-heading p {
  margin: 0;
  color: #666;
  font-size: 15px;
}

.portal-primary {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  background: #1677c9;
  color: white;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}

.portal-alert {
  min-height: 48px;
  margin-bottom: 22px;
  border-left: 4px solid #1677c9;
  background: #e8f2ff;
  padding: 15px 18px;
  font-weight: 800;
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.portal-stats article,
.portal-panel,
.module-card,
.quiz-card,
.email-preview,
.checklist {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.portal-stats article {
  padding: 20px;
}

.portal-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #666;
  font-size: 15px;
}

.portal-stats strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 30px;
  line-height: 1;
}

.portal-stats p {
  margin: 0;
  color: #777;
  font-size: 13px;
}

.portal-panel {
  margin-bottom: 22px;
  overflow: hidden;
}

.portal-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  border-bottom: 1px solid #e5e5e5;
  padding: 0 20px;
}

.portal-panel h2 {
  margin: 0;
  font-size: 19px;
}

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

.quick-grid button {
  display: grid;
  gap: 8px;
  min-height: 126px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  padding: 24px 20px;
  color: #242424;
  text-align: left;
  cursor: pointer;
}

.quick-grid button:hover {
  border-color: #1677c9;
  background: #fbfdff;
}

.quick-grid span {
  color: #1677c9;
  font-size: 22px;
}

.quick-grid strong {
  font-size: 16px;
}

.quick-grid small {
  color: #666;
  font-size: 13px;
}

.activity-table {
  min-width: 880px;
}

.activity-panel {
  overflow-x: auto;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr 0.75fr 1fr 1fr;
  align-items: center;
  gap: 18px;
  min-height: 66px;
  border-bottom: 1px solid #ededed;
  padding: 0 16px;
}

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

.table-head {
  min-height: 44px;
  color: #707070;
  font-size: 12px;
  font-weight: 800;
}

.table-row strong,
.table-row small {
  display: block;
}

.table-row small {
  color: #666;
  font-size: 12px;
}

.status-success,
.status-warning {
  border-radius: 999px;
  padding: 5px 10px;
  background: #f8fafc;
  color: #555;
  font-size: 12px;
}

.status-warning {
  background: #fee2e2;
  color: #bf3b53;
}

.table-row i {
  display: block;
  width: 118px;
  height: 4px;
  border-radius: 999px;
  background: #d8e8fa;
}

.table-row i::before {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: #1677c9;
  content: "";
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand p {
  margin: 0;
  font-weight: 900;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 13px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.settings-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-radius: 6px;
  background: transparent;
  color: #41515f;
  padding: 0 12px;
  text-align: left;
}

.nav-item span:first-child,
.settings-button span:first-child {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--teal-dark);
}

.nav-item.is-active,
.nav-item:hover,
.settings-button:hover {
  background: #eaf6f8;
  color: var(--teal-dark);
}

.settings-button {
  margin-top: auto;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  font-size: clamp(24px, 4vw, 34px);
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.language-select {
  min-width: 150px;
}

.ghost-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 0 14px;
}

.view {
  display: none;
}

.view.is-current {
  display: block;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 26px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.hero-copy {
  padding: 34px;
}

.hero-copy h2 {
  max-width: 620px;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.08;
}

.hero-band img {
  width: 100%;
  height: 390px;
  object-fit: cover;
}

.stats-grid,
.module-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid article,
.module-card,
.quiz-card,
.email-preview,
.checklist {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 30px rgba(23, 34, 43, 0.06);
}

.stats-grid article {
  padding: 20px;
}

.stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stats-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
}

.section-heading {
  max-width: 760px;
}

.module-grid {
  grid-template-columns: repeat(4, minmax(210px, 1fr));
}

.module-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.module-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #eaf6f8;
  color: var(--teal-dark);
  font-weight: 900;
}

.module-card h3 {
  margin: 0;
  font-size: 18px;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.module-card button {
  justify-self: start;
}

.module-card.is-done {
  border-color: rgba(22, 163, 74, 0.42);
}

.quiz-card {
  max-width: 760px;
  padding: 24px;
}

.answer-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.answer-list button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.answer-list button:hover {
  border-color: var(--teal);
  background: #f2fbfc;
}

.simulation-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 380px);
  gap: 18px;
}

.email-preview,
.checklist {
  padding: 22px;
}

.email-head {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.email-head span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.danger-link {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--orange);
  color: white;
  padding: 0 14px;
  font-weight: 800;
}

.checklist {
  display: grid;
  gap: 14px;
  align-content: start;
}

.checklist h3 {
  margin: 0;
}

.checklist label,
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checklist input,
.toggle-row input {
  width: auto;
  min-height: auto;
}

.result-text {
  min-height: 24px;
  margin: 0;
  color: var(--teal-dark);
  font-weight: 800;
}

dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 34, 43, 0.42);
}

.settings-modal {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.settings-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-modal h2 {
  margin: 0;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  background: #eef3f5;
  color: var(--ink);
  font-size: 24px;
}

@media (max-width: 980px) {
  .login-card {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }

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

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .nav-item,
  .settings-button {
    justify-content: center;
  }

  .nav-item span:last-child,
  .settings-button span:last-child {
    display: none;
  }

  .hero-band,
  .simulation-layout {
    grid-template-columns: 1fr;
  }

  .hero-band img {
    height: 260px;
  }

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

@media (max-width: 640px) {
  .login-shell {
    padding: 18px;
  }

  .login-brand-panel,
  .login-form-panel,
  .workspace,
  .hero-copy {
    padding: 20px;
  }

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

  .login-brand-panel h1 {
    font-size: 36px;
  }

  .login-brand-panel p:last-child,
  .login-copy,
  .microsoft-button,
  .primary-action {
    font-size: 16px;
  }

  .login-language {
    position: static;
    width: 100%;
    margin-top: 18px;
  }

  .login-language span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    margin-bottom: 7px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .portal-sidebar {
    position: static;
  }

  .portal-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-sidebar .nav-item span:last-child {
    display: inline;
  }

  .portal-stats,
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .portal-bar {
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
  }

  .portal-workspace {
    padding: 20px;
  }

  .portal-heading {
    flex-direction: column;
  }

  .portal-sidebar nav,
  .portal-stats,
  .quick-grid {
    grid-template-columns: 1fr;
  }
}
