* {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #2d3a4d;
  --text: #0d1117;
  --muted: #404449;
  --green: #3fb950;
  --red: #f85149;
  --accent: #58a6ff;
  --input-bg: #ffffff;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

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

.panel-left {
  background: var(--bg);
  overflow: auto;
}

.panel-right {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-width: 0; /* allow shrink in grid */
  min-height: 50vh;
}

.hero-image {
  max-width: 65%;
  max-height: 65%;
  width: auto;
  height: auto;
  min-width: 160px;
  min-height: 120px;
  object-fit: contain;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

@media (max-width: 768px) {
  .page {
    grid-template-columns: 1fr;
  }
  .panel-right {
    min-height: 40vh;
  }
}

header {
  margin-bottom: 2rem;
}

.course-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 0.35rem 0;
}

.semester-line {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.35rem 0;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.last-refresh {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 1.5rem 0 0 0;
}

.lab-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.lab-name {
  font-weight: 600;
  min-width: 4ch;
}

.lab-status {
  font-size: 0.85rem;
}

.lab-status.available {
  color: var(--green);
}

.lab-status.unavailable {
  color: var(--muted);
}

.lab-row input[type="password"] {
  width: 100%;
  min-width: 0;
  max-width: 8rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.lab-row input[type="password"]::placeholder {
  color: var(--muted);
}

.lab-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent);
  color: var(--bg);
}

.btn:hover {
  filter: brightness(1.1);
}

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

.lab-message {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  margin-top: -0.25rem;
}

.lab-message.error {
  color: var(--red);
}

.lab-message.success {
  color: var(--green);
}

#labs-list[aria-busy="true"] {
  color: var(--muted);
}
