:root {
  color-scheme: light;
  --ink: #18212b;
  --muted: #5d6875;
  --paper: #ffffff;
  --soft: #f3f6f8;
  --line: #dbe3ea;
  --navy: #103d73;
  --teal: #0f7774;
  --green: #2e7d56;
  --gold: #b47b2a;
  --shadow: 0 18px 50px rgba(24, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

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

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #f7f9fb;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

code {
  color: var(--navy);
  font-family: Consolas, "Courier New", monospace;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(16, 61, 115, 0.08), rgba(15, 119, 116, 0.06)),
    #ffffff;
}

.login-panel {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-panel img {
  width: 172px;
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

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

h1 {
  color: var(--navy);
  font-size: 2.4rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.35rem;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.login-form label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.password-row input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
}

.password-row input:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 119, 116, 0.14);
}

.password-row button,
.logout-button,
.nav-item,
.app-card {
  cursor: pointer;
}

.password-row button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #ffffff;
  font-weight: 800;
  padding: 0 18px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: #a33a32;
  font-size: 0.9rem;
  font-weight: 700;
}

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

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

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

.nav-item,
.logout-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line);
  background: var(--soft);
  color: var(--ink);
}

.logout-button {
  margin-top: auto;
  border-color: var(--line);
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  padding: 18px clamp(18px, 4vw, 40px);
}

.access-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 0 10px;
  white-space: nowrap;
}

.access-pill {
  background: #e9f5f3;
  color: var(--teal);
}

.view {
  display: none;
  flex: 1;
  padding: clamp(22px, 4vw, 40px);
}

.view.active {
  display: block;
}

.intro {
  max-width: 820px;
}

.intro p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

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

.app-card {
  display: grid;
  gap: 14px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: inherit;
  padding: 22px;
  text-align: left;
}

.app-card:hover {
  border-color: rgba(15, 119, 116, 0.42);
  box-shadow: 0 12px 32px rgba(24, 33, 43, 0.08);
}

.app-card strong {
  color: var(--navy);
  font-size: 1.18rem;
}

.app-card span:last-child {
  color: var(--muted);
  line-height: 1.45;
}

.tag {
  width: fit-content;
  background: rgba(180, 123, 42, 0.14);
  color: var(--gold);
}

.app-frame-view {
  height: calc(100vh - 92px);
  padding: 0;
}

.app-frame-view.active {
  display: flex;
}

.app-frame-view iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.runtime-list {
  display: grid;
  gap: 12px;
  max-width: 900px;
  margin-top: 28px;
}

.runtime-list div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 18px;
}

.runtime-list span {
  color: var(--muted);
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .nav-item,
  .logout-button {
    text-align: center;
  }

  .app-grid,
  .runtime-list div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .login-panel {
    padding: 24px;
  }

  .password-row,
  .nav {
    grid-template-columns: 1fr;
  }

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

  .app-frame-view {
    height: calc(100vh - 250px);
  }
}
