:root {
  color-scheme: dark;
  --bg: #0c0f0d;
  --bg-soft: #111712;
  --surface: rgba(24, 31, 26, 0.88);
  --surface-strong: #1b241d;
  --surface-muted: #131a15;
  --text: #f5f7f2;
  --muted: #9ea99e;
  --faint: #687266;
  --border: rgba(220, 232, 213, 0.12);
  --primary: #71e09b;
  --primary-strong: #3abd73;
  --blue: #79b8ff;
  --gold: #f2c96d;
  --violet: #b69cff;
  --danger: #ff7f7a;
  --success: #66d991;
  --warning: #f1c85b;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.22);
  --radius: 22px;
  --radius-sm: 16px;
  --ease: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: Manrope, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 15% -10%, rgba(113, 224, 155, 0.16), transparent 32rem),
    radial-gradient(circle at 110% 10%, rgba(121, 184, 255, 0.13), transparent 26rem),
    linear-gradient(180deg, #0c0f0d 0%, #0f1411 48%, #0b0d0c 100%);
}

button,
input {
  font: inherit;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.25;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(36, 48, 40, 0.96), rgba(19, 25, 21, 0.94)),
    linear-gradient(135deg, rgba(113, 224, 155, 0.12), rgba(121, 184, 255, 0.08));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -58% 42%;
  height: 220px;
  background: linear-gradient(90deg, rgba(113, 224, 155, 0.22), rgba(242, 201, 109, 0.08));
  transform: rotate(-8deg);
  pointer-events: none;
}

.hero-main,
.hero-side {
  position: relative;
  z-index: 1;
}

.brand-row,
.client-identity,
.live-pill,
.tab,
.filter,
.schedule-filter,
.section-title h2,
.client-meta span,
.quick-title,
.slot-main,
.slot-actions,
button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #d8f58a);
  color: #09110c;
  box-shadow: 0 14px 30px rgba(113, 224, 155, 0.24);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.eyebrow {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.brand-subtitle,
.hero-copy,
.section-title p,
.client-head p,
dt,
small,
time {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  margin-top: 22px;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
}

h3 {
  font-size: 17px;
}

.hero-copy {
  max-width: 660px;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.6;
}

.hero-side {
  align-self: stretch;
  display: grid;
  min-width: 190px;
  align-content: space-between;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(10px);
}

.hero-side strong {
  margin-top: 22px;
  font-size: 48px;
  line-height: 1;
}

.live-pill {
  width: max-content;
  border: 1px solid rgba(113, 224, 155, 0.32);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--primary);
  background: rgba(113, 224, 155, 0.1);
  font-weight: 900;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.stat,
.surface,
.client-card,
.progress-card,
.slot,
.slot-card,
.empty {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.stat {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  padding: 17px;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent, var(--primary));
}

.accent-green { --accent: var(--primary); }
.accent-blue { --accent: var(--blue); }
.accent-gold { --accent: var(--gold); }
.accent-violet { --accent: var(--violet); }
.accent-red { --accent: var(--danger); }

.stat-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  color: var(--accent, var(--primary));
  background: color-mix(in srgb, var(--accent, var(--primary)) 14%, transparent);
}

.stat strong {
  display: block;
  margin-top: 18px;
  font-size: 36px;
  line-height: 1;
}

.stat p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tabs,
.filters {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.045);
}

.tabs {
  position: sticky;
  top: env(safe-area-inset-top);
  z-index: 4;
  grid-template-columns: repeat(4, 1fr);
  backdrop-filter: blur(18px);
}

.filters {
  grid-template-columns: repeat(4, 1fr);
}

.tab,
.filter,
.schedule-filter {
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.tab:hover,
.filter:hover,
.schedule-filter:hover,
button:hover {
  transform: translateY(-1px);
}

.tab.is-active,
.filter.is-active,
.schedule-filter.is-active {
  background: linear-gradient(135deg, rgba(113, 224, 155, 0.18), rgba(255, 255, 255, 0.08));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(113, 224, 155, 0.16);
}

.panel {
  display: none;
  animation: panelIn 240ms ease both;
}

.panel.is-active {
  display: block;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 14px;
}

.surface {
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title.wide {
  margin-top: 20px;
}

.section-title h2 svg {
  color: var(--primary);
}

.attention-list,
.activity-feed,
.timeline,
.client-meta {
  display: grid;
  gap: 10px;
}

.attention-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  padding: 13px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.attention-row.warning {
  box-shadow: inset 4px 0 0 var(--warning);
}

.attention-row.danger {
  box-shadow: inset 4px 0 0 var(--danger);
}

.attention-badge,
.discipline,
.status {
  width: max-content;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.attention-badge {
  color: #211702;
  background: var(--gold);
}

.attention-row.danger .attention-badge {
  color: #2a0505;
  background: var(--danger);
}

.attention-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.activity-feed {
  position: relative;
}

.activity-feed::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 19px;
  width: 1px;
  background: linear-gradient(var(--primary), transparent);
}

.event {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  min-height: 54px;
  padding: 10px 0;
}

.event-icon {
  z-index: 1;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(113, 224, 155, 0.22);
  border-radius: 14px;
  color: var(--primary);
  background: #162019;
}

.event strong {
  display: block;
  padding-top: 2px;
  line-height: 1.35;
}

.event time {
  display: block;
  margin-top: 4px;
}

.client-list,
.progress-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.client-card,
.progress-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.client-card:hover,
.progress-card:hover,
.slot-card:hover,
.stat:hover,
.surface:hover {
  transform: translateY(-2px);
  border-color: rgba(113, 224, 155, 0.22);
}

.client-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--status-color, var(--primary));
}

