:root {
  --color-bg-base: #060B16;
  --color-surface-1: #0C1220;
  --color-surface-2: #111828;
  --color-surface-header: rgba(9, 14, 28, 0.96);
  --color-border-subtle: rgba(255, 255, 255, 0.07);
  --color-border-card: rgba(255, 255, 255, 0.06);
  --color-primary: #0091FF;
  --color-primary-light: #52B4FF;
  --color-accent: #00E5FF;
  --color-success: #00E676;
  --color-danger: #FF3D00;
  --color-primary-alpha-20: rgba(0, 145, 255, 0.2);
  --color-primary-alpha-40: rgba(0, 145, 255, 0.4);
  --color-danger-alpha-10: rgba(255, 61, 0, 0.1);
  --color-success-alpha-10: rgba(0, 230, 118, 0.1);
  --color-text-primary: #FFFFFF;
  --color-text-secondary: #8B93A8;
  --color-text-muted: #55606E;
  --font-family-display: 'Clash Display', 'Inter', sans-serif;
  --font-family-body: 'Inter', system-ui, sans-serif;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.125rem;
  --radius-xl: 1.5rem;
  --radius-full: 999rem;
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.6), 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 12px 40px rgba(0,0,0,0.7), 0 4px 12px rgba(0,0,0,0.5);
  --shadow-nav: 0 -16px 48px rgba(0,0,0,0.95), 0 -1px 0 rgba(255,255,255,0.05);
  --glow-primary: 0 0 1.5rem rgba(0,145,255,0.5), 0 0 3rem rgba(0,145,255,0.2);
  --gradient-primary: linear-gradient(135deg, #0091FF 0%, #005FCC 100%);
  --transition: 0.18s ease;
  --header-height: 3.5rem;
  --nav-height: 4rem;
  color-scheme: dark;
}

[data-theme=light] {
  --color-bg-base: #D6E4F7;
  --color-surface-1: #FFFFFF;
  --color-surface-2: #EAF2FF;
  --color-surface-header: rgba(255, 255, 255, 0.97);
  --color-border-subtle: rgba(0, 0, 0, 0.06);
  --color-border-card: rgba(0, 0, 0, 0.0);
  --color-text-primary: #07112A;
  --color-text-secondary: #374563;
  --color-text-muted: #7C8DA8;
  --shadow-sm: 0 4px 20px rgba(0,40,100,0.13), 0 1px 6px rgba(0,40,100,0.08);
  --shadow-md: 0 12px 40px rgba(0,40,100,0.18), 0 4px 12px rgba(0,40,100,0.1);
  --shadow-nav: 0 -8px 28px rgba(0,40,100,0.1), 0 -1px 0 rgba(0,0,0,0.08);
  --glow-primary: 0 0 1.5rem rgba(0,145,255,0.4), 0 0 2.5rem rgba(0,145,255,0.15);
  color-scheme: light;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(0.875rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  18% {
    transform: translateX(-9px);
  }
  36% {
    transform: translateX(9px);
  }
  54% {
    transform: translateX(-5px);
  }
  72% {
    transform: translateX(5px);
  }
}
@keyframes viewFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes calExitLeft {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-40%);
    opacity: 0;
  }
}
@keyframes calExitRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(40%);
    opacity: 0;
  }
}
@keyframes calEnterRight {
  from {
    transform: translateX(40%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes calEnterLeft {
  from {
    transform: translateX(-40%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
#ios-status-bar-fill {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top, 0px);
  background: #090E1C;
  z-index: 9999;
  pointer-events: none;
  transition: background-color 0.3s ease;
}

[data-theme=light] #ios-status-bar-fill {
  background: #D6E4F7;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
  background-color: var(--color-bg-base);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

input, select, textarea {
  font-size: 1rem;
}

h1, h2, h3 {
  font-family: var(--font-family-display);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.view {
  display: none;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}
.view.active {
  display: flex;
  animation: viewFadeIn 0.4s ease both;
}

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), box-shadow var(--transition), transform 0.12s ease;
  white-space: nowrap;
}
.btn svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn:not(:disabled):not(.is-loading):active {
  transform: scale(0.95);
}
.btn.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--glow-primary);
}
.btn.btn-ghost {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-subtle);
}
.btn.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn.btn-viber {
  background: #7360F2;
  color: #fff;
}
.btn.btn-viber:not(:disabled):not(.is-loading):hover {
  opacity: 0.9;
}
.btn.btn-block {
  width: 100%;
}
.btn.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}
.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading svg {
  opacity: 0;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.125rem;
  height: 1.125rem;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.icon-btn, .client-action-btn, .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease;
}
.icon-btn svg, .client-action-btn svg, .btn-icon svg {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
}
.icon-btn:hover, .client-action-btn:hover, .btn-icon:hover {
  filter: brightness(1.15);
}
.icon-btn:active, .client-action-btn:active, .btn-icon:active {
  transform: scale(0.84);
}

.icon-btn.btn-note-edit, .icon-btn, .client-action-btn.btn-client-edit, .btn-icon.btn-edit {
  background: rgba(249, 115, 22, 0.18);
  color: #F97316;
}

.icon-btn--danger, .btn-icon.btn-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.client-action-btn.btn-client-msg {
  background: var(--color-primary-alpha-20);
  color: var(--color-primary-light);
}

.client-action-btn.btn-client-notes {
  background: rgba(139, 92, 246, 0.18);
  color: #A78BFA;
}

.client-action-btn[href^=tel] {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
}

.client-action-btn, .btn-icon {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}

.btn-icon.btn-logout:hover {
  color: var(--color-danger);
}
.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--space-8) var(--space-4);
  gap: var(--space-6);
}
.login-wrap #login-panel, .login-wrap #forgot-panel {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.login-logo {
  width: 5rem;
  height: 5rem;
  flex-shrink: 0;
  animation: fadeInUp 0.5s 0.1s ease both;
}
.login-logo svg {
  width: 100%;
  height: 100%;
}
.login-logo .app-background {
  fill: #fff;
}
.login-logo .app-shape {
  fill: #0B0E14;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  font-family: var(--font-family-display);
  animation: fadeInUp 0.5s 0.18s ease both;
}

