.fitapp-mc-front {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #101828;
  background: #f8fafc;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.fitapp-mc-front__notice {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  padding: 16px;
  border-radius: 12px;
}

.fitapp-mc-front__notice--error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

.fitapp-mc-front__hero {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px;
  background: linear-gradient(135deg, #111827, #0f172a);
  color: #e5e7eb;
  border-radius: 16px;
}

.fitapp-mc-front__hero-text {
  flex: 1 1 420px;
}

.fitapp-mc-front__eyebrow {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 6px;
}

.fitapp-mc-front__title {
  font-size: 28px;
  margin: 0 0 8px;
  color: #fff;
}

.fitapp-mc-front__lead {
  margin: 0 0 14px;
  color: #cbd5e1;
}

.fitapp-mc-front__pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fitapp-mc-front__pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
}

.fitapp-mc-front__badge-box {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fitapp-mc-front__badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
}

.fitapp-mc-front__badge-label {
  font-size: 13px;
  color: #cbd5e1;
}

.fitapp-mc-front__badge-value {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.fitapp-mc-front__nav {
  display: flex;
  gap: 8px;
  margin: 18px 0 10px;
  flex-wrap: wrap;
}

.fitapp-mc-front__nav-link {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #0f172a;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fitapp-mc-front__nav-link:hover {
  border-color: #cbd5e1;
}

.fitapp-mc-front__nav-link.is-active {
  background: #111827;
  color: #f8fafc;
  border-color: #111827;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.12);
}

.fitapp-mc-front__section {
  display: block;
}

.fitapp-mc-front__metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.fitapp-mc-front__metric {
  flex: 1 1 180px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fitapp-mc-front__metric-label {
  color: #475467;
  font-size: 14px;
}

.fitapp-mc-front__metric-value {
  font-size: 24px;
  font-weight: 700;
}

.fitapp-mc-front__metric-foot {
  color: #94a3b8;
  font-size: 13px;
}

.fitapp-mc-front__cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.fitapp-mc-front__card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fitapp-mc-front__toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.fitapp-mc-front__toolbar input,
.fitapp-mc-front__toolbar select {
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  min-width: 160px;
}

.fitapp-mc-front__refresh {
  border: none;
  background: #111827;
  color: #f8fafc;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fitapp-mc-front__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fitapp-mc-front__item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
}

.fitapp-mc-front__item-main {
  min-width: 220px;
}

.fitapp-mc-front__item-title {
  font-weight: 700;
  margin: 0 0 4px;
  color: #0f172a;
}

.fitapp-mc-front__item-sub {
  color: #475467;
  font-size: 14px;
}

.fitapp-mc-front__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fitapp-mc-front__chip {
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 13px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.fitapp-mc-front__chip--success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.fitapp-mc-front__chip--warning {
  background: #fffbeb;
  border-color: #fef3c7;
  color: #92400e;
}

.fitapp-mc-front__chip--danger {
  background: #fef2f2;
  border-color: #fecdd3;
  color: #b91c1c;
}

.fitapp-mc-front__columns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.fitapp-mc-front__columns--stacked .fitapp-mc-front__panel {
  flex: 1 1 320px;
}

.fitapp-mc-front__panel {
  flex: 1 1 260px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
}

.fitapp-mc-front__panel h3 {
  margin: 0 0 10px;
}

.fitapp-mc-front__muted {
  color: #94a3b8;
}

.fitapp-mc-front__tree {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fitapp-mc-front__tree details {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.fitapp-mc-front__tree summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}

.fitapp-mc-front__tree ul {
  list-style: disc;
  margin: 6px 0 0 20px;
  padding: 0;
  color: #334155;
}

.fitapp-mc-front__empty {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  color: #64748b;
  text-align: center;
}

.fitapp-mc-front__loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
}

.fitapp-mc-front__spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  border-top-color: #111827;
  animation: fitapp-mc-spin 1s linear infinite;
}

@keyframes fitapp-mc-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .fitapp-mc-front {
    padding: 16px;
  }
}

/* ===== Quick actions ===== */
.fitapp-mc-front__item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.fitapp-mc-front__item-note {
  color: #475467;
  font-size: 14px;
}

.fitapp-mc-front__btn {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.1;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fitapp-mc-front__btn:hover {
  border-color: #cbd5e1;
}

.fitapp-mc-front__btn--primary {
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
  border-color: transparent;
}

.fitapp-mc-front__btn--primary:hover {
  opacity: 0.95;
}

.fitapp-mc-front__btn--danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.fitapp-mc-front__btn--danger:hover {
  border-color: #fca5a5;
}

/* ===== AI анкеты ===== */
.fitapp-mc-front__ai-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.fitapp-mc-front__ai-user {
  font-size: 16px;
  font-weight: 600;
}

.fitapp-mc-front__ai-stats {
  color: #667085;
  font-size: 13px;
}

.fitapp-mc-front__ai-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fitapp-mc-front__ai-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fitapp-mc-front__ai-title {
  margin: 0 0 8px;
  font-size: 15px;
}

.fitapp-mc-front__ai-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.fitapp-mc-front__ai-row:last-child {
  border-bottom: none;
}

.fitapp-mc-front__ai-label {
  flex: 1 1 220px;
  font-weight: 600;
  color: #101828;
}

.fitapp-mc-front__ai-value {
  flex: 2 1 260px;
  color: #475467;
}

.fitapp-mc-front__ai-history-item {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #f8fafc;
}

.fitapp-mc-front__ai-history-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.fitapp-mc-front__ai-history-title {
  font-weight: 600;
}

/* ===== Modal (front) ===== */
.fitapp-mc-front-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.fitapp-mc-front-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.fitapp-mc-front-modal__dialog {
  position: relative;
  width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(2, 6, 23, 0.35);
}

.fitapp-mc-front-modal__header {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  background: #fff;
}

.fitapp-mc-front-modal__title {
  font-weight: 700;
  color: #0f172a;
}

.fitapp-mc-front-modal__close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.fitapp-mc-front-modal__body {
  padding: 16px;
}

.fitapp-mc-front-modal__loading {
  color: #334155;
}

.fitapp-mc-front-modal__footer {
  border-top: 1px solid #e5e7eb;
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.fitapp-mc-front-modal__msg {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
}

.fitapp-mc-front-modal__msg.is-success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.fitapp-mc-front-modal__msg.is-error {
  background: #fef2f2;
  border-color: #fecdd3;
  color: #b91c1c;
}

/* Form grid (shared with admin modal layout) */
.fitapp-mc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.fitapp-mc-form-grid__full {
  grid-column: 1 / -1;
}

.fitapp-mc-front-modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #0f172a;
}

.fitapp-mc-front-modal input[type="text"],
.fitapp-mc-front-modal input[type="number"],
.fitapp-mc-front-modal input[type="date"],
.fitapp-mc-front-modal select {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.fitapp-mc-front-modal .description {
  font-weight: 400;
  font-size: 12px;
  color: #64748b;
}

/* ===== Lookup (typeahead) - same idea as in admin ===== */
.fitapp-mc-lookup {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fitapp-mc-lookup__input {
  flex: 1 1 auto;
}

.fitapp-mc-lookup__clear {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.fitapp-mc-lookup__dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.12);
  max-height: 260px;
  overflow: auto;
  z-index: 10000;
  display: none;
}

.fitapp-mc-lookup__option {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}

.fitapp-mc-lookup__option:last-child {
  border-bottom: none;
}

.fitapp-mc-lookup__option:hover,
.fitapp-mc-lookup__option.is-active {
  background: #f8fafc;
}

@media (max-width: 720px) {
  .fitapp-mc-form-grid {
    grid-template-columns: 1fr;
  }
}
