/* Danh sách thẻ bé */
.kids-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.kid-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  cursor: pointer;
  transition: all 0.2s ease;
}

.kid-card.active {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.12);
  transform: translateY(-2px);
}

.kid-avatar {
  font-size: 32px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 50%;
}

.kid-name { font-size: 14px; font-weight: 700; color: var(--text-sub); }
.kid-card.active .kid-name { color: var(--text-main); }
.kid-score { font-size: 22px; font-weight: 900; color: var(--primary); line-height: 1.1; margin-top: 2px; }
.score-unit { font-size: 12px; font-weight: 600; color: var(--text-sub); }

/* Bàn phím hành động (Action Buttons) */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-btn {
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 82px;
  text-align: left;
  cursor: pointer;
  border: 1.5px solid transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: transform 0.1s ease;
}

.action-btn:active { transform: scale(0.96); }

.btn-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-emoji { font-size: 22px; }
.btn-label { font-size: 13px; font-weight: 700; color: var(--text-main); line-height: 1.25; }
.btn-pts { font-size: 13px; font-weight: 800; align-self: flex-end; }

.theme-pos { background: var(--pos-bg); border-color: var(--pos-border); }
.theme-pos .btn-pts { color: var(--pos-text); }

.theme-neg { background: var(--neg-bg); border-color: var(--neg-border); }
.theme-neg .btn-pts { color: var(--neg-text); }

.theme-reward { background: var(--reward-bg); border-color: var(--reward-border); }
.theme-reward .btn-pts { color: var(--reward-text); }

/* Nhật ký Sổ cái (Ledger) */
.log-box {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 6px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  border: 1px solid var(--border);
}

.log-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.log-row:last-child { border-bottom: none; }
.log-title { font-size: 13px; font-weight: 700; color: var(--text-main); }
.log-time { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.log-point { font-size: 14px; font-weight: 800; }
.pts-plus { color: var(--pos-text); }
.pts-minus { color: var(--neg-text); }

/* Modal Panels */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  justify-content: center;
  align-items: flex-end;
}

.modal-backdrop.active { display: flex; }

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(var(--safe-bottom) + 20px);
  overflow-y: auto;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.12);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title { font-size: 17px; font-weight: 800; }

.btn-close-modal {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-sub);
  cursor: pointer;
}

.modal-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.backup-desc {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 12px;
  line-height: 1.4;
}

.btn-modal-action {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-bottom: 8px;
}

.btn-export { background: var(--primary); color: #ffffff; }
.btn-import { background: #f1f5f9; color: var(--text-main); border: 1.5px dashed var(--border); }

/* Thống kê */
.time-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.time-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
}

.time-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.stat-subhead {
  font-size: 12px;
  font-weight: 800;
  margin: 14px 0 8px;
}

.stat-pos-color { color: var(--pos-text); }
.stat-neg-color { color: var(--neg-text); }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 8px;
}

.stat-name { font-size: 13px; font-weight: 700; }
.stat-times { font-size: 11px; color: var(--text-sub); margin-top: 2px; }