:root {
  --primary: #0470E2;
  --primary-light: #E8F2FD;
  --green: #17DB4E;
  --green-light: #E6FAED;
  --black: #1A1A1A;
  --gray-80: #8A8A8A;
  --gray-50: #C6C6C8;
  --gray-10: #F2F2F7;
  --white: #FFFFFF;
  --destructive: #FF024F;
  --radius: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--black);
  background: var(--gray-10);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.site-nav-inner,
.site-footer-inner,
.page-main,
.admin-shell,
.auth-shell {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.site-nav-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-logo-image {
  display: block;
  width: auto;
  height: 24px;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav-link {
  color: var(--gray-80);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.site-nav-link:hover {
  color: var(--black);
}

.site-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  background: var(--black);
  color: var(--white);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
}

.site-nav-cta:hover {
  opacity: 0.85;
  color: var(--white);
}

.site-nav-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--gray-10);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-80);
}

.site-nav-sign-out {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--destructive);
  cursor: pointer;
  padding: 6px 12px;
  margin-left: -20px;
  border-radius: 8px;
  transition: background 0.15s;
}

.site-nav-sign-out:hover {
  background: rgba(255, 2, 79, 0.06);
}

.page-main {
  flex: 1;
  padding: 64px 0 72px;
}

.page-hero {
  margin-bottom: 28px;
}

.page-main[data-legal-page] .page-hero {
  margin-bottom: 48px;
}

.page-label {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-size: 13px;
  font-weight: 700;
}

.page-title {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.05;
  letter-spacing: -1.8px;
  font-weight: 900;
}

.page-subtitle {
  margin: 0;
  max-width: 640px;
  color: var(--gray-80);
  font-size: 18px;
  line-height: 1.55;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}

.legal-card {
  padding: 28px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 24px;
  color: var(--gray-80);
  font-size: 14px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gray-10);
  border-radius: 999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

.empty-state {
  padding: 44px 28px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.empty-state p {
  margin: 0;
  color: var(--gray-80);
  font-size: 16px;
  line-height: 1.5;
}

.markdown {
  color: var(--black);
}

.markdown > *:first-child {
  margin-top: 0;
}

.markdown > *:last-child {
  margin-bottom: 0;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  margin: 1.6em 0 0.6em;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.markdown h1 {
  font-size: 34px;
}

.markdown h2 {
  font-size: 26px;
}

.markdown h3 {
  font-size: 21px;
}

.markdown p,
.markdown li,
.markdown blockquote {
  font-size: 16px;
  line-height: 1.75;
}

.markdown p,
.markdown ul,
.markdown ol,
.markdown blockquote {
  margin: 0 0 1em;
}

.markdown ul,
.markdown ol {
  padding-left: 1.4em;
}

.markdown a {
  color: var(--primary);
}

.markdown hr {
  border: 0;
  border-top: 1px solid var(--gray-50);
  margin: 2em 0;
}

.markdown blockquote {
  margin-left: 0;
  padding-left: 16px;
  border-left: 3px solid var(--gray-50);
  color: var(--gray-80);
}

.auth-shell,
.admin-shell {
  flex: 1;
  padding: 48px 0 72px;
}

.auth-header,
.admin-header {
  margin-bottom: 24px;
}

.auth-kicker,
.admin-kicker {
  display: inline-block;
  margin-bottom: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--green-light);
  color: #0D8A2E;
  font-size: 13px;
  font-weight: 700;
}

.auth-title,
.admin-title {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: -1.4px;
  font-weight: 900;
}

.auth-subtitle,
.admin-subtitle {
  margin: 0;
  max-width: 620px;
  color: var(--gray-80);
  font-size: 17px;
  line-height: 1.55;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  padding: 24px;
}

.section-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.section-copy {
  margin: 0 0 20px;
  color: var(--gray-80);
  font-size: 14px;
  line-height: 1.6;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
}

/* --- FLOATING LABEL FIELD --- */

.fl-field {
  position: relative;
  height: 60px;
  border: 1px solid var(--gray-50);
  border-radius: 14px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fl-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(4, 112, 226, 0.1);
}

.fl-field label {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--gray-80);
  pointer-events: none;
  transform-origin: left top;
  transition: top 0.15s ease, font-size 0.15s ease, transform 0.15s ease;
}

