* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, #8da4ff 0, #5a46c6 35%, #3a2a8c 100%);
  min-height: 100vh;
  padding: 1.5rem;
}

.container {
  max-width: 520px;
  margin: 0 auto;
}

/* Шапка */

.header {
  text-align: center;
  color: #111827;
  margin-bottom: 1.5rem;
}

.header h1 {
  font-size: 1.9rem;
  font-weight: 700;
}

/* Общий баланс (можно потом посчитать и подставлять) */

.total-balance {
  margin-top: 0.4rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: #4b5563;
}

/* Карточки */

.card,
.history-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 1.6rem 1.4rem 1.8rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

/* Блок выбора недели */

.week-header {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
}

.week-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.week-header h2::before {
  content: "📅";
}

#weekSelect {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 0.55rem 0.8rem;
  font-size: 0.95rem;
  color: #374151;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#weekSelect:focus {
  border-color: #6366f1;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25);
}

/* Грейды */

.grades-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}

/* ОДНА красивая «полоса» на всю ширину под каждый балл */

.grade-input {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  border-radius: 14px;
  background: linear-gradient(120deg, #f9fafb, #f3f4ff);
  border: 1px solid #e5e7eb;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.grade-input:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(148, 163, 184, 0.25);
  border-color: #c7d2fe;
}

/* цветной кружок */

.emoji {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* само поле */

.grade-input input[type="number"] {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.15rem 0.2rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #111827;
  text-align: left;
  outline: none;
}

/* подпись и цена сдвинем вправо */

.label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #4b5563;
}

.price {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
}

.grade-input:nth-child(1) .emoji { background: #bbf7d0; }
.grade-input:nth-child(2) .emoji { background: #fef9c3; }
.grade-input:nth-child(3) .emoji { background: #fee2e2; }
.grade-input:nth-child(4) .emoji { background: #fecaca; }

.grade-input:nth-child(1) .price { color: #16a34a; }
.grade-input:nth-child(2) .price { color: #22c55e; }
.grade-input:nth-child(3) .price { color: #f97316; }
.grade-input:nth-child(4) .price { color: #dc2626; }

/* Блок суммы за неделю */

.week-balance {
  border-top: 1px dashed #e5e7eb;
  padding-top: 0.9rem;
  text-align: left;
  font-size: 0.95rem;
  color: #4b5563;
}

#weekBalance {
  font-size: 1.2rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

/* Кнопка */

.save-btn {
  margin-top: 0.9rem;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: #ffffff;
  background-image: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
  background-size: 200% 100%;
  box-shadow: 0 14px 30px rgba(129, 140, 248, 0.45);
  transition: background-position 0.22s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.save-btn:hover {
  background-position: 100% 0;
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(129, 140, 248, 0.55);
}

/* История */

.history-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.7rem;
}

#historyList {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.history-week {
  font-size: 0.9rem;
  color: #4b5563;
}

.history-bal {
  font-weight: 600;
  color: #16a34a;
}

.empty {
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Навбар и ошибки (если используешь) */

.top-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.top-nav a {
  color: #e5e7eb;
  text-decoration: none;
}

.error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
}

.demo-info {
  background: rgba(15, 23, 42, 0.08);
  color: #111827;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 0.7rem;
}

@media (max-width: 480px) {
  body {
    padding: 0.9rem;
  }
  .card,
  .history-card {
    padding: 1.4rem 1.1rem 1.5rem;
  }
}
.login-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 1.8rem 1.5rem 1.7rem;
  box-shadow: 0 18px 45px rgba(15,23,42,0.16);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
  text-align: center;
}

.login-card label {
  font-size: 0.9rem;
  color: #4b5563;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.login-card input {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 0.55rem 0.8rem;
  font-size: 0.95rem;
  outline: none;
}

.login-card input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99,102,241,0.25);
}


.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.top-nav a {
  color: #e5e7eb;
  text-decoration: none;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.4);
}
.parent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  background: #f9fafb;
  margin-bottom: 0.6rem;
}

.parent-day-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.parent-day-date {
  font-weight: 600;
  color: #111827;
}

.parent-day-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.parent-day-marks span strong {
  font-weight: 600;
}

.parent-day-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
}

.parent-day-balance {
  font-size: 1rem;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-paid {
  background: #dcfce7;
  color: #15803d;
}

.status-notpaid {
  background: #fee2e2;
  color: #b91c1c;
}

.edit-link {
  font-size: 0.8rem;
  color: #2563eb;
  text-decoration: none;
}
.parent-day-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.mark-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.mark-5 {
  background: #dcfce7;
  color: #15803d;
}

.mark-4 {
  background: #fef9c3;
  color: #a16207;
}

.mark-3 {
  background: #fee2e2;
  color: #b45309;
}

.mark-2 {
  background: #fee2e2;
  color: #b91c1c;
}
.settings-card h3 {
  margin-bottom: 1rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.settings-item label {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.2rem;
  display: block;
}

.settings-item input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}

.settings-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0.4rem 0 0.8rem;
}

.settings-subtitle {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: #111827;
}

.user-form {
  margin-bottom: 0.4rem;
}

.user-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.9fr auto;
  gap: 0.4rem;
  align-items: center;
}

.user-grid input,
.user-grid select {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg,#6366f1,#8b5cf6);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.user-actions {
  display: flex;
  gap: 0.3rem;
}

.btn-icon {
  border: none;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  background: #e5e7eb;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(15,23,42,0.35);
  box-shadow: 0 8px 20px rgba(15,23,42,0.45);
  text-decoration: none;
  font-size: 1.2rem;
}

.top-nav a {
  color: #e5e7eb;
  text-decoration: none;
}


.child-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: #f9fafb;
  margin-bottom: 0.4rem;
}

.history-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.history-date {
  font-weight: 600;
  color: #111827;
}

.history-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.history-balance {
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-paid {
  background: #dcfce7;
  color: #15803d;
}

.status-notpaid {
  background: #fee2e2;
  color: #b91c1c;
}


.unpaid-banner {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  background: #fee2e2;
  color: #b91c1c;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(248,113,113,0.35);
}

.unpaid-banner span {
  font-size: 0.9rem;
}

.unpaid-banner strong {
  font-size: 1.1rem;
}

.unpaid-banner-parent {
  margin-bottom: 0.5rem;
}

.unpaid-banner-child {
  margin-bottom: 0.5rem;
}
.header-with-settings {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(15,23,42,0.35);
  box-shadow: 0 8px 20px rgba(15,23,42,0.45);
  text-decoration: none;
  font-size: 1.2rem;
  color: #e5e7eb;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(15,23,42,0.35);
  box-shadow: 0 8px 20px rgba(15,23,42,0.45);
  text-decoration: none;
  font-size: 1.2rem;
  color: #e5e7eb;
}

.top-nav-right {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(15,23,42,0.35);
  box-shadow: 0 6px 16px rgba(15,23,42,0.45);
  text-decoration: none;
  font-size: 1.1rem;
  color: #e5e7eb;
}

.user-block {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.user-block-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.user-block-left .grade-input {
  width: 100%;
}

.user-block-right {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
}

.save-btn.small {
  padding: 0.35rem 0.9rem;
  min-width: 0;
}

.week-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.day-tabs {
  display: flex;
  gap: 0.25rem;
}

.day-tab {
  border: none;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.25);
  color: #374151;
  cursor: pointer;
}

.day-tab-active {
  background: linear-gradient(90deg, #6366f1, #a855f7);
  color: #ffffff;
}