.login-form {
  width: 100%;
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: fadeInUp 0.5s 0.26s ease both;
}
.login-form.shake {
  animation: shake 0.42s ease;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field input, .field select, .field textarea {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  width: 100%;
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  color-scheme: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-20);
  background: rgba(0, 145, 255, 0.04);
}
.field input.is-invalid, .field select.is-invalid, .field textarea.is-invalid {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(255, 61, 0, 0.15);
  background: rgba(255, 61, 0, 0.04);
}
.field input option, .field select option, .field textarea option {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
}
.field textarea {
  resize: vertical;
}
.field select {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  cursor: pointer;
}
/* iOS WebKit gives date/time inputs an intrinsic width that ignores width:100%,
   making them overflow the two-column row and the modal sheet */
.field input[type=date], .field input[type=time] {
  -webkit-appearance: none;
          appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
}
.field input[type=date]::-webkit-date-and-time-value,
.field input[type=time]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}
.field input[readonly] {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}
.field .field-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.fields-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: end;
}

.form-error {
  color: var(--color-danger);
  font-size: 0.875rem;
  padding: var(--space-2) 0;
  animation: fadeInUp 0.25s ease both;
}

.field-pw-wrap {
  position: relative;
}
.field-pw-wrap input {
  padding-right: 2.75rem;
}

.field-pw-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}
.field-pw-toggle:hover {
  color: var(--color-text-primary);
}
.field-pw-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
  display: block;
}

.forgot-link {
  display: block;
  text-align: center;
  margin-top: var(--space-3);
  color: var(--color-primary-light);
  font-size: 0.875rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  width: 100%;
  transition: color 0.2s;
}
.forgot-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.forgot-back-btn {
  width: 100%;
  padding: var(--space-3) var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-align: center;
  border-top: 1px solid var(--color-border-subtle);
  margin-top: var(--space-1);
}
.forgot-back-btn:hover {
  color: var(--color-text-secondary);
}

.forgot-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
}

.forgot-step-hint {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

.forgot-sent-msg {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  padding: var(--space-4) 0;
  line-height: 1.6;
}

.reset-invalid {
  text-align: center;
  color: var(--color-danger);
  font-size: 0.9rem;
  padding: var(--space-4) 0;
}

.repeat-days-list {
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: fadeInUp 0.25s ease both;
}

.repeat-days-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: var(--space-3) var(--space-4) var(--space-2);
  background: var(--color-surface-2);
}

.repeat-day-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  transition: background 0.15s ease;
}
.repeat-day-item:hover {
  background: var(--color-surface-2);
}
.repeat-day-item input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.repeat-day-item .toggle-switch {
  width: 2.625rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border-subtle);
  position: relative;
  transition: background 0.22s ease, border-color 0.22s ease;
}
.repeat-day-item .toggle-switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: transform 0.22s cubic-bezier(0.34, 1.08, 0.64, 1), background 0.22s ease;
}
.repeat-day-item input[type=checkbox]:checked + .toggle-switch {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.repeat-day-item input[type=checkbox]:checked + .toggle-switch::after {
  transform: translateY(-50%) translateX(1.125rem);
  background: #fff;
}
.repeat-day-item input[type=checkbox]:disabled + .toggle-switch {
  opacity: 0.35;
}
.repeat-day-item:has(input[type=checkbox]:disabled) {
  cursor: not-allowed;
  pointer-events: none;
}
.repeat-day-item:has(input[type=checkbox]:disabled) .repeat-day-name {
  opacity: 0.45;
}
.repeat-day-item .repeat-day-name {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
}

.toggle-group {
  display: flex;
  gap: var(--space-2);
}

.toggle-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem var(--space-3);
  border: 1.5px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-family: var(--font-family-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.12s ease;
}
.toggle-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.toggle-btn:active {
  transform: scale(0.95);
}
.toggle-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-alpha-20);
  color: var(--color-primary-light);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-height);
  padding: 0 var(--space-4);
  background: var(--color-surface-header);
  border-bottom: 1px solid var(--color-border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  width: 100%;
}

.header-logo {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.header-logo:hover {
  transform: scale(1.08) rotate(-3deg);
}
.header-logo svg {
  width: 100%;
  height: 100%;
}
.header-logo .app-background {
  fill: #fff;
}
.header-logo .app-shape {
  fill: #0B0E14;
}

.header-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 1.0625rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-family-display);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  background: var(--color-surface-header);
  border-top: 1px solid var(--color-border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding-bottom: env(safe-area-inset-bottom);
  height: var(--nav-height);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0.5rem 0.25rem;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease, transform 0.12s ease;
  font-size: 0.6875rem;
  font-weight: 500;
}
.nav-item svg {
  width: 1.375rem;
  height: 1.375rem;
  transition: transform 0.2s ease;
}
.nav-item:active {
  transform: scale(0.9);
}
.nav-item.active {
  color: var(--color-primary);
}
.nav-item.active svg {
  transform: scale(1.1);
}

.nav-badge {
  position: absolute;
  top: 0.375rem;
  right: calc(50% - 1.25rem);
  min-width: 1.125rem;
  height: 1.125rem;
  border-radius: var(--radius-full);
  background: var(--color-danger);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.25rem;
  animation: fadeInUp 0.2s ease both;
}

.app-main {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding: var(--space-6) var(--space-4) calc(var(--nav-height) + var(--space-8));
  max-width: 40rem;
  width: 100%;
  margin: 0 auto;
}

.section {
  display: none;
}
.section.active {
  display: block;
  animation: fadeInUp 0.3s ease both;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  position: relative;
}

