* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: #f4f7fb;
  color: #1f2937;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.app-header {
  text-align: center;
  margin-bottom: 20px;
}

.app-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.app-header p {
  margin: 0;
  color: #6b7280;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

.form-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-weight: 600;
  margin-top: 6px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
}

.primary-btn,
.ghost-btn,
.teacher-tab,
.tab-btn,
.student-card button {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
}

.primary-btn {
  background: #2563eb;
  color: #ffffff;
}

.ghost-btn {
  background: #eef2ff;
  color: #1d4ed8;
}

.tab-btn {
  background: #e5e7eb;
  color: #374151;
}

.tab-btn.active,
.teacher-tab.active {
  background: #2563eb;
  color: #ffffff;
}

.login-type-switch,
.teacher-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.message {
  min-height: 24px;
  margin-top: 12px;
  color: #b91c1c;
  font-weight: 600;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.date-label {
  margin: 0 0 10px;
  font-weight: 700;
  color: #1d4ed8;
}

.student-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 18px;
}

.student-list {
  display: grid;
  gap: 12px;
}

.student-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.password-change-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.password-change-row input {
  width: 180px;
}

.sub-text {
  color: #6b7280;
  font-size: 14px;
  margin-top: 4px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th,
td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f9fafb;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.chart-grid.single {
  grid-template-columns: 1fr;
}

.chart-card {
  background: #f9fafb;
  border-radius: 14px;
  padding: 14px;
  height: 320px;
}

@media (min-width: 860px) {
  .chart-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .chart-grid.single {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .student-add-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app {
    padding: 14px 12px 28px;
  }

  .app-header h1 {
    font-size: 22px;
  }

  .card {
    padding: 16px;
    border-radius: 16px;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .password-change-row {
    width: 100%;
  }

  .password-change-row input,
  .password-change-row button {
    width: 100%;
  }
}

#studentView .card + .card {
  margin-top: 16px;
}

.student-chart-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .student-chart-grid {
    grid-template-columns: repeat(3, 1fr);
  }
} 

.student-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.danger-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  background: #fee2e2;
  color: #b91c1c;
}

.teacher-chart-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 860px) {
  .teacher-chart-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}