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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font, 'Inter', sans-serif);
  background: var(--bg, #f4f4f6);
  color: var(--text, #1a1a2e);
}

.app-layout {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* =====================
   Sidebar
   ===================== */
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100vh;
  position: sticky;
  top: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.nav-item {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 400;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.vendor-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.vendor-pill:hover {
  background: var(--bg);
}

.vendor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.vendor-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.vendor-role {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  margin-top: 4px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
  box-sizing: border-box;
}

.logout-link:hover {
  background: #fff0f0;
}

/* =====================
   Main layout
   ===================== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}

.main-content {
  flex: 1;
  padding: 32px;
  overflow-x: auto;
}

/* Page header (for listing pages) */
.header {
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

/* Topbar with breadcrumb (for form pages) */
.topbar {
  padding: 16px 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb-sep {
  color: var(--border2);
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

/* Page body (for form pages) */
.page-body {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Content header (for main-content pages) */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.content-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-title h1 {
  margin: 0;
}

/* =====================
   Buttons
   ===================== */
.btn {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.btn-primary,
a.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s;
  font-family: var(--font);
}

.btn-primary:hover,
a.btn-primary:hover {
  background: #4a4de0;
}

.btn-ghost,
a.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border2);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s;
  font-family: var(--font);
}

.btn-ghost:hover,
a.btn-ghost:hover {
  background: var(--bg);
}

.btn-sm {
  padding: 6px 13px;
  font-size: 13px;
  border-radius: 7px;
}

.btn-danger,
a.btn-danger {
  background: #fff0f0;
  color: var(--danger);
  border: 1px solid #fdd;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s;
  font-family: var(--font);
}

.btn-danger:hover,
a.btn-danger:hover {
  background: #ffe4e4;
}

.btn-secondary,
a.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border2);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s;
  font-family: var(--font);
}

.btn-secondary:hover,
a.btn-secondary:hover {
  background: var(--bg);
}

/* =====================
   Sections (form pages)
   ===================== */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-head h2 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.section-head p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  margin-bottom: 0;
}

.section-head-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent-bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}

.section-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* =====================
   Form fields
   ===================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .02em;
}

.field input,
.field select,
.field textarea {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 13px;
  outline: none;
  transition: all .15s;
  width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(91,94,244,.08);
}

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

.field-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--border2);
}

/* Status toggle row */
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-label {
  font-size: 13.5px;
  font-weight: 500;
}

.status-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* =====================
   Stats row (dashboard)
   ===================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-delta {
  font-size: 12px;
  font-weight: 500;
}

.stat-delta.up { color: var(--success); }
.stat-delta.dn { color: var(--danger); }

/* =====================
   Table
   ===================== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-title {
  font-size: 15px;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 22px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg);
}

td {
  font-size: 13.5px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

.td-muted {
  color: var(--muted);
  font-size: 12.5px;
}

/* =====================
   Badges
   ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-active   { background: #edfaf4; color: var(--success); }
.badge-inactive { background: #f0f0f0; color: var(--muted); }
.badge-paid     { background: #edfaf4; color: var(--success); }
.badge-pending  { background: #fff8ee; color: var(--warning); }
.badge-failed   { background: #ffeeee; color: var(--danger); }
.badge-accent   { background: var(--accent-bg); color: var(--accent); }
.badge-warning  { background: #fff3ee; color: var(--warning); }

/* =====================
   Cards (used in lists)
   ===================== */
.detail-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

/* =====================
   Tabs
   ===================== */
.tabs {
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  display: flex;
}

.tab-item {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-item:hover {
  color: var(--text);
}

/* =====================
   Lessons Table (list view)
   ===================== */
.lessons-table {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lesson-row {
  background: var(--surface);
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 40px;
  gap: 20px;
  align-items: center;
  transition: border .15s;
}

.lesson-row:hover {
  border-color: var(--border2);
}

.lesson-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-category {
  font-size: 12px;
  color: var(--muted);
}

.lesson-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.lesson-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1200px) {
  .lesson-row { grid-template-columns: 2fr 1fr 1fr 40px; }
  .lesson-row .lesson-detail:nth-child(4) { display: none; }
}

@media (max-width: 768px) {
  .lesson-row { grid-template-columns: 1fr 40px; gap: 16px; }
  .lesson-row .lesson-detail { display: none; }
}

/* =====================
   Lesson Form (old style - kept for reference)
   ===================== */
.lesson-form-container {
  max-width: 1400px;
  margin: 0 auto;
}

.lesson-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.lesson-form-header h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.back-link:hover {
  text-decoration: underline;
}

.lesson-form-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
}