.cal-title-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.125rem;
  font-weight: 700;
  font-family: var(--font-family-display);
  color: var(--color-text-primary);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.cal-title-btn:hover {
  background: var(--color-surface-2);
}
.cal-title-btn[aria-expanded=true] .cal-title-chevron {
  transform: rotate(180deg);
}
.cal-title-btn .cal-title-chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--color-text-muted);
}

.cal-month-picker {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-3);
  animation: fadeInUp 0.18s ease both;
}
.cal-month-picker.hidden {
  display: none;
}

.cal-picker-year {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.cal-picker-year span {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-family-display);
}

.cal-picker-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-1);
}

.cal-picker-today-btn {
  width: 100%;
  margin-top: var(--space-2);
  padding: 0.45rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-primary-light);
  font-family: var(--font-family-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
}
.cal-picker-today-btn:hover {
  background: var(--color-primary-alpha-20);
}

.cal-picker-month-btn {
  padding: 0.5rem 0.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-secondary);
  font-family: var(--font-family-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.cal-picker-month-btn:hover {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
}
.cal-picker-month-btn.active {
  background: var(--color-primary-alpha-20);
  color: var(--color-primary-light);
  font-weight: 700;
}

.cal-content {
  overflow: hidden;
}

.cal-content.cal-exit-left {
  animation: calExitLeft 0.2s ease forwards;
}

.cal-content.cal-exit-right {
  animation: calExitRight 0.2s ease forwards;
}

.cal-content.cal-enter-right {
  animation: calEnterRight 0.25s cubic-bezier(0.34, 1.08, 0.64, 1) forwards;
}

.cal-content.cal-enter-left {
  animation: calEnterLeft 0.25s cubic-bezier(0.34, 1.08, 0.64, 1) forwards;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: var(--space-1);
}
.cal-weekdays span {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: var(--space-6);
  transition: opacity 0.22s ease;
}
.cal-grid.is-loading {
  opacity: 0;
  pointer-events: none;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.cal-day.empty {
  cursor: default;
  pointer-events: none;
}
.cal-day:not(.empty):hover {
  background: var(--color-surface-2);
}
.cal-day:not(.empty):active {
  transform: scale(0.78);
}
.cal-day .cal-day-num {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
}
.cal-day .cal-dots {
  position: absolute;
  bottom: 3px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 3px;
}
.cal-day .cal-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-day .cal-dot.session {
  background: var(--color-primary);
}
.cal-day .cal-dot.booked {
  background: var(--color-success);
}
.cal-day.today .cal-day-num {
  color: var(--color-primary-light);
  font-weight: 700;
}
.cal-day.selected {
  background: var(--color-primary-alpha-20);
}
.cal-day.selected .cal-day-num {
  color: var(--color-primary-light);
  font-weight: 700;
}
.cal-day.selected .cal-dot.session {
  background: var(--color-primary-light);
}
.cal-day.past .cal-day-num {
  opacity: 0.3;
}
.cal-day.past .cal-dots {
  opacity: 0.3;
}

.sessions-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.sessions-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.sessions-section-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  font-family: var(--font-family-display);
}

.sessions-summary {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  animation: fadeInUp 0.25s ease both;
}

.session-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.75rem;
  font-size: 0.8125rem;
}
.session-stat .session-stat-num {
  font-weight: 700;
  color: var(--color-primary-light);
}
.session-stat .session-stat-lbl {
  color: var(--color-text-muted);
}
.session-stat.session-stat--booked .session-stat-num {
  color: var(--color-success);
}

.session-stat-rows {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.session-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
}
.session-stat-row--past {
  color: var(--color-text-muted);
}
.session-stat-row--past span:last-child {
  font-weight: 600;
}
.session-stat-row--upcoming {
  background: var(--color-surface-2);
  border-color: var(--color-border-subtle);
  border-radius: var(--radius-full);
}
.session-stat-row--upcoming span:first-child {
  color: var(--color-text-primary);
  font-weight: 700;
}
.session-stat-row--upcoming span:last-child {
  color: var(--color-text-secondary);
  font-weight: 600;
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: opacity 0.22s ease;
}
.sessions-list.is-loading {
  opacity: 0;
  pointer-events: none;
}

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2.5rem var(--space-4);
  font-size: 0.9375rem;
  animation: fadeInUp 0.3s ease both;
}

.empty-state--error {
  color: var(--color-danger);
  font-size: 0.8rem;
}

.session-card {
  position: relative;
  display: block;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, transparent 50%), var(--color-surface-1);
  border: 1px solid var(--color-border-card);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  animation: fadeInUp 0.32s ease both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.session-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}
[data-theme=light] .session-card {
  background: var(--color-surface-1);
  border-color: transparent;
  border-top-color: transparent;
  box-shadow: var(--shadow-sm);
}
[data-theme=light] .session-card:hover {
  box-shadow: var(--shadow-md);
}
.session-card.past {
  margin-top: 0.75rem;
}

.session-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.session-type-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-2);
  width: -moz-fit-content;
  width: fit-content;
}
.session-type-badge.single {
  background: var(--color-primary-alpha-20);
  color: var(--color-primary-light);
}
.session-type-badge.group {
  background: var(--color-success-alpha-10);
  color: var(--color-success);
}

.session-datetime {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 0.9375rem;
  font-weight: 600;
}

.session-duration {
  color: var(--color-text-muted);
  font-weight: 400;
}

.session-price {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.session-notes {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: var(--space-1);
}

.session-card-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex-shrink: 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-family-display);
  margin-bottom: var(--space-6);
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.request-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: fadeInUp 0.3s ease both;
  box-shadow: var(--shadow-sm);
}
[data-theme=light] .request-card {
  border-color: transparent;
}

.request-client {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.request-meta {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.request-contact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.request-contact a {
  font-size: 0.8125rem;
  color: var(--color-primary-light);
  text-decoration: none;
  width: -moz-fit-content;
  width: fit-content;
}
.request-contact a:active {
  opacity: 0.7;
}

.request-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.request-msg-btn {
  color: var(--color-accent) !important;
  border-color: rgba(0, 229, 255, 0.25) !important;
}

.conversations-list {
  display: flex;
  flex-direction: column;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: var(--radius-md);
}
.conv-item:hover {
  background: var(--color-surface-2);
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}
.conv-item:last-child {
  border-bottom: none;
}
.conv-item {
  animation: fadeInUp 0.3s ease both;
}

.conv-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  -o-object-fit: cover;
     object-fit: cover;
}

.conv-avatar--sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.875rem;
}

