/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  background: #f5f5f7;
  color: #1c1c1e;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  min-height: 100vh;
}

.page--wide {
  max-width: 900px;
}

h1 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

h2 {
  font-size: 1rem;
  margin: 0 0 8px;
  color: #555;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.card ul {
  margin: 0;
  padding-left: 20px;
}

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn--primary {
  background: #2f6fed;
  color: #fff;
}

.btn--secondary {
  background: #e5e5ea;
  color: #1c1c1e;
  margin-top: 12px;
}

.flash {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.flash--notice {
  background: #e6f4ea;
  color: #1e7a34;
}

.flash--alert {
  background: #fdeaea;
  color: #b3261e;
}

/* 2단계: 과제·자유 제출 화면 공통 컴포넌트 */

.hint {
  color: #777;
  font-size: 0.85rem;
  margin: 4px 0;
}

.quota-note {
  color: #2f6fed;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 6px 0;
}

.week-badge {
  display: inline-block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2f6fed;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge--status {
  background: #e8f0fe;
  color: #2f6fed;
}

.badge--muted {
  background: #eee;
  color: #888;
}

.assignment-card {
  background: #f7f9ff;
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
}

.assignment-card__title {
  font-weight: 700;
  margin: 0 0 4px;
}

.assignment-card__due {
  color: #b3261e;
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.assignment-card .btn {
  width: auto;
  display: inline-block;
  padding: 10px 16px;
}

.alert-box {
  background: #fdeaea;
  color: #b3261e;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.error-box {
  background: #fdeaea;
  color: #b3261e;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.error-box ul {
  margin: 0;
  padding-left: 18px;
}

.card--success {
  border: 2px solid #2f6fed;
}

.field {
  margin: 14px 0;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.field textarea,
.field input[type="text"],
.field input[type="number"] {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 0.95rem;
  font-family: inherit;
}

.autosave-status {
  color: #888;
  font-size: 0.8rem;
  margin-top: 4px;
}

.card--nested {
  background: #f7f7f9;
  border-radius: 10px;
  padding: 12px;
  margin: 14px 0;
}

.recorder__label {
  font-weight: 600;
  margin: 0 0 8px;
}

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

.recorder__controls .btn {
  width: auto;
  padding: 10px 14px;
}

.recorder__indicator {
  color: #b3261e;
  font-weight: 600;
}

.recorder audio {
  width: 100%;
  margin-top: 8px;
}

.progress {
  background: #e5e5ea;
  border-radius: 999px;
  height: 8px;
  margin: 10px 0;
  overflow: hidden;
}

.progress__bar {
  background: #2f6fed;
  height: 100%;
  width: 0;
  transition: width 0.2s ease;
}

.history-list,
.progress-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-item {
  border-top: 1px solid #eee;
  padding: 10px 0;
}

.history-item:first-child {
  border-top: none;
}

.history-item__meta {
  font-size: 0.8rem;
  color: #888;
  margin: 0 0 4px;
}

.progress-list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eee;
}

.progress-list__item:first-child {
  border-top: none;
}

.progress-list__item--locked {
  opacity: 0.5;
}

.progress-list__week {
  font-weight: 700;
  width: 56px;
  flex-shrink: 0;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}

.admin-table__actions {
  display: flex;
  gap: 8px;
}

.btn-link {
  background: none;
  border: none;
  color: #2f6fed;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

.admin-nav {
  display: flex;
  gap: 18px;
  margin-bottom: 28px;
}

.admin-head {
  margin-bottom: 28px;
}

.admin-head p,
.admin-head h1,
.admin-head span,
.admin-panel h2 {
  margin: 0;
}

.admin-head p {
  margin-bottom: 6px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
}

.admin-head h1 {
  margin-bottom: 10px;
}

.admin-head span,
.admin-panel__head span,
.admin-recommendation-table td span {
  color: #6b7280;
  font-size: 13px;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat-grid article,
.admin-panel {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.admin-stat-grid article {
  padding: 18px;
}

.admin-stat-grid span,
.admin-stat-grid strong {
  display: block;
}

.admin-stat-grid span {
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.admin-stat-grid strong {
  font-size: 28px;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
}

.admin-panel {
  padding: 22px;
}

.admin-panel--wide {
  margin-top: 18px;
}

.admin-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-panel__head h2 {
  font-size: 20px;
}

.admin-result-list {
  display: grid;
  gap: 2px;
}

.admin-result-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #f3f4f6;
}

.admin-result-list > div:last-child {
  border-bottom: 0;
}

.admin-result-list span {
  font-size: 14px;
}

.admin-result-list b {
  white-space: nowrap;
  font-size: 13px;
}

.admin-recommendation-table td.is-wrap,
.admin-recommendation-table td.is-long-text {
  white-space: normal;
  vertical-align: top;
  line-height: 1.55;
}

.admin-recommendation-table td.is-wrap {
  min-width: 150px;
}

.admin-recommendation-table td.is-long-text {
  min-width: 220px;
  max-width: 340px;
}

.admin-empty {
  margin: 18px 0 0;
  color: #6b7280;
  text-align: center;
}

.admin-home-links {
  margin: 14px 0 20px;
}

@media (max-width: 1000px) {
  .admin-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stat-grid article,
  .admin-panel {
    padding: 16px;
  }

  .admin-stat-grid strong {
    font-size: 24px;
  }
}