.form-main {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border);
}

/* =====================
   Form fields (old style)
   ===================== */
.form-section {
  margin-bottom: 48px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 24px 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--muted);
}

.form-group label.required::after {
  content: " *";
  color: var(--danger);
}

.form-select,
.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: all 0.15s;
  outline: none;
}

.form-select:focus,
.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(91,94,244,.08);
}

.form-textarea {
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.file-input {
  display: block;
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--border2);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

/* Form sidebar (save/cancel panel) */
.form-sidebar {
  position: sticky;
  top: 24px;
  height: fit-content;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-cancel,
.btn-submit {
  width: 100%;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
  display: block;
  text-align: center;
  font-family: var(--font);
}

.btn-cancel {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border2);
}

.btn-cancel:hover { background: var(--bg); }

.btn-submit {
  background: var(--accent);
  color: #fff;
}

.btn-submit:hover { background: #4a4de0; }

@media (max-width: 1024px) {
  .lesson-form-content { grid-template-columns: 1fr; }
  .form-sidebar { position: static; }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

/* =====================
   Trainers List
   ===================== */
.trainers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trainer-card {
  background: var(--surface);
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 80px 2fr 1fr 1fr 1fr 40px;
  gap: 16px;
  align-items: center;
  transition: border .15s;
}

.trainer-card:hover {
  border-color: var(--border2);
}

.trainer-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--border);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: white;
  font-size: 24px;
  font-weight: 600;
}

.trainer-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trainer-label {
  font-size: 12px;
  color: var(--muted);
}

.trainer-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.trainer-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 12px;
  color: var(--muted);
}

.detail-value {
  font-size: 14px;
  color: var(--text);
}

.trainer-actions {
  display: flex;
  justify-content: flex-end;
}

.action-menu {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.action-menu:hover { background: var(--bg); }

@media (max-width: 1200px) {
  .trainer-card { grid-template-columns: 80px 2fr 1fr 40px; }
  .trainer-card .trainer-detail:nth-child(4),
  .trainer-card .trainer-detail:nth-child(5) { display: none; }
}

@media (max-width: 768px) {
  .trainer-card { grid-template-columns: 64px 1fr 40px; gap: 16px; }
  .trainer-card .trainer-detail { display: none; }
}

/* =====================
   Locations List
   ===================== */
.locations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.location-card {
  background: var(--surface);
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr 1fr 40px;
  gap: 20px;
  align-items: center;
  transition: border .15s;
}

.location-card:hover { border-color: var(--border2); }

.location-main { display: flex; flex-direction: column; gap: 4px; }

.location-address-label { font-size: 12px; color: var(--muted); }
.location-name { font-size: 16px; font-weight: 600; color: var(--text); }

.location-detail { display: flex; flex-direction: column; gap: 4px; }
.location-actions { display: flex; justify-content: flex-end; }

.hours-section { margin-bottom: 24px; }
.hours-label { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 12px; }

@media (max-width: 1200px) {
  .location-card { grid-template-columns: 2fr 2fr 1.5fr 40px; }
  .location-card .location-detail:nth-child(4) { display: none; }
}

@media (max-width: 768px) {
  .location-card { grid-template-columns: 1fr 40px; gap: 16px; }
  .location-card .location-detail { display: none; }
}

/* =====================
   Dashboard
   ===================== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.dashboard-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.metric-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.metric-card.large { min-height: 400px; }

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

.metric-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-title {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.metric-period-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: 8px;
}

.period-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.period-btn:hover {
  color: var(--text);
  background: var(--border);
}

.period-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.period-select-form { margin: 0; }

.period-select {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  outline: none;
}

.period-select:hover { border-color: var(--border2); }
.period-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,94,244,.08); }

.metric-main { margin-bottom: 24px; }

.metric-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.metric-change {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-change.positive { color: var(--success); }
.metric-change.negative { color: var(--danger); }

.chart-container { margin-top: 16px; }

/* Bar chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  opacity: 0.8;
}

.bar-count {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.bar-count-large { font-size: 20px; color: var(--text); font-weight: 700; }
.bar-label { font-size: 11px; color: var(--muted2); text-align: center; }

.bar-chart-single { justify-content: center; }
.bar-item-single { max-width: 120px; }

/* Line chart */
.line-chart { position: relative; }

.line-chart-svg {
  width: 100%;
  height: 150px;
}

.line-chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted2);
}