.client-card.good { --status-color: var(--success); }
.client-card.warning { --status-color: var(--warning); }
.client-card.danger { --status-color: var(--danger); }

.client-head,
.progress-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.client-identity {
  min-width: 0;
}

.avatar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(113, 224, 155, 0.95), rgba(121, 184, 255, 0.9));
  color: #08100c;
  font-weight: 900;
}

.client-head h3,
.progress-head strong {
  overflow-wrap: anywhere;
}

.discipline.good {
  color: #092013;
  background: var(--success);
}

.discipline.warning {
  color: #231806;
  background: var(--warning);
}

.discipline.danger {
  color: #2a0505;
  background: var(--danger);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.metric-grid div {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.metric-grid span,
.client-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.goal-rail {
  height: 10px;
  margin: 14px 0 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.goal-rail.small {
  height: 8px;
}

.goal-rail span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  box-shadow: 0 0 18px rgba(113, 224, 155, 0.3);
}

.client-meta {
  margin-top: 12px;
  grid-template-columns: 1fr;
}

.client-meta span {
  min-width: 0;
  line-height: 1.35;
}

.client-meta svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
}

.reason {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding: 11px;
  border: 1px solid rgba(242, 201, 109, 0.24);
  border-radius: 15px;
  background: rgba(242, 201, 109, 0.1);
  color: #f7d88a;
  font-size: 13px;
  font-weight: 800;
}

.quick-message-panel {
  display: grid;
  gap: 10px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.quick-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.quick-title svg {
  color: var(--primary);
}

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

.quick-message {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.goal-form,
.slot-form {
  display: grid;
  gap: 10px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.slot-form {
  grid-template-columns: 1fr auto;
  align-items: end;
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 45px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

input:focus {
  border-color: rgba(113, 224, 155, 0.48);
  box-shadow: 0 0 0 4px rgba(113, 224, 155, 0.1);
}

button {
  justify-content: center;
  min-height: 45px;
  border: 0;
  border-radius: 14px;
  padding: 0 15px;
  background: linear-gradient(135deg, var(--primary), #d9f58d);
  color: #09110c;
  font-weight: 900;
  cursor: pointer;
  transition: transform var(--ease), filter var(--ease), opacity var(--ease);
}

button:active {
  transform: translateY(0) scale(0.99);
}

button.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

button.ghost,
button.mini {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

button.danger {
  color: #ffd1cf;
  background: rgba(255, 127, 122, 0.13);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-state {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.form-state.ok {
  color: var(--primary);
}

.form-state.error {
  color: var(--danger);
}

.schedule,
.schedule-board {
  gap: 11px;
}

.schedule-filters {
  margin-top: 0;
  grid-template-columns: repeat(4, 1fr);
}

.schedule-board {
  display: grid;
}

.schedule-day {
  display: grid;
  gap: 10px;
}

.schedule-day + .schedule-day {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.schedule-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 2px 2px 0;
}

.schedule-day-head h3 {
  min-width: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.schedule-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-slots {
  display: grid;
  gap: 10px;
}

.slot,
.slot-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
}

.slot-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.slot.free,
.slot-card.free {
  border-color: rgba(121, 184, 255, 0.24);
}

.slot.booked,
.slot-card.booked {
  border-color: rgba(113, 224, 155, 0.24);
}

.slot time,
.slot-card time {
  display: block;
  margin-bottom: 5px;
}

.slot-main {
  min-width: 0;
}

.slot-time {
  display: grid;
  width: 58px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.slot-main strong,
.slot-main p {
  overflow-wrap: anywhere;
}

.slot-main p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.slot-actions {
  min-width: 0;
  justify-content: end;
  flex-wrap: wrap;
}

.status.free {
  color: #06131f;
  background: var(--blue);
}

.status.booked {
  color: #092013;
  background: var(--success);
}

.weight-chart {
  height: 108px;
  margin: 13px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(113, 224, 155, 0.12), transparent),
    rgba(255, 255, 255, 0.045);
}

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

.weight-chart polyline {
  fill: none;
  stroke: url(#sparkGradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.weight-chart circle {
  fill: var(--primary);
}

.chart-empty {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

dl div:last-child {
  border-bottom: 0;
}

dd {
  margin: 0;
  font-weight: 900;
  text-align: right;
}

.empty {
  padding: 16px;
  color: var(--muted);
}

.empty.compact {
  box-shadow: none;
}

[hidden] {
  display: none !important;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
  }
}

@media (max-width: 980px) {
  .stats,
  .client-list,
  .progress-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 680px) {
  body {
    background:
      radial-gradient(circle at 50% -10%, rgba(113, 224, 155, 0.12), transparent 22rem),
      linear-gradient(180deg, #0c0f0d 0%, #0e130f 100%);
  }

  .shell {
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(22px + env(safe-area-inset-bottom));
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 18px;
    border-radius: 24px;
  }

  .hero-side {
    min-width: 0;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
  }

  .hero-side strong {
    margin: 0;
    font-size: 34px;
  }

  h1 {
    font-size: 34px;
  }

  .stats,
  .client-list,
  .progress-grid,
  .slot-form {
    grid-template-columns: 1fr;
  }

  .tabs,
  .filters,
  .schedule-filters {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-title {
    align-items: start;
    flex-direction: column;
  }

  .slot,
  .slot-card {
    grid-template-columns: 1fr;
  }

  .slot-actions {
    justify-content: start;
  }

  .slot-time {
    width: 54px;
    height: 42px;
    font-size: 14px;
  }

  .status,
  .mini {
    white-space: normal;
  }

  .form-actions {
    grid-template-columns: 1fr;
  }
}
