:root {
  --bg: #0e1116;
  --surface: #161b22;
  --text: #e6edf3;
  --muted: #9aa4b2;
  --primary: #4f8cff;
  --success: #22c55e;
  --danger: #ef4444;
  --card: #11151b;
  --border: #2d333b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(180deg, var(--bg), #0b0d12 60%);
  color: var(--text);
  line-height: 1.5;
}

.site-header, .site-footer {
  text-align: center;
  padding: 24px 16px;
}

.site-header h1 { margin: 0 0 8px; }
.subtitle { color: var(--muted); margin: 0; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

.topnav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  justify-content: flex-end;
}
.topnav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0c0f14;
}
.topnav a:hover { border-color: var(--primary); }

/* Profile menu (avatar + dropdown) */
.profile-menu { position: relative; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #2a2f36, #1a1f26);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
}
.avatar:after {
  content: '▾';
  font-size: 10px;
  margin-left: 6px;
  opacity: 0.8;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 200px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  padding: 8px;
  display: none;
  z-index: 10;
}
.dropdown.open { display: block; }
.dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.dropdown-item:hover { background: #0c0f14; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  background: linear-gradient(180deg, var(--surface), var(--card));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover { transform: translateY(-2px); border-color: var(--primary); }
.card h2 { margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted); }

.form {
  max-width: 560px;
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.row { display: grid; gap: 8px; margin-bottom: 12px; }
label { color: var(--muted); }
input, select, button, textarea {
  background: #0c0f14;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.error { color: var(--danger); font-size: 0.9rem; min-height: 1.2rem; }
.success { color: var(--success); }

.btn {
  background: var(--primary);
  border: 0;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn.secondary { background: transparent; border: 1px solid var(--border); }
.btn.block { width: 100%; }

.grid { display: grid; gap: 16px; }
.grid.products { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.product {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.product img { width: 100%; height: 220px; object-fit: cover; display: block; background: #0c0f14; }
.product .body { padding: 12px; }
.price { color: var(--success); font-weight: 600; }

.quiz {
  max-width: 720px;
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.quiz .question { margin-bottom: 16px; }
.quiz .question-card {
  background: linear-gradient(180deg, var(--surface), var(--card));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.quiz .question-title { margin: 0 0 6px; }
.quiz .question-sub { margin: 0 0 12px; color: var(--muted); }
.quiz .answers { display: grid; gap: 8px; grid-template-columns: 1fr; }
.quiz .answers .option {
  border: 1px solid var(--border);
  background: #0c0f14;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s ease, transform .05s ease;
}
.quiz .answers .option:hover { border-color: var(--primary); transform: translateY(-1px); }
.quiz .answers input { display: none; }
.quiz .answers .option.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,140,255,0.25) inset; }

.certificate {
  background: white;
  color: #111827;
  max-width: 900px;
  margin: 16px auto;
  padding: 32px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
}

.muted { color: var(--muted); }



/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; table-layout: fixed; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table th:last-child, .table td:last-child { border-right: 0; }
.table thead th { background: #0ea54c; /* green header */ color: #ffffff; font-weight: 700; text-align: center; text-transform: uppercase; }
.table tbody td { text-align: left; }
.table tbody td:first-child { font-weight: 700; }
.table tbody tr:hover { background: rgba(14,165,76,0.12); }

/* Let the Room column show full value */
.table th.room, .table td.room { white-space: normal; text-overflow: clip; }