.conv-info {
  flex: 1;
  min-width: 0;
}

.conv-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.conv-preview {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.conv-unread-badge {
  min-width: 1.375rem;
  height: 1.375rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  flex-shrink: 0;
}

.conv-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-base);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.34, 1.08, 0.64, 1);
}
.conv-overlay.is-open {
  transform: translateX(0);
}

.conv-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-height);
  padding: 0 var(--space-4);
  flex-shrink: 0;
  background: var(--color-surface-header);
  border-bottom: 1px solid var(--color-border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.conv-header-name {
  flex: 1;
  font-weight: 700;
  font-size: 1rem;
  font-family: var(--font-family-display);
}

.conv-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overscroll-behavior: contain;
}

.msg-row {
  display: flex;
}
.msg-row.from-me {
  justify-content: flex-end;
}
.msg-row.from-client {
  justify-content: flex-start;
}
.msg-row {
  animation: fadeInUp 0.2s ease both;
}

.conv-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-surface-1);
  border-top: 1px solid var(--color-border-subtle);
}

.conv-emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  max-height: 13rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.conv-emoji-picker.hidden {
  display: none;
}
.conv-emoji-picker button {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}
.conv-emoji-picker button:hover {
  background: var(--color-surface-2);
}
.conv-emoji-picker button:active {
  transform: scale(0.88);
}

.conv-input-bar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
}
.conv-input-bar textarea {
  flex: 1;
  min-width: 0;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: 1rem;
  padding: 0.625rem 1rem;
  resize: none;
  max-height: 7.5rem;
  overflow-y: auto;
  line-height: 1.45;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.conv-input-bar textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-20);
}
.conv-input-bar .conv-btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.conv-input-bar .conv-btn-icon:active {
  transform: scale(0.88);
}
.conv-input-bar .conv-btn-icon.active {
  color: var(--color-primary-light);
  background: var(--color-primary-alpha-20);
}
.conv-input-bar .conv-btn-icon svg {
  width: 1.125rem;
  height: 1.125rem;
  pointer-events: none;
}
.conv-input-bar .btn-send {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-primary);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.conv-input-bar .btn-send svg {
  width: 1.125rem;
  height: 1.125rem;
}
.conv-input-bar .btn-send:active {
  transform: scale(0.88);
}

.msg-image {
  display: block;
  max-width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 0.25rem;
  cursor: pointer;
}

.clients-section-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0 0;
}

.clients-search {
  flex: 1;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: 1rem;
  padding: 0.625rem 1rem;
  box-sizing: border-box;
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.clients-search:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha-20);
}
.clients-search::-moz-placeholder {
  color: var(--color-text-muted);
}
.clients-search::placeholder {
  color: var(--color-text-muted);
}

.btn-add-client-inline {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 145, 255, 0.4);
  padding: 0;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.btn-add-client-inline svg {
  width: 1.25rem;
  height: 1.25rem;
}
.btn-add-client-inline:active {
  transform: scale(0.88);
}
.btn-add-client-inline:hover {
  box-shadow: 0 4px 20px rgba(0, 145, 255, 0.55);
}

.booking-search-prompt {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  padding: var(--space-6) var(--space-4);
}

.booking-client-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 45dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.booking-client-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s ease;
}
.booking-client-item:hover {
  background: var(--color-surface-2);
}
.booking-client-item.is-selected {
  background: var(--color-primary-alpha-20);
  outline: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
}
.booking-client-item.is-booked {
  opacity: 0.5;
  cursor: not-allowed;
}
.booking-client-item.is-booked:hover {
  background: transparent;
}

.booking-already-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle);
  margin-left: var(--space-1);
}

.booking-client-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.booking-client-info {
  flex: 1;
  min-width: 0;
}

.booking-client-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.booking-client-phone {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.booking-inline-form {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.booking-inline-form h4 {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0;
}

.booking-inline-input {
  width: 100%;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
}
.booking-inline-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.booking-inline-actions {
  display: flex;
  gap: var(--space-2);
}

.level-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding-top: var(--space-1);
}

#clients-list {
  padding: var(--space-3) 0 5rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.client-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  animation: fadeInUp 0.2s ease both;
  overflow: hidden;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}
[data-theme=light] .client-card {
  box-shadow: var(--shadow-sm);
  border-color: transparent;
}
.client-card:active {
  background: var(--color-surface-2);
}
.client-card.level-beginner::before, .client-card.level-intermediate::before, .client-card.level-advanced::before, .client-card.level-all::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.client-card.level-beginner::before {
  background: #EC4899;
}
.client-card.level-intermediate::before {
  background: #2563EB;
}
.client-card.level-advanced::before {
  background: #22C55E;
}
.client-card.level-all::before {
  background: linear-gradient(to bottom, #EC4899 0% 33.33%, #2563EB 33.33% 66.67%, #22C55E 66.67% 100%);
}

.client-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.client-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  border: 1.5px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9375rem;
  font-family: var(--font-family-display);
}
.client-avatar.client-avatar--photo {
  background: none;
  border: none;
  padding: 0;
  overflow: hidden;
  -o-object-fit: cover;
     object-fit: cover;
}

.client-info {
  flex: 1;
  min-width: 0;
}

.client-name {
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.client-preapproved-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--color-success);
  color: #fff;
  border: 2px solid var(--color-surface-1);
}
.client-preapproved-badge svg {
  width: 0.6rem;
  height: 0.6rem;
}

.client-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.client-actions-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
  margin-left: auto;
}

.client-action-btn {
  text-decoration: none;
}
.client-phone {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary-light);
  text-decoration: none;
}
.client-phone:hover {
  text-decoration: underline;
}

