/* ========== БАЗОВЫЕ СТИЛИ ========== */
.tilda-double-container {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 50px 5vw 5vh;
  box-sizing: border-box;
  width: 100%;
}
.profile-header,
.tilda-spa-card {
  width: 100%;
  max-width: 1400px;
  box-sizing: border-box;
}
.profile-header {
  background: linear-gradient(135deg, #3b0764 0%, #310a6b 100%);
  border-radius: 28px;
  padding: 20px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.15);
}
.tilda-spa-card {
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex: 1;
  min-height: 0;
}
.profile-avatar { flex-shrink: 0; }
#member-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid yellow;
  background: #d9c7ff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.profile-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: white;
}
.profile-field {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  flex-wrap: wrap;
}
.field-label {
  font-weight: 600;
  min-width: 50px;
  opacity: 0.85;
  font-size: 12px;
}
.field-value {
  font-weight: 500;
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 40px;
  backdrop-filter: blur(4px);
  font-size: 12px;
}
.profile-rating {
  background: rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 40px;
  font-size: 16px;
  font-weight: 600;
  color: #ffd966;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  margin-left: auto;
}
.spa-sidebar {
  width: 260px;
  background: #e9dbff;
  border-right: 1px solid #eaeef2;
  padding: 28px 16px;
  flex-shrink: 0;
  overflow-y: auto;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 6px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  color: #1e2a3e;
  cursor: pointer;
  transition: all 0.2s;
}
.menu-item:hover {
  background: #eef2f6;
  color: #0066cc;
}
.menu-item.active {
  background: #310a6b;
  color: white;
  box-shadow: 0 2px 8px rgba(49, 10, 107, 0.2);
}
.menu-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}
.spa-content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.content-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.data-title {
  font-size: 24px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 20px;
  color: #0a2540;
}
.error-message {
  background: #fff5f5;
  border-left: 4px solid #e53e3e;
  padding: 14px 18px;
  border-radius: 12px;
  color: #c53030;
  font-size: 13px;
}

/* ПРЕЛОУДЕР (ВОЛНЫ) */
.loading-wave-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-height: 300px;
}
.loading-wave {
  width: 300px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.loading-bar {
  width: 20px;
  height: 10px;
  margin: 0 5px;
  background-color: #310a6b;
  border-radius: 5px;
  animation: loading-wave-animation 1s ease-in-out infinite;
}
.loading-bar:nth-child(2) { animation-delay: 0.1s; }
.loading-bar:nth-child(3) { animation-delay: 0.2s; }
.loading-bar:nth-child(4) { animation-delay: 0.3s; }
@keyframes loading-wave-animation {
  0% { height: 10px; }
  50% { height: 50px; }
  100% { height: 10px; }
}

/* КАРТОЧКИ ДАШБОРДА */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 10px;
}
.dashboard-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid #edf2f7;
  transition: 0.2s;
}
.dashboard-card:hover {
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.1);
  border-color: #e2e8f0;
}
.card-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: inline-block;
}
.card-title {
  font-size: 14px;
  color: #475569;
  font-weight: 500;
  margin-bottom: 8px;
}
.card-value {
  font-size: 28px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
  margin-bottom: 8px;
}
.card-sub {
  font-size: 12px;
  color: #64748b;
}
.reputation-stars {
  font-size: 18px;
  color: #ffd966;
  letter-spacing: 2px;
}
.reputation-sp {
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  margin-top: 8px;
}
hr {
  margin: 16px 0;
  border: none;
  border-top: 1px solid #edf2f7;
}

/* ТАБЛИЦЫ (Bootstrap-стиль) */
.bootstrap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.bootstrap-table th,
.bootstrap-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: middle;
}
.bootstrap-table th {
  font-weight: 600;
  color: #1e293b;
  background-color: #f8fafc;
}
.bootstrap-table tbody tr:hover {
  background-color: #f8fafc;
  transition: 0.1s;
}
.bootstrap-table .clickable-row {
  cursor: pointer;
}
.badge-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
  background: #f1f5f9;
  color: #1e293b;
}
.badge-status.new { background: #fef3c7; color: #92400e; }
.badge-status.active, .badge-status.open { background: #dbeafe; color: #1e40af; }
.badge-status.closed, .badge-status.completed { background: #dcfce7; color: #166534; }
.badge-status.processing { background: #fed7aa; color: #9a3412; }
.badge-status.pending { background: #fff3cd; color: #856404; }
.btn-link-table {
  background: none;
  border: none;
  color: #310a6b;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 20px;
  transition: 0.2s;
}
.btn-link-table:hover {
  background-color: #eef2ff;
  color: #1e1b4b;
}

/* МОДАЛЬНОЕ ОКНО ЧАТА */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: white;
  width: 500px;
  max-width: 90%;
  border-radius: 28px;
  padding: 24px;
  position: relative;
  box-shadow: 0 25px 45px -12px rgba(0,0,0,0.3);
}
.close-modal {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
}
.chat-messages {
  height: 300px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  padding: 12px;
  margin-bottom: 16px;
  background: #fafcff;
  border-radius: 20px;
}
.chat-messages div {
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border-radius: 16px;
  border-bottom: 1px solid #edf2f7;
}
#chatMessageInput {
  width: 100%;
  box-sizing: border-box;
  border-radius: 20px;
  border: 1px solid #cbd5e1;
  padding: 12px;
  font-family: inherit;
  resize: vertical;
}
.btn-send {
  background: #310a6b;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 40px;
  cursor: pointer;
  font-weight: 500;
  margin-top: 8px;
}
.btn-send:hover {
  background: #4a1d8c;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 800px) {
  .profile-header, .tilda-spa-card { max-width: 95%; }
  .profile-header { padding: 16px 20px; gap: 16px; }
  #member-avatar { width: 64px; height: 64px; }
  .spa-sidebar { width: 220px; }
  .spa-content { padding: 20px; }
  .profile-rating { font-size: 14px; padding: 6px 12px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .profile-header { flex-direction: column; align-items: center; text-align: center; }
  .profile-avatar { order: 1; margin-bottom: 8px; }
  .profile-rating { order: 2; margin: 0 0 16px 0; align-self: center; }
  .profile-info { order: 3; width: 100%; text-align: left; align-items: flex-start; }
  .profile-field { justify-content: flex-start; width: 100%; }
  .field-value { word-break: break-word; }
  .tilda-spa-card { flex-direction: column; }
  .spa-sidebar { width: 100%; display: flex; gap: 10px; overflow-x: auto; border-right: none; border-bottom: 1px solid #eaeef2; padding: 16px; }
  .menu-item { flex-shrink: 0; margin-bottom: 0; }
  .bootstrap-table th, .bootstrap-table td { padding: 8px 6px; font-size: 12px; }
  .btn-link-table { font-size: 11px; padding: 2px 6px; }
  .dashboard-card { padding: 16px; }
  .card-value { font-size: 24px; }
}