:root {
  --bg: #e9ebef;
  --bg-strong: #d8dce2;
  --surface: rgba(249, 250, 252, 0.92);
  --surface-strong: #fdfdfe;
  --text: #20242b;
  --muted: #5f6875;
  --line: rgba(66, 75, 89, 0.14);
  --accent: #6b7280;
  --accent-dark: #434a57;
  --danger: #7b4040;
  --shadow: 0 18px 45px rgba(57, 66, 79, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(107, 114, 128, 0.18), transparent 22%),
    radial-gradient(circle at bottom right, rgba(148, 163, 184, 0.16), transparent 24%),
    linear-gradient(180deg, #f4f6f8 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(32, 36, 43, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 36, 43, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent);
}

.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  padding: 20px;
}

.sidebar,
.panel,
.hero,
.stat-card,
.dashboard-class-strip {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(250, 251, 253, 0.94), rgba(232, 236, 241, 0.92));
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand h1,
.hero h2,
.section-header h2,
.panel h3,
.strip-header h3 {
  margin: 0;
  font-family: "Fraunces", serif;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu {
  display: grid;
  gap: 10px;
  margin: 28px 0;
}

.menu-item,
.subnav-item,
.class-card-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.menu-item {
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.48);
}

.menu-item.active,
.menu-item:hover {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.16), rgba(107, 114, 128, 0.05));
}

.sidebar-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.45);
}

.compact-list,
.simple-list,
.student-list,
.import-list {
  margin: 0;
  padding-left: 18px;
}

.main-content {
  display: grid;
  gap: 22px;
}

.view {
  display: none;
  gap: 22px;
}

.view.active {
  display: grid;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(251, 252, 253, 0.96), rgba(224, 229, 236, 0.86));
}

.hero h2,
.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.98;
}

.hero-copy,
.section-copy,
.import-copy,
.input-note,
.summary-block p,
.stat-note,
.class-item p,
.student-item p {
  color: var(--muted);
}

.hero-tools,
.detail-controls,
.inline-actions,
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.selector-block {
  display: grid;
  gap: 8px;
  min-width: 170px;
}

.selector-block span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

select,
input,
textarea {
  font: inherit;
}

.selector-block select,
.stack-form input,
.stack-form select,
.stack-form textarea,
.table-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
}

.stack-form textarea {
  resize: vertical;
  min-height: 124px;
}

.primary-button,
.secondary-button,
.danger-button,
.small-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.76);
}

.danger-button {
  color: white;
  background: var(--danger);
}

.small-button {
  padding: 10px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.76);
}

.dashboard-class-strip,
.panel {
  padding: 22px;
  border-radius: 24px;
  background: var(--surface);
}

.strip-header,
.panel-header,
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.strip-header,
.panel-header {
  margin-bottom: 18px;
}

.class-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.class-card-button,
.class-item,
.student-item,
.summary-block,
.import-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.class-card-button {
  display: grid;
  gap: 8px;
  text-align: left;
}

.class-card-button strong {
  font-size: 1rem;
}

.class-card-button span {
  color: var(--muted);
}

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

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

.stat-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-radius: 22px;
  background: var(--surface);
}

.stat-label {
  color: var(--muted);
}

.stat-value {
  font-size: 2rem;
}

.summary-list,
.class-list,
.student-list,
.lesson-list,
.evaluation-list,
.import-preview {
  display: grid;
  gap: 14px;
}

.summary-block {
  display: grid;
  gap: 8px;
}

.summary-block strong,
.summary-block p {
  margin: 0;
}

.class-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.class-item.active {
  border-color: rgba(107, 114, 128, 0.36);
  box-shadow: inset 0 0 0 1px rgba(107, 114, 128, 0.14);
}

.class-item button,
.student-item button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--accent-dark);
  background: rgba(107, 114, 128, 0.12);
}

.class-meta,
.student-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.meta-chip,
.panel-tag {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--bg-strong);
}

.stack-form {
  display: grid;
  gap: 16px;
}

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

.form-grid label,
.stack-form label {
  display: grid;
  gap: 8px;
}

.form-grid span,
.stack-form span {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.subnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.subnav-item {
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.subnav-item.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.class-tab {
  display: none;
  gap: 18px;
}

.class-tab.active {
  display: grid;
}

.quick-actions {
  justify-content: flex-start;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(66, 75, 89, 0.24);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
}

.student-list,
.simple-list,
.import-list {
  padding-left: 0;
  list-style: none;
}

.student-item {
  display: grid;
  gap: 10px;
}

.student-item header,
.import-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.input-note {
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.import-item {
  display: grid;
  gap: 8px;
}

.import-status {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--bg-strong);
}

.import-status.update {
  background: rgba(107, 114, 128, 0.2);
}

.import-status.new {
  background: rgba(148, 163, 184, 0.24);
}

.sticky-report,
.table-wrap {
  overflow: auto;
}

.report-table,
.records-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 640px;
}

.report-table th,
.report-table td,
.records-table th,
.records-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.report-table thead th,
.records-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef1f5;
}

.sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #f7f9fb;
  min-width: 220px;
}

.report-table thead .sticky-col {
  z-index: 4;
}

.even-row td {
  background: rgba(255, 255, 255, 0.84);
}

.odd-row td {
  background: rgba(240, 243, 247, 0.84);
}

.even-row .sticky-col {
  background: rgba(255, 255, 255, 0.96);
}

.odd-row .sticky-col {
  background: rgba(240, 243, 247, 0.96);
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .stats-grid,
  .dashboard-grid,
  .split-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .hero,
  .panel-header,
  .strip-header,
  .section-header,
  .class-item,
  .student-item header,
  .import-item-header {
    display: grid;
  }

  .sidebar,
  .hero,
  .panel,
  .stat-card,
  .dashboard-class-strip {
    border-radius: 20px;
  }

  .sticky-col {
    min-width: 180px;
  }
}
