/* ===== БАЗОВЫЕ СТИЛИ ===== */
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.container {
  max-width: 600px;
  width: 100%;
  text-align: center;
  color: #fff;
}
header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(0,0,0,0.4);
}
.subtitle { opacity: 0.7; margin-top: 4px; font-size: 1rem; }

/* ===== ПОЛЬЗОВАТЕЛИ ===== */
.user-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 25px 0 20px;
  align-items: center;
}
.user-btn {
  padding: 8px 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 40px;
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s;
  backdrop-filter: blur(4px);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.user-btn:hover { background: rgba(255,255,255,0.12); }
.user-btn.active {
  background: rgba(255,255,255,0.2);
  border-color: #f5576c;
  box-shadow: 0 0 20px rgba(245,87,108,0.25);
}
.user-btn.child.active { border-color: #4facfe; }
.user-btn .logout-icon {
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0.5;
  margin-left: 4px;
}
.user-btn .logout-icon:hover { opacity: 1; }
.user-btn .limit-info {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-left: 6px;
  background: rgba(255,255,255,0.1);
  padding: 0 8px;
  border-radius: 20px;
}

/* ===== КАРТОЧКА ===== */
.card {
  width: 100%;
  max-width: 400px;
  height: 320px;
  margin: 0 auto 20px;
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  background-color: #1e1e2f;
}
.card-inner {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.2s ease;
}
.card-info {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 20px;
  margin: 0 auto 25px;
  max-width: 400px;
  border: 1px solid rgba(255,255,255,0.08);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.card-type {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  opacity: 0.7;
  background: rgba(255,255,255,0.1);
  padding: 2px 14px;
  border-radius: 30px;
  margin-bottom: 6px;
}
.card-text {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.card.pop .card-inner {
  animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.card.pop ~ .card-info {
  animation: fadeUp 0.5s ease 0.1s both;
}
@keyframes pop {
  0% { transform: scale(0.8) rotate(-5deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== КНОПКИ ===== */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}
.draw-btn {
  padding: 14px 40px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  border: none;
  border-radius: 60px;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 8px 25px rgba(245,87,108,0.3);
  letter-spacing: 1px;
  flex: 1 1 auto;
}
.draw-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(245,87,108,0.5);
}
.draw-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.sec-btn {
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 60px;
  cursor: pointer;
  transition: 0.3s;
}
.sec-btn:hover { background: rgba(255,255,255,0.18); }

.today-stats {
  margin: 15px 0 10px;
  font-size: 0.9rem;
  opacity: 0.7;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.today-stats span {
  background: rgba(255,255,255,0.05);
  padding: 2px 12px;
  border-radius: 30px;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
  display: none;
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}
.modal.active { display: flex; }
.modal-content {
  background: #1e1e2f;
  color: #fff;
  padding: 30px;
  border-radius: 28px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 30px 60px rgba(0,0,0,0.7);
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  font-size: 2rem;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: 0.3s;
  line-height: 1;
  background: transparent;
  border: none;
}
.modal-close:hover { color: #fff; transform: rotate(90deg); }
.modal h2 {
  font-weight: 600;
  font-size: 1.8rem;
  margin-bottom: 20px;
  padding-right: 40px;
}

.password-modal {
  max-width: 400px;
  text-align: center;
}
.password-modal input {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 1.2rem;
  text-align: center;
  letter-spacing: 2px;
  margin: 12px 0;
}
.password-modal input:focus { outline: none; border-color: #f5576c; }
.password-modal button {
  padding: 10px 30px;
  border: none;
  border-radius: 30px;
  background: linear-gradient(135deg, #f093fb, #f5576c);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
  margin: 5px;
}
.password-modal button:hover { transform: scale(1.02); }
.password-modal .cancel-btn { background: rgba(255,255,255,0.15); }
.error-msg { color: #ff6b6b; margin-top: 10px; display: none; }

/* ===== ОТЧЁТ ===== */
.report-user {
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 15px;
  margin-bottom: 20px;
}
.report-user h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.report-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.report-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
  font-size: 0.95rem;
}
.report-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #4facfe;
  cursor: pointer;
}
.report-item .task-type {
  font-size: 0.75rem;
  opacity: 0.6;
  background: rgba(255,255,255,0.08);
  padding: 0 10px;
  border-radius: 30px;
}
.report-item .delete-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: 6px;
  transition: 0.2s;
}
.report-item .delete-btn:hover {
  background: rgba(255,0,0,0.15);
  color: #ff6b6b;
}
.report-actions {
  margin-top: 25px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}
.report-actions button {
  padding: 10px 24px;
  border: none;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  color: #fff;
}
.report-actions .reset-btn {
  background: rgba(255,107,107,0.3);
  border: 1px solid rgba(255,107,107,0.3);
}
.report-actions .reset-btn:hover { background: rgba(255,107,107,0.5); }
.report-actions .close-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.1);
}
.report-actions .close-btn:hover { background: rgba(255,255,255,0.2); }

.no-data {
  opacity: 0.5;
  text-align: center;
  padding: 30px 0;
}

/* ===== РЕДАКТОР КАРТОЧЕК ===== */
.card-editor-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.card-editor-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 0 140px;
}
.card-editor-form label {
  font-size: 0.8rem;
  opacity: 0.6;
}
.card-editor-form input,
.card-editor-form select {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 0.95rem;
  width: 100%;
}
.card-editor-form input:focus,
.card-editor-form select:focus {
  outline: none;
  border-color: #4facfe;
}
.card-editor-form .form-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.card-editor-form button {
  padding: 8px 20px;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  color: #fff;
}
.card-editor-form .add-btn {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
}
.card-editor-form .add-btn:hover { transform: scale(1.02); }
.card-editor-form .cancel-btn {
  background: rgba(255,255,255,0.15);
}
.card-editor-form .cancel-btn:hover { background: rgba(255,255,255,0.25); }

.card-list {
  margin-top: 10px;
}
.card-list table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,0.02);
  border-radius: 16px;
  overflow: hidden;
  font-size: 0.9rem;
}
.card-list th {
  text-align: left;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}
.card-list td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.card-list .actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.card-list .actions-cell button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 6px;
  transition: 0.2s;
  white-space: nowrap;
}
.card-list .actions-cell button:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.card-list .delete-btn:hover { color: #ff6b6b; }
.card-list .edit-btn:hover { color: #4facfe; }
.card-list .upload-btn {
  background: rgba(79,172,254,0.2);
  border-radius: 12px;
  padding: 2px 10px;
}
.card-list .upload-btn:hover {
  background: rgba(79,172,254,0.4);
  color: #fff;
}
.card-list .upload-input {
  display: none;
}

.image-preview {
  max-width: 60px;
  max-height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255,255,255,0.05);
}

/* ===== ОШИБКА ===== */
.error-box {
  background: rgba(255,0,0,0.1);
  border: 1px solid rgba(255,0,0,0.2);
  border-radius: 16px;
  padding: 20px;
  margin: 20px 0;
}
.error-box button {
  margin-top: 10px;
  padding: 8px 24px;
  border: none;
  border-radius: 30px;
  background: #4facfe;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* ===== АДМИН-ФУТЕР ===== */
.admin-footer {
  margin-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  display: flex;
  justify-content: center;
}
.admin-footer button {
  padding: 8px 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 40px;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.3s;
}
.admin-footer button:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ===== ВКЛАДКИ ===== */
.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 10px;
  flex-wrap: wrap;
}
.admin-tabs button {
  padding: 8px 20px;
  border: none;
  border-radius: 30px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}
.admin-tabs button:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.admin-tabs button.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
}
.admin-tab-content {
  display: none;
}
.admin-tab-content.active {
  display: block;
}

/* ===== TELEGRAM ВКЛАДКА ===== */
.telegram-form .form-group {
  margin-bottom: 15px;
}
.telegram-form input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 0.95rem;
}
.telegram-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4facfe;
  cursor: pointer;
}
.telegram-form label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
#telegramStatus {
  padding: 10px 14px;
  border-radius: 12px;
  margin-top: 15px;
  display: none;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 600px) {
  header h1 { font-size: 2rem; }
  .card { height: 240px; }
  .card-text { font-size: 1.4rem; }
  .modal-content { padding: 20px; }
  .card-editor-form .form-group { flex: 1 1 100%; }
}