:root {
  --bg: #fffdf2;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #ead27a;
  --brand: #d6a500;
  --brand-dark: #8a6400;
  --soft: #fef3c7;
  --warn: #facc15;
  --good: #16a34a;
  --bad: #dc2626;
  --shadow: 0 8px 20px rgba(133, 77, 14, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 26px clamp(16px, 4vw, 42px) 20px;
  background: #fff7cc;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: 0;
}

h2, h3, p { margin-top: 0; }

main {
  padding: 24px clamp(16px, 4vw, 42px) 42px;
}

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

input, select, textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(250, 204, 21, 0.34);
  border-color: var(--brand);
}

button, .button-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--warn);
  color: #1f2937;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

button:hover, .button-link:hover {
  color: #fff;
  background: var(--brand-dark);
}

.ghost {
  color: #713f12;
  background: var(--soft);
  border: 1px solid #fde68a;
}

.danger {
  color: #fff;
  background: var(--bad);
}

.subtitle, .note {
  color: var(--muted);
  line-height: 1.5;
}

.kicker, .pill {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  color: #713f12;
  background: #fef3c7;
  border: 1px solid #fde68a;
  font-size: 12px;
  font-weight: 700;
}

.kicker { margin-bottom: 10px; }

.nav-actions, .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolbar {
  margin-bottom: 16px;
}

.toolbar input, .toolbar select {
  width: auto;
  min-width: min(100%, 220px);
}

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

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel, .card, .hero-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card {
  padding: 24px;
  background: #fff7cc;
  color: #713f12;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
}

.panel-body { padding: 16px; }

.form-grid {
  display: grid;
  gap: 12px;
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.card {
  padding: 15px;
  border-top: 4px solid var(--warn);
}

.card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.card strong {
  font-size: 28px;
  line-height: 1;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8edf5;
  margin-top: 8px;
}

.bar > div {
  height: 100%;
  background: var(--brand);
}

.table-wrap {
  overflow: auto;
  max-height: 70vh;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

th, td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  background: #fff;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fef3c7;
  font-size: 13px;
}

.category-row td, .category-title {
  color: #713f12;
  background: #fef3c7;
  font-weight: 800;
}

.category-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.student-list, .progress-list, .category-block {
  display: grid;
  gap: 12px;
}

.student-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.resource-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.resource-link:hover { text-decoration: underline; }

.material-preview {
  display: block;
  max-width: min(100%, 360px);
  max-height: 220px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.flash {
  max-width: 980px;
  margin: 0 auto 16px;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
}

.flash.success { color: #14532d; background: #dcfce7; border: 1px solid #86efac; }
.flash.error { color: #7f1d1d; background: #fee2e2; border: 1px solid #fecaca; }

.empty-state {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: #fffbeb;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.site-footer {
  padding: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.compact { max-width: 620px; margin: 0 auto; }
.mt { margin-top: 16px; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
}

.profile-grid p {
  margin: 0;
  padding: 10px;
  background: #fffbeb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

@media (max-width: 900px) {
  .site-header, .grid-2, .layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar input, .toolbar select, .toolbar button {
    width: 100%;
  }

  .student-item {
    grid-template-columns: 1fr;
  }
}