.fl-field.active label,
.fl-field:focus-within label {
  top: 8px;
  transform: translateY(0);
  font-size: 12px;
}

.fl-field input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 22px 18px 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--black);
  outline: none;
}

/* --- END FLOATING LABEL FIELD --- */

.field input,
.field textarea,
.field select {
  width: 100%;
  height: 60px;
  border: 1px solid var(--gray-50);
  border-radius: 16px;
  background: var(--white);
  padding: 0 18px;
  color: var(--black);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font: inherit;
}

.field textarea {
  height: auto;
  padding: 16px 18px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(4, 112, 226, 0.12);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A8A8A' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 40px;
  cursor: pointer;
}

.field textarea {
  min-height: 360px;
  resize: vertical;
  line-height: 1.6;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s, background 0.15s;
}

.button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button {
  background: var(--primary);
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
}

.ghost-button {
  background: var(--gray-10);
  color: var(--black);
  font-size: 16px;
  font-weight: 600;
}

.danger-button {
  background: rgba(255, 2, 79, 0.08);
  color: var(--destructive);
  font-size: 16px;
  font-weight: 600;
}

.message {
  display: none;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.message[data-tone="success"] {
  display: block;
  background: var(--green-light);
  color: #0D8A2E;
}

.message[data-tone="error"] {
  display: block;
  background: rgba(255, 2, 79, 0.08);
  color: var(--destructive);
}

.message[data-tone="info"] {
  display: block;
  background: var(--gray-10);
  color: var(--gray-80);
}


.helper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.helper-card {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--gray-10);
}

.helper-label {
  display: block;
  margin-bottom: 6px;
  color: var(--gray-80);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.helper-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
}

.preview-frame {
  border: 1px solid var(--gray-50);
  border-radius: 18px;
  padding: 22px;
  min-height: 360px;
  background: #FCFCFD;
}

.preview-frame.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-80);
  text-align: center;
}

/* --- STATS GRID --- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

/* --- USERS TABLE --- */

.users-table-wrap {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.users-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-80);
  border-bottom: 1px solid var(--gray-10);
}

.users-table td {
  padding: 12px;
  border-bottom: 1px solid var(--gray-10);
  white-space: nowrap;
}

.users-table tbody tr:last-child td {
  border-bottom: none;
}

.user-row-clickable {
  cursor: pointer;
  transition: background 0.12s;
}

.user-row-clickable:hover {
  background: var(--gray-10);
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-pro {
  background: var(--primary-light);
  color: var(--primary);
}

.status-complimentary {
  background: var(--green-light);
  color: #0D8A2E;
}

.status-active {
  background: var(--primary-light);
  color: var(--primary);
}

.status-trial {
  background: var(--gray-10);
  color: var(--gray-80);
}

.status-deleted {
  background: rgba(255, 2, 79, 0.08);
  color: var(--destructive);
}

.status-expired {
  background: rgba(255, 2, 79, 0.08);
  color: var(--destructive);
}

.user-row-deleted {
  opacity: 0.55;
}

.user-row-deleted:hover {
  opacity: 0.8;
}

.status-unknown {
  background: var(--gray-10);
  color: var(--gray-80);
}

/* --- END USERS TABLE --- */

/* --- USER DETAIL PANEL --- */

.user-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 900;
}

.user-panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.user-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: var(--white);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.user-panel.open {
  transform: translateX(0);
}

.user-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--gray-10);
}

.user-panel-header-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.user-panel-deletion-banner {
  margin: 0 24px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 2, 79, 0.08);
  border: 1px solid rgba(255, 2, 79, 0.15);
  color: var(--destructive);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-panel-deletion-banner strong {
  font-weight: 700;
}

.user-panel-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-panel-email {
  margin: 0;
  font-size: 14px;
  color: var(--gray-80);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-panel-close {
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: var(--gray-80);
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}

.user-panel-close:hover {
  color: var(--black);
}

.user-panel-stats {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--gray-10);
}

.user-panel-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-panel-stat-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-80);
}

.user-panel-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
}

.user-panel-section {
  padding: 16px 24px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.user-panel-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-80);
}

