﻿:root {
  --bg: #f4f6f8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --text: #101316;
  --muted: #5f6873;
  --line: rgba(16, 19, 22, 0.12);
  --accent: #0b7a75;
  --accent-soft: rgba(11, 122, 117, 0.12);
  --ok: #2f8f6a;
  --danger: #d14848;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, #d4eceb 0%, transparent 42%),
    radial-gradient(circle at 90% 90%, #d8e4ef 0%, transparent 40%),
    var(--bg);
  padding: 18px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

#appHeader {
  position: sticky;
  top: 0;
  z-index: 40;
}

.progress-track {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(16, 19, 22, 0.08);
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0b7a75, #52a7a3);
  transition: width 140ms ease;
}

.topbar {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

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

.nav-toggle {
  min-width: 42px;
  width: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle-icon {
  width: 18px;
  display: grid;
  gap: 4px;
}

.nav-toggle-bar {
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  opacity: 0;
  background: rgba(16, 19, 22, 0.24);
  transition: opacity 180ms ease;
}

.menu-overlay.open {
  opacity: 1;
}

.side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: min(320px, 86vw);
  background: var(--surface-strong);
  border-right: 1px solid var(--line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  padding: 14px;
  transform: translateX(-100%);
  transition: transform 180ms ease;
  display: grid;
  gap: 14px;
  align-content: start;
}

.side-nav.open {
  transform: translateX(0);
}

.side-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.side-nav-head h2 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.side-nav-links {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-weight: 600;
}

.nav-link.active {
  border-color: rgba(11, 122, 117, 0.4);
  background: var(--accent-soft);
  color: var(--accent);
}

.main-panel {
  display: grid;
  gap: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  padding: 18px;
  display: grid;
  gap: 12px;
}

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

.panel h1 {
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.02em;
}

.badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(11, 122, 117, 0.35);
  color: var(--accent);
  background: rgba(11, 122, 117, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
}

.lead {
  color: var(--muted);
  line-height: 1.5;
}

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

.action-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  padding: 14px;
  display: grid;
  gap: 8px;
  transition: transform 150ms ease, background 150ms ease;
}

.action-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
}

.action-card h2 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.action-card p {
  color: var(--muted);
  line-height: 1.45;
}

.quiz-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  padding: 14px;
  display: grid;
  gap: 10px;
}

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

.quiz-head h2 {
  font-size: 1.2rem;
}

.quiz-prompt {
  color: var(--muted);
  line-height: 1.45;
}

.quiz-item {
  font-size: 1.06rem;
  line-height: 1.45;
}

label {
  font-weight: 600;
}

select,
input[type="text"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 8px 10px;
}

select:focus,
input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, white);
  outline-offset: 1px;
}

.btn {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--text);
  color: #f9fbfb;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  opacity: 0.92;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mark-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
}

.mark-toggle input {
  width: auto;
  margin: 0;
}

.quiz-result {
  min-height: 1.4rem;
  color: var(--muted);
}

.quiz-result.is-correct {
  color: var(--ok);
  font-weight: 700;
}

.quiz-result.is-wrong {
  color: var(--danger);
  font-weight: 700;
}

.status-line {
  color: var(--muted);
  line-height: 1.45;
}

.status-line.status-error {
  color: var(--danger);
  font-weight: 700;
}

.status-line.status-success {
  color: var(--ok);
  font-weight: 700;
}

.overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.toggle input {
  width: auto;
  margin: 0;
}

.stats-row {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.overview-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

.overview-table th {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.88);
}

.overview-table .cell-mark {
  width: 96px;
  text-align: center;
}

.overview-table .cell-mark input {
  width: auto;
  margin: 0;
}

.overview-table tr.row-category td:nth-child(2),
.overview-table tr.row-category td:nth-child(3) {
  font-weight: 700;
}

.overview-table .table-empty {
  text-align: center;
  color: var(--muted);
  padding: 18px;
}

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

.hidden {
  display: none !important;
}

#scrollToTopBtn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--text);
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

#scrollToTopBtn.visible {
  display: inline-flex;
}

@media (max-width: 920px) {
  body {
    padding: 10px;
  }

  .panel {
    padding: 12px;
    border-radius: 16px;
  }

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

  .desktop-only {
    display: none;
  }

  #scrollToTopBtn {
    right: 12px;
    bottom: 12px;
  }
}