.client-detail-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.client-tabs {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.client-tabs::-webkit-scrollbar { display: none; }
.client-tab-btn {
  flex-shrink: 0;
  padding: 0.5rem 0.875rem;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-family: var(--font-family-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.client-tab-btn.active {
  background: var(--color-primary);
  color: #fff;
}

.client-tab-panel {
  display: none;
}
.client-tab-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.client-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4) var(--space-4);
  flex-shrink: 0;
}

.client-detail-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  border: 1.5px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  font-family: var(--font-family-display);
}

.client-detail-info {
  flex: 1;
  min-width: 0;
}

.client-detail-name {
  font-weight: 700;
  font-size: 1.125rem;
  font-family: var(--font-family-display);
}

.client-detail-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

.client-msg-btn {
  flex-shrink: 0;
}

.client-detail-section {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.client-section-header {
  margin-bottom: var(--space-3);
}
.client-section-header h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.client-session-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.client-session-row:last-child {
  border-bottom: none;
}
.client-session-row.past {
  opacity: 0.45;
}

.client-session-date {
  font-size: 0.9375rem;
  font-weight: 600;
}

.client-session-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.client-detail-toggle {
  margin-top: var(--space-2);
  width: 100%;
}

.client-notes-section {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.client-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
  padding-top: var(--space-1);
}
.client-notes-header h4 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

#client-notes-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.note-item {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  animation: fadeInUp 0.2s ease both;
}

.note-text {
  font-size: 0.9375rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: var(--space-2);
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.note-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.note-actions {
  display: flex;
  gap: var(--space-1);
}

.note-inline-form {
  background: var(--color-surface-1);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  animation: fadeInUp 0.2s ease both;
}

.note-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: none;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: 1rem;
  line-height: 1.55;
}

.note-form-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.field {
  position: relative;
}

.booking-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin-top: 0.25rem;
  max-height: 12rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.booking-suggestions.hidden {
  display: none;
}

.suggestion-item {
  padding: 0.625rem var(--space-4);
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 0.12s ease;
}
.suggestion-item:active, .suggestion-item:hover {
  background: var(--color-surface-2);
}
.suggestion-item small {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-left: 0.25rem;
}

.settings-group {
  margin-bottom: var(--space-8);
}

.settings-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.settings-cal-hint {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}
.settings-cal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.btn-cal-copy-link {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  text-decoration: underline;
  cursor: pointer;
  padding: var(--space-1);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.settings-msg {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  animation: fadeInUp 0.25s ease both;
}
.settings-msg.success {
  background: var(--color-success-alpha-10);
  color: var(--color-success);
}
.settings-msg.error {
  background: var(--color-danger-alpha-10);
  color: var(--color-danger);
}

.theme-switcher {
  display: flex;
  gap: var(--space-2);
}

.theme-btn {
  flex: 1;
  padding: 0.75rem;
  border: 1.5px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-family: var(--font-family-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.12s ease;
}
.theme-btn:active {
  transform: scale(0.95);
}
.theme-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary-alpha-20);
  color: var(--color-primary-light);
}

.modal-confirm {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  visibility: hidden;
  pointer-events: none;
}
.modal-confirm .modal-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-confirm .modal-confirm-card {
  position: relative;
  z-index: 1;
  background: var(--color-surface-1);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-subtle);
  padding: var(--space-6);
  width: 100%;
  max-width: 20rem;
  box-shadow: var(--shadow-md);
  transform: scale(0.88);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.08, 0.64, 1), opacity 0.2s ease;
}
.modal-confirm .modal-confirm-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  font-family: var(--font-family-display);
}
.modal-confirm .modal-confirm-card p {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.5;
}
.modal-confirm .modal-confirm-actions {
  display: flex;
  gap: var(--space-3);
}
.modal-confirm .modal-confirm-actions .btn {
  flex: 1;
}
.modal-confirm.is-open {
  visibility: visible;
  pointer-events: auto;
}
.modal-confirm.is-open .modal-confirm-backdrop {
  opacity: 1;
}
.modal-confirm.is-open .modal-confirm-card {
  transform: scale(1);
  opacity: 1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  visibility: hidden;
  pointer-events: none;
}
.modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.modal .modal-sheet {
  position: relative;
  background: var(--color-surface-1);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
  max-width: 100vw;
  max-height: 92dvh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-nav);
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.34, 1.08, 0.64, 1);
}
.modal.is-open {
  visibility: visible;
  pointer-events: auto;
}
.modal.is-open .modal-backdrop {
  opacity: 1;
}
.modal.is-open .modal-sheet {
  transform: translateY(0);
}
.modal.is-closing {
  visibility: visible;
}
.modal.is-closing .modal-backdrop {
  opacity: 0;
  transition-duration: 0.22s;
}
.modal.is-closing .modal-sheet {
  transform: translateY(100%);
  transition: transform 0.22s ease-in;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
  position: sticky;
  top: 0;
  background: var(--color-surface-1);
  z-index: 1;
}
.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  font-family: var(--font-family-display);
  margin: 0;
}

.modal-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.modal-actions {
  display: flex;
  gap: var(--space-3);
  padding-top: var(--space-2);
}
.modal-actions .btn {
  flex: 1;
}
#modal-session .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: var(--space-2) calc(-1 * var(--space-4)) calc(-1 * var(--space-4));
  padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  background: var(--color-surface-1);
  border-top: 1px solid var(--color-border-subtle);
}

.share-day-wrap {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
}

.share-preview {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.share-preview-title {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-family-display);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.share-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}
.share-session-row:last-of-type {
  border-bottom: none;
}

.share-session-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.share-session-time {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary-light);
}

.share-session-type {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.share-session-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.share-session-count {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-primary);
}
.share-session-count .share-session-spots {
  color: var(--color-text-muted);
  font-weight: 400;
}

.share-session-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.share-preview-totals {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
}