.user-panel-workout-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-panel-workout-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--gray-10);
  font-size: 14px;
  color: var(--black);
}

.user-panel-workout-list .workout-meta {
  margin-left: auto;
  color: var(--gray-80);
  font-size: 13px;
  white-space: nowrap;
}

.user-panel-empty {
  color: var(--gray-80);
  font-size: 14px;
  background: none !important;
  padding: 0 !important;
}

.user-panel-actions {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--gray-10);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-panel-dropdown {
  position: relative;
}

.user-panel-dropdown-trigger {
  width: 100%;
  justify-content: center;
  gap: 6px;
}

.dropdown-caret {
  font-size: 11px;
  opacity: 0.6;
}

.user-panel-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-10);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: none;
  z-index: 10;
}

.user-panel-dropdown-menu.open {
  display: flex;
  flex-direction: column;
}

.user-panel-dropdown-item {
  border: none;
  background: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.user-panel-dropdown-item:hover {
  background: var(--gray-10);
}

.user-panel-dropdown-item--danger {
  color: var(--destructive);
}

.user-panel-dropdown-item--danger:hover {
  background: rgba(255, 2, 79, 0.06);
}

/* --- END USER DETAIL PANEL --- */

/* --- CONFIRM DIALOG --- */

.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1100;
}

.confirm-dialog-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 380px;
  max-width: calc(100vw - 32px);
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.confirm-dialog.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.confirm-dialog-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
}

.confirm-dialog-message {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-80);
}

.confirm-dialog-field {
  margin-bottom: 20px;
}

.confirm-dialog-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
}

.confirm-dialog-field input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-50);
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  color: var(--black);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.confirm-dialog-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(4, 112, 226, 0.1);
}

.confirm-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.confirm-dialog-actions .button,
.confirm-dialog-actions .ghost-button,
.confirm-dialog-actions .danger-button {
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
  border-radius: 12px;
}

/* --- END CONFIRM DIALOG --- */

/* --- MOVEMENTS PANEL --- */

.mv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.mv-toolbar .message {
  flex: 1;
}

.mv-add-btn {
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
  border-radius: 12px;
  white-space: nowrap;
}

.mv-panel {
  width: 480px;
}

.mv-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.mv-panel-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mv-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mv-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
}

.mv-hint {
  font-weight: 400;
  color: var(--gray-80);
}

.mv-field input,
.mv-field select,
.mv-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-50);
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  color: var(--black);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mv-field input:focus,
.mv-field select:focus,
.mv-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(4, 112, 226, 0.1);
}

.mv-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A8A8A' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.mv-field textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.mv-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mv-fieldset {
  border: 1px solid var(--gray-10);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0;
}

.mv-fieldset legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  padding: 0 4px;
}

.mv-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}

.mv-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--black);
  cursor: pointer;
}

.mv-checkbox-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.mv-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  cursor: pointer;
}

.mv-toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.mv-custom-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
}

.status-beginner {
  background: var(--green-light);
  color: #0D8A2E;
}

.status-intermediate {
  background: var(--primary-light);
  color: var(--primary);
}

.status-advanced {
  background: rgba(255, 2, 79, 0.08);
  color: var(--destructive);
}

/* --- END MOVEMENTS PANEL --- */

/* --- ACTIVITY FEED --- */

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

.feed-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.feed-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-80);
  opacity: 0;
  transition: opacity 0.3s;
}

.feed-live-indicator.active {
  opacity: 1;
}

.feed-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: feed-pulse 2s ease-in-out infinite;
}

@keyframes feed-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.feed-list {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--white);
}

.feed-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.feed-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--gray-50);
  border-radius: 10px;
  background: var(--white);
  color: var(--gray-80);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, transform 0.2s;
}

.feed-refresh-btn:hover {
  background: var(--gray-10);
  color: var(--black);
}

.feed-refresh-btn:active {
  transform: rotate(180deg);
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-10);
  transition: background 0.12s;
}

.feed-item:hover {
  background: #FAFBFC;
}

.feed-list > :last-child,
.feed-list > :last-child > .feed-item:last-of-type {
  border-bottom: none;
}

.feed-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
}

