/* Client Cabinet - Mobile-only Telegram WebApp style */

body {
  background: var(--bg-secondary);
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 80px;
  overflow-x: hidden;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 var(--spacing-lg);
  gap: var(--spacing-md);
}
.header-title {
  flex: 1;
  font-size: var(--font-lg);
  font-weight: 600;
  text-align: center;
}
.header-back {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-link);
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle-mini {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle { display: none; }

/* App container */
.app-container {
  padding: var(--spacing-lg);
}

/* Screens */
.screen { display: none; }
.screen.active { display: block; }

/* Profile Card */
.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.profile-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-name {
  font-size: var(--font-lg);
  font-weight: 600;
}
.profile-role {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}
.loyalty-bar {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.loyalty-points {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--accent);
}
.loyalty-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-md) var(--spacing-xs);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  cursor: pointer;
  font-size: var(--font-xs);
  color: var(--text-secondary);
  text-align: center;
  transition: all var(--transition);
  border-width: 0;
  box-shadow: var(--shadow-sm);
}
.quick-action:hover { background: var(--bg-hover); }
.quick-action-icon {
  font-size: 24px;
  line-height: 1;
}

/* Section blocks */
.section-block {
  margin-bottom: var(--spacing-lg);
}
.section-title {
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title-link {
  font-size: var(--font-xs);
  color: var(--text-link);
  cursor: pointer;
}

/* Upcoming item */
.upcoming-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  border-left: 4px solid var(--accent);
}
.upcoming-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.upcoming-info { flex: 1; }
.upcoming-title {
  font-weight: 600;
  font-size: var(--font-sm);
}
.upcoming-meta {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}
.upcoming-time {
  text-align: right;
  flex-shrink: 0;
}
.upcoming-time-value {
  font-size: var(--font-md);
  font-weight: 700;
}
.upcoming-time-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

/* Child card */
.child-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  cursor: pointer;
  transition: all var(--transition);
}
.child-card:active { transform: scale(0.98); }
.child-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--warning-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.child-info { flex: 1; }
.child-name { font-weight: 600; font-size: var(--font-sm); }
.child-meta { font-size: var(--font-xs); color: var(--text-secondary); }
.child-arrow {
  color: var(--text-tertiary);
  font-size: 18px;
}

/* Section pills (filter) */
.section-pills {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  padding: 0 0 var(--spacing-md) 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.section-pills::-webkit-scrollbar { display: none; }
.section-pill {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: var(--bg-card);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}
.section-pill.active {
  background: var(--accent);
  color: var(--text-on-accent);
}

/* Date scroller */
.date-scroller {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  padding: 0 0 var(--spacing-lg) 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.date-scroller::-webkit-scrollbar { display: none; }
.date-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  min-width: 52px;
  cursor: pointer;
  border: none;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}
.date-pill.active {
  background: var(--accent);
  color: var(--text-on-accent);
}
.date-pill.today {
  border: 2px solid var(--accent);
}
.date-day-name {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  font-weight: 500;
}
.date-pill.active .date-day-name { color: var(--text-on-accent); opacity: 0.8; }
.date-day-num {
  font-size: var(--font-lg);
  font-weight: 700;
  line-height: 1.3;
}
.date-month {
  font-size: 9px;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.date-pill.active .date-month { color: var(--text-on-accent); opacity: 0.7; }

/* Time slots */
.slots-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}
.slot-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.slot-item:active { transform: scale(0.98); }
.slot-item.booked {
  opacity: 0.5;
  cursor: default;
}
.slot-time {
  font-size: var(--font-lg);
  font-weight: 700;
  min-width: 55px;
}
.slot-info { flex: 1; }
.slot-section {
  font-size: var(--font-sm);
  font-weight: 500;
}
.slot-details {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  margin-top: 2px;
}
.slot-status {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  flex-shrink: 0;
}
.slot-status.free {
  background: var(--success-light);
  color: var(--success);
}
.slot-status.booked {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}
.slot-status.class {
  background: var(--accent-light);
  color: var(--accent);
}
.slot-item.summary {
  background: var(--success-light);
  border: 1px dashed var(--success);
  cursor: pointer;
}
.slot-item.summary .slot-time {
  font-size: 24px;
  font-weight: normal;
}

/* Subscription card */
.sub-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow-sm);
}
.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}
.sub-section {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}
.sub-progress {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--spacing-sm);
}
.sub-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.sub-details {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-xs);
  color: var(--text-secondary);
}

/* Payment item */
.payment-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}
.payment-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.payment-info { flex: 1; }
.payment-desc {
  font-size: var(--font-sm);
  font-weight: 500;
}
.payment-date {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}
.payment-amount {
  font-weight: 700;
  font-size: var(--font-md);
  flex-shrink: 0;
}
.payment-amount.paid { color: var(--success); }
.payment-amount.pending { color: var(--warning); }

/* Child profile */
.child-profile-header {
  text-align: center;
  padding: var(--spacing-xl) 0;
}
.child-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--warning-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto var(--spacing-md);
}
.child-profile-name {
  font-size: var(--font-xl);
  font-weight: 700;
}
.child-profile-age {
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

/* Notification settings */
.notification-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.notification-text {
  flex: 1;
}
.notification-title {
  font-size: var(--font-sm);
  font-weight: 500;
}
.notification-desc {
  font-size: var(--font-xs);
  color: var(--text-secondary);
}
.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-tertiary);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--spacing-sm) 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-family: var(--font-family);
  transition: color var(--transition);
}
.bottom-nav-item.active {
  color: var(--accent);
}
.bottom-nav-icon {
  font-size: 22px;
  line-height: 1;
}
.bottom-nav-label {
  font-size: 10px;
  font-weight: 500;
}

/* Booking form in modal */
.booking-form-field {
  margin-bottom: var(--spacing-lg);
}
.booking-form-label {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
  display: block;
}
.booking-summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: var(--font-sm);
}
.booking-summary-row:last-child { border-bottom: none; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--spacing-3xl) var(--spacing-xl);
  color: var(--text-tertiary);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--spacing-md);
}
.empty-state-text {
  font-size: var(--font-sm);
}