.session-card .session-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}
.session-card .session-card-head-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.session-card .session-card-time-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.session-card .session-card-time {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-family-display);
  color: var(--color-text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.session-card .session-card-type {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  width: -moz-fit-content;
  width: fit-content;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  color: var(--color-text-muted);
}
.session-card .session-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}
.session-card .session-card-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.session-card .session-notes {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: var(--space-1);
}
.session-card .session-spots-info {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-warning);
}
.session-card .session-spots-info.confirmed {
  color: var(--color-success);
}
.session-card .session-spots-info.pending {
  color: var(--color-text-muted);
}
.session-card .session-booked-clients {
  margin-top: var(--space-1);
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}
.session-card .session-booked-clients .booked-label {
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.session-card .session-booked-clients .booked-name {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.5rem;
  font-weight: 600;
}
.session-card .session-booked-clients .booked-name .btn-cancel-booking {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  background: rgba(255, 61, 0, 0.15);
  color: var(--color-danger);
  border: none;
  border-radius: 50%;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), transform 0.12s ease;
}
.session-card .session-booked-clients .booked-name .btn-cancel-booking:hover {
  background: var(--color-danger);
  color: #fff;
}
.session-card .session-booked-clients .booked-name .btn-cancel-booking:active {
  transform: scale(0.82);
}
.session-card .session-waiting-clients .booked-label {
  color: #F59E0B;
}
.session-card .session-waiting-clients .booked-name {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
}
.session-card.past {
  background: repeating-linear-gradient(135deg, transparent, transparent 6px, rgba(128, 128, 128, 0.04) 6px, rgba(128, 128, 128, 0.04) 12px), var(--color-surface-1);
  border-color: var(--color-border-subtle);
}
.session-card.past > *:not(.session-past-badge):not(.session-card-level-badge) {
  opacity: 0.7;
}
.session-card .session-past-badge {
  position: absolute;
  top: -0.65rem;
  right: var(--space-4);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle);
  pointer-events: none;
  white-space: nowrap;
}

.sessions-past-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
}
.sessions-past-divider::before, .sessions-past-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border-subtle);
}

.session-card-level-badge {
  position: absolute;
  top: -0.8rem;
  left: var(--space-4);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.28rem 0.9rem;
  border-radius: var(--radius-full);
  color: var(--color-text-primary);
  white-space: nowrap;
  pointer-events: none;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
}

.session-card.level-beginner {
  border-left: 3px solid #EC4899;
}

.session-card.level-intermediate {
  border-left: 3px solid #2563EB;
}

.session-card.level-advanced {
  border-left: 3px solid #22C55E;
}

.session-card.has-level-badge {
  margin-top: 0.95rem;
  padding-top: calc(var(--space-4) + 0.55rem);
}

.level-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 2px;
}

.client-level-picker {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-wrap: wrap;
}

.client-level-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.level-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
}
.level-pill:hover {
  opacity: 0.85;
}
.level-pill.active {
  color: #fff;
  border-color: transparent;
}
.level-pill[data-slug=beginner].active {
  background: #EC4899;
}
.level-pill[data-slug=intermediate].active {
  background: #2563EB;
}
.level-pill[data-slug=advanced].active {
  background: #22C55E;
}
.level-pill[data-slug=""].active {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
  border-color: var(--color-border-subtle);
}

.client-preapprove-row {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}

.client-preapprove-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.client-preapprove-toggle input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.client-preapprove-toggle .toggle-switch {
  width: 2.625rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border-subtle);
  position: relative;
  transition: background 0.22s ease, border-color 0.22s ease;
}
.client-preapprove-toggle .toggle-switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: transform 0.22s cubic-bezier(0.34, 1.08, 0.64, 1), background 0.22s ease;
}
.client-preapprove-toggle input[type=checkbox]:checked + .toggle-switch {
  background: var(--color-success);
  border-color: var(--color-success);
}
.client-preapprove-toggle input[type=checkbox]:checked + .toggle-switch::after {
  transform: translateY(-50%) translateX(1.125rem);
  background: #fff;
}
.client-preapprove-toggle input[type=checkbox]:disabled + .toggle-switch {
  opacity: 0.5;
}

.client-preapprove-label {
  flex: 1;
  font-size: 0.9375rem;
  color: var(--color-text-primary);
}

/* ── Journal (measurements / workouts / training logs / tasks) ── */
.journal-subheader {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: var(--space-3) 0 var(--space-2);
}
.journal-subheader:first-child { margin-top: 0; }

.journal-card {
  background: var(--color-surface-1);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  animation: fadeInUp 0.2s ease both;
}
.journal-card:last-child { margin-bottom: 0; }

.journal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.journal-card-date {
  font-size: 0.9375rem;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.journal-card-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}
.journal-card-actions .btn-icon {
  width: 2rem;
  height: 2rem;
}
.journal-card-actions .btn-icon svg {
  width: 1rem;
  height: 1rem;
}

.journal-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  margin-top: var(--space-2);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}
.journal-stat b { color: var(--color-text-primary); font-weight: 600; }

.journal-note-text {
  margin-top: var(--space-2);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  white-space: pre-wrap;
}

.journal-due-date {
  margin-top: var(--space-1);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.journal-photo {
  display: block;
  max-width: 8rem;
  max-height: 8rem;
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
  cursor: pointer;
  object-fit: cover;
}

.journal-exercise-list {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
}
.journal-exercise-line {
  font-size: 0.875rem;
  padding: 0.15rem 0;
}
.journal-exercise-name { font-weight: 600; }
.journal-exercise-meta { color: var(--color-text-muted); }

.journal-author-tag, .journal-shared-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}
.journal-author-tag {
  background: var(--color-primary-alpha-20);
  color: var(--color-primary-light);
}
.journal-shared-tag {
  background: var(--color-success-alpha-10);
  color: var(--color-success);
}

.journal-status-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}
.journal-status-assigned {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}
.journal-status-done {
  background: var(--color-success-alpha-10);
  color: var(--color-success);
}