/* Additional info */
.additional-info h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text);
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.info-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.info-icon { flex-shrink: 0; }

.info-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.info-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

/* =====================
   Avail bar (slots fill)
   ===================== */
.avail-bar { display: flex; align-items: center; gap: 8px; }
.bar-track { width: 60px; height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; border: 1px solid var(--border); }
.bar-fill  { height: 100%; border-radius: 3px; background: var(--success); }
.bar-fill.warn { background: var(--warning); }
.bar-fill.full { background: var(--danger); }
.bar-label { font-size: 12.5px; color: var(--muted); }

/* =====================
   Extended badges
   ===================== */
.badge-single   { background: #eeecff; color: var(--accent); }
.badge-pass     { background: #eef6ff; color: #3b82f6; }
.badge-event    { background: #fff3ee; color: #e8763a; }
.badge-refunded { background: #f0f0f0; color: var(--muted); }
.badge-confirmed{ background: #edfaf4; color: var(--success); }
.badge-attended { background: #eeecff; color: var(--accent); }
.badge-cancelled{ background: #f0f0f0; color: var(--muted); }

/* =====================
   More button (⋯)
   ===================== */
.more-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 18px; padding: 0 4px; border-radius: 6px;
  transition: all .15s; line-height: 1;
}
.more-btn:hover { background: var(--bg); color: var(--text); }

/* =====================
   Toolbar (search + filters)
   ===================== */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-wrap { position: relative; flex: 1; max-width: 300px; }
.search-wrap input {
  width: 100%; background: var(--surface); border: 1px solid var(--border2);
  border-radius: 8px; padding: 8px 12px 8px 36px;
  font-family: var(--font); font-size: 13.5px; color: var(--text); outline: none;
  transition: border .15s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.filter-btn {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 7px; padding: 7px 14px;
  font-family: var(--font); font-size: 13px; color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); font-weight: 500; }

/* =====================
   Client row / avatar
   ===================== */
.client-row { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; flex-shrink: 0; }
.av1{background:#5b5ef4} .av2{background:#3b82f6} .av3{background:#e8763a}
.av4{background:#22b573} .av5{background:#f0a020} .av6{background:#e84646}

/* =====================
   Activity cards grid
   ===================== */
.act-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.act-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow); transition: border .15s;
}
.act-card:hover { border-color: var(--border2); }
.act-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.act-card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.act-card-sub { font-size: 12.5px; color: var(--muted); }
.act-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.act-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.act-stats { display: flex; gap: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.act-stat-val { font-size: 17px; font-weight: 600; }
.act-stat-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* =====================
   Upload zone
   ===================== */
.upload-zone {
  border: 2px dashed var(--border2); border-radius: 10px;
  padding: 32px 20px; text-align: center; cursor: pointer; transition: all .15s;
}
.upload-zone:hover { border-color: var(--accent); background: var(--accent-bg); }
.upload-icon { font-size: 28px; margin-bottom: 8px; opacity: .5; }
.upload-text { font-size: 13.5px; color: var(--muted); }
.upload-text strong { color: var(--accent); }
.upload-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* =====================
   Preview card
   ===================== */
/* ── Превью карточки ленты приложения (копия l2h_app lesson_card) ── */
.appcard-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}
.appcard {
  width: 216px;
  background: #f5f5f7;
  border-radius: 16px;
  padding: 8px;
}
.appcard-img {
  height: 112px;
  border-radius: 12px;
  background: #e9e9ee center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b6b6c2;
  overflow: hidden;
}
.appcard-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
  margin: 8px 2px 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}
.appcard-club {
  font-size: 12px;
  color: #8a8a93;
  margin: 0 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appcard-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #e165a2;
  background: #fdebf3;
  border-radius: 100px;
  padding: 4px 9px;
  margin: 0 2px 6px;
}
.appcard-capacity {
  font-size: 11px;
  color: #6f6f78;
  background: #fff;
  border-radius: 100px;
  padding: 5px 9px;
}
.appcard-note {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 216px;
}

/* =====================
   Attribute list
   ===================== */
.attr-list { display: flex; flex-direction: column; gap: 8px; }
.attr-row {
  display: grid; grid-template-columns: 1fr 120px 100px 32px;
  gap: 8px; align-items: center;
  padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; transition: border .15s;
}
.attr-row:hover { border-color: var(--border2); }
.attr-key { font-size: 13.5px; font-weight: 500; }
.attr-val { font-size: 13px; color: var(--muted); }
.attr-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.attr-filter { background: #eeecff; color: var(--accent); }
.attr-required { background: #fff3ee; color: var(--warning); }
.attr-rm { width: 28px; height: 28px; border-radius: 7px; background: none; border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.attr-rm:hover { background: #fff0f0; border-color: #fdd; color: var(--danger); }

/* =====================
   Attr add form
   ===================== */
.attr-add-form {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px; background: var(--accent-bg);
  border: 1px dashed var(--accent); border-radius: 8px;
}
.attr-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.attr-form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.mini-field { display: flex; flex-direction: column; gap: 4px; }
.mini-field label { font-size: 11px; font-weight: 500; color: var(--accent); }
.mini-field input, .mini-field select {
  font-family: var(--font); font-size: 13px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 7px; color: var(--text); padding: 8px 11px; outline: none; transition: border .15s;
}
.mini-field input:focus, .mini-field select:focus { border-color: var(--accent); }

/* =====================
   Preset chips
   ===================== */
.preset-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.preset-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  border: 1px solid var(--border2); background: var(--surface);
  font-size: 12.5px; cursor: pointer; transition: all .15s; color: var(--muted);
}
.preset-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.preset-chip.added { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* =====================
   Attr section tabs (.tab / .tab.on)
   ===================== */
.attr-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 22px; }
.tab {
  padding: 13px 16px; font-size: 13.5px; font-weight: 500; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }

/* =====================
   Toggle switch
   ===================== */
.toggle {
  width: 40px; height: 22px; background: var(--border2); border-radius: 11px;
  position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content:''; position:absolute; top:3px; left:3px;
  width:16px; height:16px; background:#fff; border-radius:50%;
  transition:transform .2s; box-shadow:0 1px 3px rgba(0,0,0,.2);
}
.toggle.on::after { transform:translateX(18px); }

/* =====================
   Page body grid (form + preview)
   ===================== */
.page-body-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.page-body-form { display: flex; flex-direction: column; gap: 18px; }

/* =====================
   Filter bar (horizontal pill-style, with border-bottom)
   ===================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
}
.filter-spacer { flex: 1; }

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border2);
  border-radius: 20px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  font-family: var(--font);
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* =====================
   Entity thumbnail (52×52 image/placeholder in table rows)
   ===================== */
.entity-thumb {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.entity-thumb-placeholder {
  width: 52px; height: 52px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--border2);
}
.entity-name-cell { display: flex; align-items: center; gap: 14px; }
.entity-type-label { font-size: 11px; font-weight: 500; color: var(--muted); margin-bottom: 2px; }
.entity-name { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.35; }

/* =====================
   Stat cells (in table rows)
   ===================== */
.stat-val  { font-size: 15px; font-weight: 600; color: var(--text); }
.stat-lbl  { font-size: 11px; color: var(--muted); margin-bottom: 2px; font-weight: 500; }
.stat-dash { color: var(--muted); font-size: 14px; }

/* =====================
   Status badge (with dot indicator)
   ===================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-badge.active   { background: #edfaf4; color: #1a9e5c; }
.status-badge.inactive { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.active   { background: #1a9e5c; }
.status-dot.inactive { background: var(--muted); }

/* =====================
   Kebab menu (shared dropdown trigger)
   ===================== */
.kebab-wrap { position: relative; display: inline-block; }
.kebab-btn {
  width: 30px; height: 30px;
  border: none; background: none;
  border-radius: 7px;
  cursor: pointer;
  color: var(--muted);
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s, color .1s;
  line-height: 1;
}
.kebab-btn:hover { background: var(--bg); color: var(--text); }

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0; top: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a,
.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
  transition: background .1s;
}
.dropdown-menu a:hover,
.dropdown-menu button:hover { background: var(--accent-bg); color: var(--accent); }
.dropdown-menu .danger { color: var(--danger); }
.dropdown-menu .danger:hover { background: #ffeeee !important; color: var(--danger) !important; }
.dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* =====================
   Empty state
   ===================== */
.empty-state { padding: 64px 28px; text-align: center; color: var(--muted); }
.empty-icon  { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub   { font-size: 13.5px; margin-bottom: 20px; }

/* =====================
   Scrollbar
   ===================== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* =====================
   Gender toggle buttons
   ===================== */
.gender-btns { display: flex; gap: 8px; }
.gbtn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.gbtn:hover { border-color: var(--accent); color: var(--accent); }
.gbtn.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* =====================
   Activity type cards
   ===================== */
.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.type-card {
  padding: 16px; border-radius: 10px;
  border: 1.5px solid var(--border2);
  cursor: pointer; transition: all .15s;
  position: relative;
}
.type-card:hover { border-color: var(--accent); background: var(--accent-bg); }
.type-card.active { border-color: var(--accent); background: var(--accent-bg); }
.type-card-check {
  position: absolute; top: 12px; right: 12px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; transition: all .2s;
}
.type-card.active .type-card-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.type-card-icon { font-size: 22px; margin-bottom: 8px; }
.type-card-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.type-card-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

.course-extra {
  background: var(--accent-bg);
  border: 1px solid rgba(91,94,244,.2);
  border-radius: 8px; padding: 14px;
  display: none; margin-top: 4px;
}
.course-extra.visible { display: block; }

/* =====================
   Wizard steps bar
   ===================== */
.wizard-steps {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  display: flex;
  flex-shrink: 0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 20px 14px 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font-size: 13.5px;
  transition: all .15s;
}
.wizard-step:hover { color: var(--text); }
.wizard-step.active { color: var(--accent); border-bottom-color: var(--accent); }
.wizard-step.done { color: var(--success); }
.wizard-step.done .ws-num { background: var(--success); color: #fff; border-color: var(--success); }
.wizard-step.active .ws-num { background: var(--accent); color: #fff; border-color: var(--accent); }

.ws-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0; color: var(--muted);
  transition: all .2s;
}
.ws-lbl { font-weight: 500; white-space: nowrap; }
.ws-arr { margin-left: 20px; color: var(--muted2); font-size: 12px; }

/* Wizard step pages */
.wizard-page { display: none; }
.wizard-page.active { display: contents; }

/* No-wizard mode: show all sections, hide navigation buttons */
.no-wizard .wizard-page { display: contents; }
.no-wizard .wizard-nav  { display: none; }

/* Nav buttons row inside wizard */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0 6px;
}

/* Tariff cards */
.tariff-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
.tariff-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.tariff-card-body {
  flex: 1;
  min-width: 0;
}
.tariff-card-name {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tariff-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.tariff-card-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.tariff-card-del {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all .15s;
}
.tariff-card-del:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fff0f0;
}

/* Tariff add button (like pdf-add) */
.tariff-add-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 4px;
}
.tariff-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* Tariff inline add form */
.tariff-add-form {
  display: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 4px;
}
.tariff-add-form.open { display: block; }
.tariff-add-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
}
.tariff-add-fields .field { margin-bottom: 0; }
@media (max-width: 640px) {
  .tariff-add-fields { grid-template-columns: 1fr 1fr; }
}
