* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 50%, #faf5ff 100%);
  min-height: 100vh;
  color: #1f2937;
}

.header {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
}

.header-content {
  max-width: 1024px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.header-content:hover {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.02);
}

.header-content:hover .header-icon {
  background: #3b82f6;
  transform: scale(1.05);
}

.header-content:hover .header-icon svg {
  color: white;
}

.header-content:hover .header-text h1 {
  color: #2563eb;
}

.header-icon {
  width: 40px;
  height: 40px;
  background: #dbeafe;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.header-icon svg {
  width: 24px;
  height: 24px;
  color: #2563eb;
  transition: all 0.2s ease;
}

.header-text h1 {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.header-text p {
  color: #6b7280;
  font-size: 14px;
}

.tab-navigation {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tab-container {
  max-width: 1024px;
  margin: 0 auto;
  display: flex;
  padding: 0 16px;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.tab-button:hover {
  color: #374151;
  background: #f9fafb;
}

.tab-button.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: #f8fafc;
}

.tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tab-text {
  font-weight: 600;
}

.tab-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.tab-badge:not(.new) {
  background: #e5e7eb;
  color: #6b7280;
}

.tab-badge.new {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 32px 16px;
}

.card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 32px;
}

.card-header {
  padding: 24px 24px 0;
  text-align: center;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-title .icon {
  width: 20px;
  height: 20px;
  color: #2563eb;
  flex-shrink: 0;
}

.card-description {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
}

.card-content {
  padding: 24px;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.input-wrapper {
  width: 100%;
  max-width: 300px;
  position: relative;
}

.input-field {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 18px;
  text-align: center;
  font-weight: 600;
  transition: all 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-field.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.validation-message {
  margin-top: 8px;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  color: #92400e;
  animation: slideDown 0.3s ease-out;
}

.validation-message.hidden {
  display: none;
}

.validation-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.validation-text {
  line-height: 1.4;
}

.save-button-container-external {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.save-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.save-button:hover {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
}

.save-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.save-button .icon {
  width: 16px;
  height: 16px;
}

.results-card .card-header {
  text-align: left;
}

.results-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.results-title .icon {
  width: 20px;
  height: 20px;
  color: #059669;
  flex-shrink: 0;
}

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

.mobile-cards {
  display: grid;
  gap: 12px;
}

.mobile-card {
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.mobile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.badge {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.grade-1 {
  background-color: #ef4444;
}
.grade-2 {
  background-color: #f97316;
}
.grade-3 {
  background-color: #eab308;
}
.grade-4 {
  background-color: #22c55e;
}
.grade-5 {
  background-color: #3b82f6;
}
.grade-6 {
  background-color: #6366f1;
}
.grade-7 {
  background-color: #a855f7;
}
.grade-8 {
  background-color: #ec4899;
}
.grade-9 {
  background-color: #6b7280;
}

.student-count {
  font-weight: 700;
  font-size: 18px;
}

.mobile-card-details {
  font-size: 14px;
  color: #6b7280;
}

.mobile-card-details div {
  margin-bottom: 4px;
}

.desktop-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.desktop-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
}

.desktop-table th:nth-child(1) {
  width: 20%;
  text-align: left;
}

.desktop-table th:nth-child(2) {
  width: 20%;
  text-align: center;
}

.desktop-table th:nth-child(3) {
  width: 20%;
  text-align: center;
}

.desktop-table th:nth-child(4) {
  width: 40%;
  text-align: center;
  padding-left: 24px;
}

.desktop-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-table tr:hover {
  background-color: #f9fafb;
}

.desktop-table td:nth-child(1) {
  text-align: left;
  width: 20%;
}

.desktop-table td:nth-child(2) {
  text-align: center;
  font-weight: 500;
  width: 20%;
}

.desktop-table td:nth-child(3) {
  text-align: center;
  font-weight: 700;
  font-size: 18px;
  width: 20%;
}

.desktop-table td:nth-child(4) {
  color: #6b7280;
  text-align: center;
  width: 40%;
  padding-left: 24px;
}

.content-section {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 32px;
  margin-bottom: 32px;
}

.content-section h2 {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
}

.content-section h3 {
  font-size: 20px;
  font-weight: 600;
  color: #374151;
  margin: 24px 0 12px 0;
}

.content-section p {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 16px;
}

.content-section ul {
  color: #6b7280;
  line-height: 1.6;
  margin-left: 20px;
}

.content-section li {
  margin-bottom: 8px;
}

.footer {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  padding: 16px 0;
  margin-top: 32px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

@media (min-width: 640px) {
  .input-section {
    flex-direction: row;
    justify-content: center;
  }

  .input-wrapper {
    max-width: 400px;
  }

  .mobile-cards {
    display: none;
  }

  .desktop-table {
    display: table;
  }
}

@media (max-width: 639px) {
  .desktop-table {
    display: none;
  }

  .tab-button {
    padding: 12px 16px;
    font-size: 13px;
  }

  .tab-text {
    display: none;
  }

  .tab-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 9px;
    padding: 1px 4px;
  }
}

.input-field,
.badge,
.mobile-card,
.desktop-table tr {
  transition: all 0.2s ease-in-out;
}

.input-field:hover {
  border-color: #d1d5db;
}

.mobile-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}