.journal-inline-form {
  background: var(--color-surface-1);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: fadeInUp 0.2s ease both;
}
.journal-inline-form .field { margin-bottom: 0; }
.journal-inline-form textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  resize: vertical;
}

.journal-exercise-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.journal-exercise-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: var(--space-2);
  align-items: center;
}
.journal-exercise-row input {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-family: var(--font-family-body);
  font-size: 0.875rem;
  padding: 0.5rem 0.625rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.journal-ex-remove {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.journal-visibility-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}
.journal-visibility-toggle input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.journal-visibility-toggle .toggle-switch {
  width: 2.625rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border-subtle);
  position: relative;
  transition: background 0.22s ease, border-color 0.22s ease;
}
.journal-visibility-toggle .toggle-switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: transform 0.22s ease, background 0.22s ease;
}
.journal-visibility-toggle input[type=checkbox]:checked + .toggle-switch {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.journal-visibility-toggle input[type=checkbox]:checked + .toggle-switch::after {
  transform: translateY(-50%) translateX(1.125rem);
  background: #fff;
}

.session-manual-add-btn {
  margin-top: var(--space-3);
}

.session-attendee-btns {
  margin-top: var(--space-3);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.attendees-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.attendee-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-subtle);
}
.attendee-item:last-child {
  border-bottom: none;
}

.attendee-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--gradient-primary);
  color: #fff;
  -o-object-fit: cover;
     object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

.attendee-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attendee-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.attendee-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.attendee-tag {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-full);
  margin-bottom: 2px;
  width: -moz-fit-content;
  width: fit-content;
}
.attendee-tag.tag-app {
  background: var(--color-primary-alpha-20);
  color: var(--color-primary-light);
}
.attendee-tag.tag-manual {
  background: var(--color-success-alpha-10);
  color: var(--color-success);
}
.attendee-tag.tag-waiting {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.deleted-client-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
  font-style: italic;
}

.waiting-section {
  border-top: 1px solid var(--color-border-subtle);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
}
.waiting-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-4);
}
.waiting-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) 0;
}
.spots-stepper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.spots-stepper .stepper-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-subtle);
  background: transparent;
  color: inherit;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}
#spots-inc-count {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 700;
}
.btn-increase-spots {
  flex: 1;
}
.waiting-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-4) var(--space-3);
}

.request-detail {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.conv-last {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.conv-badge {
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  flex-shrink: 0;
}

.conv-unread-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-primary);
  margin-left: var(--space-2);
  vertical-align: middle;
}

.msg-bubble {
  max-width: 78%;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  line-height: 1.45;
  word-break: break-word;
  animation: fadeInUp 0.2s ease both;
  position: relative;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.msg-bubble .msg-time {
  display: block;
  font-size: 0.6875rem;
  margin-top: 0.25rem;
  text-align: right;
}
/* Instructor's own messages: right-aligned (sides flipped vs. the client app,
   where this class belongs to the client's own outgoing messages). */
.msg-bubble--instructor {
  align-self: flex-end;
  background: var(--gradient-primary);
  color: #fff;
  border-bottom-right-radius: var(--radius-sm);
}
.msg-bubble--instructor .msg-time {
  color: rgba(255, 255, 255, 0.5);
}
.msg-bubble--client {
  align-self: flex-start;
  background: var(--color-surface-2);
  border-bottom-left-radius: var(--radius-sm);
}
.msg-bubble--client .msg-time {
  color: var(--color-text-muted);
}
.msg-bubble--sending {
  opacity: 0.65;
}
.msg-bubble--media {
  padding: 0;
  background: none !important;
  border-radius: 0;
  max-width: 85%;
}
.msg-bubble--media .msg-time {
  display: none;
}

.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--color-border-subtle);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 2rem auto;
}

@keyframes slideUp {
  from {
    transform: translateY(6rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 0.75rem);
  left: 50%;
  transform: translateX(-50%) translateY(6rem);
  z-index: 300;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.08, 0.64, 1), opacity 0.25s ease;
}
.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.toast-success {
  background: var(--color-success);
  color: #000;
}
.toast.toast-error {
  background: var(--color-danger);
  color: #fff;
}

@keyframes calFade {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}
.cal-fade {
  animation: calFade 0.35s ease both;
}

.pwa-hidden {
  display: none !important;
}

:root {
  --pwa-surface: #1c1c1e;
  --pwa-border: rgba(255,255,255,0.1);
  --pwa-text: #fff;
  --pwa-muted: rgba(255,255,255,0.6);
}

[data-theme=light] {
  --pwa-surface: #f0f0f5;
  --pwa-border: rgba(0,0,0,0.1);
  --pwa-text: #111;
  --pwa-muted: rgba(0,0,0,0.5);
}

@keyframes pwa-slide-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes pwa-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.pwa-ios-banner, .pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: var(--pwa-surface);
  border-top: 1px solid var(--pwa-border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  transition: bottom 0.2s ease;
}

.pwa-install-banner {
  z-index: 850;
  animation: pwa-slide-up 0.3s ease;
}

.pwa-ios-icon, .pwa-install-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
}

.pwa-ios-body, .pwa-install-text {
  flex: 1;
  min-width: 0;
}

.pwa-ios-title, .pwa-install-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pwa-text);
  margin-bottom: 3px;
}

.pwa-install-title {
  margin-bottom: 0;
}

.pwa-install-sub {
  font-size: 0.75rem;
  color: var(--pwa-muted);
}

.pwa-ios-steps {
  font-size: 0.8rem;
  color: var(--pwa-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  line-height: 1.4;
}
.pwa-ios-steps svg {
  flex-shrink: 0;
  vertical-align: middle;
}
.pwa-ios-steps strong {
  color: var(--pwa-text);
}

.pwa-install-dismiss {
  background: none;
  border: none;
  color: var(--pwa-muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.pwa-notif-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(80px + env(safe-area-inset-bottom));
  animation: pwa-fade-in 0.25s ease;
}

.pwa-notif-card {
  background: var(--pwa-surface);
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  animation: pwa-slide-up 0.3s ease;
}

.pwa-notif-bell {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pwa-text);
  margin-bottom: 4px;
}
[data-theme=light] .pwa-notif-bell {
  background: rgba(0, 0, 0, 0.07);
}

.pwa-notif-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pwa-text);
}

