:root {
  color-scheme: light;
  --bg: #eef3f4;
  --panel: #ffffff;
  --ink: #16272a;
  --muted: #647477;
  --line: #d7e1e3;
  --brand: #0f6b68;
  --brand-dark: #0c4d50;
  --accent: #c59b24;
  --danger: #a34132;
  --shadow: 0 18px 45px rgba(22, 39, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

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

.sidebar {
  background: #102f32;
  color: #f4fbfb;
  padding: 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 36px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #d7f0ea;
  color: #103638;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #b7ccce;
  margin-top: 2px;
}

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

nav a {
  color: #d6e9ea;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
}

nav a.active,
nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.workspace {
  padding: 28px;
}

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

.session-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-box a {
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
}

.welcome {
  color: var(--muted);
  margin: -12px 0 20px;
}

.topbar p,
.panel-title p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.55rem, 2.5vw, 2.35rem);
}

h2 {
  font-size: 1.25rem;
}

.status,
.pill,
.panel-title > span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: #f5ead0;
  color: #694a08;
  padding: 5px 11px;
  font-size: 0.86rem;
  font-weight: 700;
}

.status.ready {
  background: #d9f2e9;
  color: #145445;
}

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

.overview article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.overview article {
  padding: 18px;
}

.overview span {
  display: block;
  color: var(--brand-dark);
  font-size: 2rem;
  font-weight: 800;
}

.overview strong,
.overview small {
  display: block;
}

.overview small,
.muted {
  color: var(--muted);
}

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

.panel {
  padding: 20px;
}

.panel.wide {
  grid-column: 1 / -1;
}

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

form {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 107, 104, 0.15);
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  font-weight: 800;
  padding: 12px 14px;
}

button:hover {
  background: var(--brand-dark);
}

.db-list {
  display: grid;
  gap: 18px;
}

.db-list section {
  display: grid;
  gap: 8px;
}

.db-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.db-row small {
  color: var(--muted);
}

.answer-sheet {
  background: #fbfdfd;
  border: 1px solid #bfcfd2;
  border-radius: 8px;
  padding: 18px;
}

.sheet-head,
.sheet-foot,
.student-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.student-line {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  margin: 14px 0;
  padding: 12px 0;
}

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

.bubble-row {
  display: grid;
  grid-template-columns: 28px repeat(4, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.bubble-row span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid #304d51;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
}

.sheet-foot {
  color: var(--muted);
  margin-top: 16px;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

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

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

th {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
}

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

  .sidebar {
    position: static;
  }

  nav {
    grid-template-columns: repeat(5, minmax(max-content, 1fr));
    overflow-x: auto;
  }

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

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

@media (max-width: 560px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .session-box,
  .sheet-head,
  .sheet-foot,
  .student-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .bubbles {
    grid-template-columns: 1fr;
  }
}

.login-body {
  background: #102f32;
}

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

.login-panel {
  width: min(100%, 430px);
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  padding: 30px;
}

.login-brand {
  color: var(--ink);
  margin-bottom: 24px;
}

.login-panel h1 {
  font-size: 1.55rem;
  margin: 0 0 10px;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.google-button-wrap {
  display: grid;
  place-items: start;
  margin-top: 24px;
}

.login-error {
  color: var(--danger);
  font-weight: 800;
  min-height: 24px;
  margin-top: 16px;
}

.login-warning {
  background: #f8eadf;
  border: 1px solid #efc9ad;
  border-radius: 8px;
  color: #733716;
  line-height: 1.5;
  margin-top: 22px;
  padding: 14px;
}