.feed-dot--green { background: var(--green); }
.feed-dot--blue { background: var(--primary); }
.feed-dot--purple { background: #8B5CF6; }
.feed-dot--orange { background: #F59E0B; }
.feed-dot--red { background: var(--destructive); }
.feed-dot--gray { background: var(--gray-50); }

.feed-item-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--black);
}

.feed-item-message strong {
  font-weight: 600;
}

.feed-item-reason {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--gray-80);
  font-style: italic;
}

.feed-item-time {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--gray-80);
  white-space: nowrap;
  margin-top: 1px;
}

.feed-empty {
  padding: 48px 24px;
  text-align: center;
  font-size: 15px;
  color: var(--gray-80);
}

.feed-group {
  position: relative;
}

.feed-item--grouped {
  cursor: pointer;
}

.feed-group-toggle {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 1px solid var(--gray-50);
  border-radius: 8px;
  background: var(--white);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: var(--gray-80);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
}

.feed-group-toggle:hover {
  background: var(--gray-10);
  border-color: var(--black);
  color: var(--black);
}

.feed-group-children {
  display: none;
  padding-left: 24px;
}

.feed-group.open .feed-group-children {
  display: flex;
  flex-direction: column;
}

.feed-group-children .feed-item {
  border-left: 2px solid var(--gray-10);
}

/* --- END ACTIVITY FEED --- */

/* --- ANALYTICS DASHBOARD --- */

.analytics-sections {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.analytics-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-section-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analytics-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-80);
}

.analytics-section-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--gray-80);
  line-height: 1.5;
}

.analytics-metrics {
  display: grid;
  gap: 12px;
}

.analytics-metrics--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.analytics-metrics--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-metric-card {
  padding: 16px;
  border-radius: 16px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analytics-metric-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-80);
}

.analytics-metric-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--black);
}

.analytics-metric-hint {
  font-size: 12px;
  color: var(--gray-80);
  line-height: 1.4;
}

.analytics-chart-card {
  background: var(--white);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.analytics-chart-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-80);
}

.analytics-chart-container {
  height: 200px;
  position: relative;
}

.analytics-chart-container svg {
  width: 100%;
  height: 100%;
}

.analytics-revenue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--white);
}

.analytics-revenue-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-80);
}

.analytics-revenue-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--black);
}

.analytics-bar-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analytics-bar-label {
  width: 40px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-80);
  text-align: right;
  flex-shrink: 0;
}

.analytics-bar-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--gray-10);
  overflow: hidden;
}

.analytics-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.analytics-bar-count {
  width: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-80);
  text-align: right;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .analytics-metrics--3,
  .analytics-metrics--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- END ANALYTICS DASHBOARD --- */

.site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.72);
}

.site-footer-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--gray-80);
  font-size: 14px;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer-links a {
  text-decoration: none;
}

.site-footer-links a:hover {
  color: var(--black);
}

@media (max-width: 900px) {
  .grid-two {
    grid-template-columns: 1fr;
  }

  .helper-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-nav-inner,
  .site-footer-inner,
  .page-main,
  .admin-shell,
  .auth-shell {
    width: min(100%, calc(100% - 24px));
  }

  .site-nav-inner {
    min-height: 64px;
  }

  .site-nav-links {
    gap: 16px;
  }

  .site-nav-links .site-nav-link:not(.site-nav-cta) {
    display: none;
  }

  .page-main,
  .auth-shell,
  .admin-shell {
    padding-top: 36px;
    padding-bottom: 48px;
  }

  .legal-card,
  .panel {
    padding: 20px;
  }

  .site-footer-inner {
    min-height: auto;
    padding: 18px 0 22px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- CRM --- */

.crm-sub-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  width: fit-content;
}

.crm-sub-tab {
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-80);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.crm-sub-tab:hover {
  color: var(--black);
}

.crm-sub-tab.active {
  background: var(--gray-10);
  color: var(--black);
}

.crm-list-toggle {
  display: flex;
  gap: 4px;
}

.crm-list-btn {
  padding: 6px 14px;
  border: 1px solid var(--gray-50);
  border-radius: 10px;
  background: var(--white);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-80);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.crm-list-btn:hover {
  border-color: var(--black);
  color: var(--black);
}

.crm-list-btn.active {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.crm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crm-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.crm-table-wrap {
  overflow-x: auto;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.crm-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-80);
  border-bottom: 1px solid var(--gray-10);
}

.crm-table td {
  padding: 12px;
  border-bottom: 1px solid var(--gray-10);
  white-space: nowrap;
}

.crm-table tbody tr:last-child td {
  border-bottom: none;
}

.source-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.source-app {
  background: var(--primary-light);
  color: var(--primary);
}

.source-import {
  background: var(--gray-10);
  color: var(--gray-80);
}

.source-manual {
  background: var(--gray-10);
  color: var(--gray-80);
}

.source-website {
  background: var(--green-light);
  color: #0D8A2E;
}

.source-active {
  background: var(--green-light);
  color: #0D8A2E;
}

.source-inactive {
  background: rgba(255, 2, 79, 0.08);
  color: var(--destructive);
}

.source-draft {
  background: var(--gray-10);
  color: var(--gray-80);
}

.var-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  margin: 1px 2px;
}