.pwa-notif-sub {
  font-size: 0.875rem;
  color: var(--pwa-muted);
  line-height: 1.5;
}

.pwa-notif-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.pwa-notif-actions .btn {
  flex: 1;
}

.img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  z-index: 9999;
}
html:not([data-theme=dark]) .img-lightbox,
html[data-theme=light] .img-lightbox {
  background: rgba(240, 244, 249, 0.97);
}
.img-lightbox.lb-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.img-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.22s ease;
}
.img-lightbox.lb-open img {
  transform: scale(1);
  opacity: 1;
}
.img-lightbox__close {
  position: absolute;
  top: calc(1.25rem + env(safe-area-inset-top));
  right: 1.25rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}
html:not([data-theme=dark]) .img-lightbox__close,
html[data-theme=light] .img-lightbox__close {
  background: rgba(0, 0, 0, 0.1);
  color: var(--color-text-primary);
}

.msg-action-menu {
  position: fixed;
  inset: 0;
  z-index: 10000;
}
.msg-action-menu[aria-hidden=true] {
  display: none;
}
.msg-action-menu__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.msg-action-menu__sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface-1);
  border-radius: 1.25rem 1.25rem 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  padding-bottom: env(safe-area-inset-bottom);
  animation: msgSheetUp 0.24s cubic-bezier(0.32, 0.72, 0, 1) both;
}
.msg-action-menu__handle {
  width: 2.75rem;
  height: 4px;
  background: rgba(128, 128, 128, 0.35);
  border-radius: 2px;
  margin: 0.875rem auto 0.5rem;
}
.msg-action-menu__title {
  padding: 0.25rem 1.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}
.msg-action-menu button {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  font-size: 1.0625rem;
  color: var(--color-text-primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.msg-action-menu button svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  opacity: 0.65;
}
.msg-action-menu button:active {
  background: rgba(128, 128, 128, 0.15);
}
.msg-action-menu button.danger {
  color: #EF4444;
}
.msg-action-menu button.danger svg {
  opacity: 1;
}
.msg-action-menu button.cancel {
  justify-content: center;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

@keyframes msgSheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
.settings-places-list {
  display: flex;
  flex-direction: column;
}

.settings-place-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.settings-place-item:last-child {
  border-bottom: none;
}

.settings-place-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.place-hidden-badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.settings-empty {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
}

.session-place-name {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.session-place-hidden {
  font-size: 0.75rem;
  color: #F59E0B;
}

.msg-sending-dot {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-left: 4px;
  vertical-align: middle;
  animation: spin 1s linear infinite;
}

.msg-image-uploading-wrap {
  position: relative;
}
.msg-image-uploading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}
.msg-image-uploading-overlay svg {
  width: 2rem;
  height: 2rem;
  color: #fff;
  animation: spin 1s linear infinite;
}

.msg-preview-media {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.msg-preview-media svg {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
}/*# sourceMappingURL=app.css.map */
/* Referrals (clients sent by gym staff) */
.referrals-section:not(:empty) {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.referrals-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.referral-card.referral-new {
  border-color: var(--color-primary-alpha-40);
  box-shadow: 0 0 0 1px var(--color-primary-alpha-20);
}

.referral-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.referral-status {
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.referral-status--new { background: var(--color-primary-alpha-20); color: var(--color-primary-light); }
.referral-status--accepted { background: rgba(255, 193, 7, 0.12); color: var(--color-warning); }
.referral-status--contacted { background: var(--color-success-alpha-10); color: var(--color-success); }

.referral-row {
  font-size: 0.875rem;
  color: var(--color-text-primary);
}

.referral-key {
  color: var(--color-text-secondary);
}

.referral-from,
.referral-pending {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.referral-pending {
  align-self: center;
}

.transfer-all-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

#client-referral-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

#client-referral-info.hidden {
  display: none;
}

.referral-history summary {
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.referral-event {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  padding-top: var(--space-1);
}

.merge-candidates:not(:empty) {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.merge-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 193, 7, 0.35);
  background: rgba(255, 193, 7, 0.06);
}

.merge-text {
  font-size: 0.875rem;
  color: var(--color-text-primary);
}

.client-referred {
  color: var(--color-primary-light);
}

/* Transferring clients between instructors */
.btn-select-clients {
  flex-shrink: 0;
}

.select-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  margin-top: var(--space-2);
  background: var(--color-bg-base);
}

.select-bar.hidden {
  display: none;
}

.select-count {
  flex: 1;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.client-select-box {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--color-text-muted);
  border-radius: 6px;
}

.client-card.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-alpha-20);
}

.client-card.is-selected .client-select-box {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.client-card.is-selected .client-select-box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.client-card.is-locked {
  opacity: 0.55;
}

.select-mode .client-actions-row {
  display: none;
}

.client-loan {
  color: var(--color-warning);
}

.loan-banner {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 193, 7, 0.35);
  background: rgba(255, 193, 7, 0.06);
  font-size: 0.875rem;
  color: var(--color-text-primary);
}

.loan-banner.hidden,
.lent-clients.hidden {
  display: none;
}

.lent-clients {
  margin: var(--space-3) 0;
  font-size: 0.875rem;
}

.lent-clients summary {
  cursor: pointer;
  color: var(--color-text-secondary);
}

.lent-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.lent-meta {
  color: var(--color-text-muted);
  text-align: right;
}

.tc-kind {
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}

.tc-kind legend {
  padding: 0;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.tc-kind-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: 0.9rem;
}

.tc-kind.is-invalid {
  outline: 2px solid var(--color-danger);
  outline-offset: 4px;
  border-radius: 6px;
}

#client-loan-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

#client-loan-info.hidden {
  display: none;
}
