

:root {
  --bg: #f6f7fb;
  --bg-elevated: rgba(255, 255, 255, 0.72);
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --primary: #111827;
  --primary-hover: #0b1220;
  --primary-contrast: #ffffff;
  --success: #047857;
  --warning: #b45309;
  --danger: #b91c1c;
  --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --container: 1200px;
  --header-height: 72px;
  --transition: 180ms ease;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --terminal-bg: #0b1020;
  --terminal-border: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 32%),
    radial-gradient(circle at top right, rgba(168, 85, 247, 0.08), transparent 28%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

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

.container {
  width: min(var(--container), calc(100vw - 32px));
  margin: 0 auto;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(246, 247, 251, 0.8);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: white;
  box-shadow: var(--shadow-sm);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main {
  flex: 1;
  padding: 28px 0 40px;
}

.hero {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.page-subtitle {
  margin: 0;
  max-width: 760px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.glass-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
}

.card-padding {
  padding: 24px;
}

.grid {
  display: grid;
  gap: 20px;
}

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

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

.section {
  display: grid;
  gap: 18px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition:
    transform var(--transition),
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
  font-weight: 600;
}

.button:hover,
.btn:hover {
  transform: translateY(-1px);
}

.button-primary,
.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: var(--shadow-sm);
}

.button-primary:hover,
.btn-primary:hover {
  background: var(--primary-hover);
}

.button-secondary,
.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.button-danger,
.btn-danger {
  background: rgba(185, 28, 28, 0.08);
  color: var(--danger);
  border-color: rgba(185, 28, 28, 0.12);
}

.button-ghost,
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}

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

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: rgba(17, 24, 39, 0.28);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.06);
}

.label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-soft);
}

.helper-text {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.stack {
  display: grid;
  gap: 14px;
}

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

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.85);
}

.badge-success {
  color: var(--success);
  background: rgba(4, 120, 87, 0.08);
  border-color: rgba(4, 120, 87, 0.14);
}

.badge-warning {
  color: var(--warning);
  background: rgba(180, 83, 9, 0.08);
  border-color: rgba(180, 83, 9, 0.14);
}

.badge-danger {
  color: var(--danger);
  background: rgba(185, 28, 28, 0.08);
  border-color: rgba(185, 28, 28, 0.14);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

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

.login-card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.login-header {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.login-title {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: -0.04em;
}

.login-subtitle {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.login-footer {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: center;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
}

.template-list,
.lab-list {
  display: grid;
  gap: 16px;
}

.template-card,
.lab-card {
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--panel-strong);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.template-card:hover,
.lab-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.template-card h3,
.lab-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.template-card p,
.lab-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.template-meta,
.lab-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.lab-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.lab-main {
  flex: 1;
  width: min(1400px, calc(100vw - 24px));
  margin: 16px auto 20px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
}

.lab-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lab-panel {
  padding: 22px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.lab-panel h2,
.lab-panel h3 {
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}

.lab-panel p,
.lab-panel li {
  color: var(--text-soft);
  line-height: 1.7;
}

.instructions-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.lab-terminal-wrap {
  min-height: calc(100vh - var(--header-height) - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--terminal-border);
  background: var(--terminal-bg);
  box-shadow: 0 22px 60px rgba(2, 6, 23, 0.35);
}

.lab-terminal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.lab-terminal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
}

.traffic-lights {
  display: flex;
  align-items: center;
  gap: 8px;
}

.traffic-lights span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.traffic-lights span:nth-child(1) {
  background: #fb7185;
}

.traffic-lights span:nth-child(2) {
  background: #fbbf24;
}

.traffic-lights span:nth-child(3) {
  background: #34d399;
}

.lab-terminal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lab-terminal {
  min-height: 0;
  height: 100%;
  padding: 0;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-state {
  display: grid;
  gap: 10px;
  place-items: start;
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.55);
}

.error-box,
.success-box,
.info-box {
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.error-box {
  background: rgba(185, 28, 28, 0.08);
  color: var(--danger);
  border: 1px solid rgba(185, 28, 28, 0.12);
}

.success-box {
  background: rgba(4, 120, 87, 0.08);
  color: var(--success);
  border: 1px solid rgba(4, 120, 87, 0.12);
}

.info-box {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .lab-main {
    grid-template-columns: 1fr;
  }

  .lab-terminal-wrap {
    min-height: 520px;
  }
}

@media (max-width: 720px) {
  .main {
    padding-top: 20px;
  }

  .topbar-inner,
  .section-header,
  .space-between {
    flex-direction: column;
    align-items: stretch;
  }

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

  .page-title {
    font-size: 2rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .lab-terminal-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .lab-terminal-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

html,
body {
  overflow-x: hidden;
}

.lab-main,
.dashboard-grid {
  min-width: 0;
}

.lab-main > *,
.dashboard-grid > * {
  min-width: 0;
}

.lab-sidebar,
.lab-terminal-wrap,
.lab-terminal,
.lab-panel {
  min-width: 0;
}

.lab-terminal-wrap {
  overflow: hidden;
}

.lab-terminal {
  overflow: hidden;
}

.lab-terminal .xterm,
.lab-terminal .xterm-screen,
.lab-terminal .xterm-viewport,
.lab-terminal .xterm-scroll-area {
  max-width: 100%;
}

.button.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.lab-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 12, 20, 0.72);
  backdrop-filter: blur(6px);
  z-index: 2000;
}

.modal-card {
  width: min(100%, 520px);
  background: rgba(18, 24, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  padding: 22px;
}