.crm-action-btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.crm-add-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 12px rgba(4, 112, 226, 0.3);
}

.crm-add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(4, 112, 226, 0.4);
}

.crm-template-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.crm-template-link:hover {
  text-decoration: underline;
}

.fl-lock-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--gray-80);
  pointer-events: none;
}

.crm-form-panel {
  margin-top: 16px;
}

.crm-form-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
}

.crm-var-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.crm-var-label {
  min-width: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  font-family: monospace;
}

.crm-var-source {
  padding: 6px 10px;
  border: 1px solid var(--gray-50);
  border-radius: 10px;
  font-size: 13px;
  background: var(--white);
  cursor: pointer;
}

.crm-var-value {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--gray-50);
  border-radius: 10px;
  font-size: 13px;
  background: var(--white);
}

.crm-var-value:focus,
.crm-var-source:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(4, 112, 226, 0.1);
}

/* --- CRM Template Editor --- */

.crm-editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900;
}

.crm-editor-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92vw;
  max-width: 1200px;
  height: 85vh;
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

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

.crm-editor-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.crm-editor-vars {
  margin-top: 8px;
  font-size: 13px;
  color: var(--gray-80);
}

.crm-editor-vars-label {
  font-weight: 600;
}

.crm-editor-split {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.crm-editor-code {
  display: flex;
  flex-direction: column;
}

.crm-editor-preview {
  display: flex;
  flex-direction: column;
}

.crm-editor-pane-label {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-80);
}

.crm-preview-toggle {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
}

.crm-preview-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-50);
  border-radius: 8px;
  background: transparent;
  color: var(--gray-80);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.crm-preview-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.crm-preview-btn:hover:not(.active) {
  background: var(--gray-20);
}

.crm-editor-code textarea {
  flex: 1;
  width: 100%;
  border: 1px solid var(--gray-50);
  border-radius: 12px;
  padding: 14px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--black);
  background: #FAFBFC;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.crm-editor-code textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(4, 112, 226, 0.08);
}

.crm-editor-preview iframe {
  flex: 1;
  width: 100%;
  border: 1px solid var(--gray-50);
  border-radius: 12px;
  background: var(--white);
}

/* --- User Panel Tab Toggle --- */

.user-panel-tab-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid var(--gray-50);
  border-radius: 10px;
  overflow: hidden;
}

.user-panel-tab-btn {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-80);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.user-panel-tab-btn.active {
  background: var(--primary);
  color: white;
}

.user-panel-tab-btn:hover:not(.active) {
  background: var(--gray-10);
}

.user-panel-message-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-panel-message-item {
  padding: 12px 14px;
  background: var(--gray-10);
  border-radius: 12px;
}

.user-panel-message-item-text {
  font-size: 14px;
  color: var(--black);
  margin-bottom: 4px;
}

.user-panel-message-item-date {
  font-size: 12px;
  color: var(--gray-80);
}

/* --- Send Message Modal --- */

.send-msg-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}

.send-msg-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 460px;
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

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

.send-msg-title {
  font-size: 18px;
  font-weight: 700;
}

.send-msg-recipient {
  font-size: 14px;
  color: var(--gray-80);
  margin-bottom: 16px;
}

.send-msg-fields {
  margin-bottom: 20px;
}

.send-msg-submit {
  width: 100%;
}
