* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f5f7;
  color: #111827;
  font-size: 14px;
}

/* ── Header & tabs ── */
.header {
  background: #1e2a3a;
  color: white;
  padding: 0 20px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.refresh-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 22px;
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1;
  touch-action: manipulation;
  flex-shrink: 0;
}

.refresh-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.refresh-btn:active {
  color: white;
}

.tab-bar {
  background: #e8eaed;
  padding: 10px 20px 0;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: #6b7280;
  border-radius: 6px 6px 0 0;
  font-family: inherit;
  touch-action: manipulation;
  white-space: nowrap;
}

.tab-btn.active {
  background: white;
  color: #111827;
  font-weight: 500;
}

.tab-btn:hover:not(.active) {
  color: #374151;
}

.content {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  width: 180px;
  outline: none;
  background: white;
  -webkit-appearance: none;
  flex: 1 1 140px;
}

.search-input:focus {
  border-color: #6b7280;
}

.filter-select {
  padding: 8px 28px 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: #374151;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.count-text {
  color: #6b7280;
  font-size: 13px;
  white-space: nowrap;
  margin-left: auto;
}

.btn-add {
  padding: 9px 16px;
  background: #111827;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  touch-action: manipulation;
  flex-shrink: 0;
}

.btn-add:hover {
  background: #374151;
}

/* ── Client cards ── */
.clients-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.client-card:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.client-card:active {
  background: #f9fafb;
}

.cc-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 10px;
}

.cc-info {
  flex: 1;
  min-width: 0;
}

.cc-name {
  font-weight: 600;
  font-size: 15px;
}

.cc-meta {
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
}

.cc-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px 12px;
  gap: 12px;
  border-top: 1px solid #f9fafb;
}

.cc-schedule {
  font-size: 11px;
  color: #9ca3af;
  text-align: right;
}

/* Package dots */
.pkg-cell {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 6px;
}

.pkg-cell:hover {
  background: #f3f4f6;
}

.pkg-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.pkg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5e7eb;
}

.pkg-dot.used {
  background: #16a34a;
}

.pkg-dot.scheduled {
  background: #93c5fd;
}

.pkg-cell-label {
  font-size: 11px;
  color: #9ca3af;
}

.pkg-no-pkg {
  color: #d1d5db;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  display: inline-block;
}

.pkg-no-pkg:hover {
  background: #f3f4f6;
  color: #9ca3af;
}

.loading {
  text-align: center;
  padding: 60px;
  color: #9ca3af;
}

.empty {
  padding: 40px;
  text-align: center;
  color: #9ca3af;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-active {
  background: #dcfce7;
  color: #15803d;
}

.badge-inactive {
  background: #f3f4f6;
  color: #6b7280;
}

/* ── Packages tab ── */
.pkg-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #92400e;
  margin-bottom: 12px;
}

.pkg-list-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.pkg-list-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pkg-list-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.pkg-list-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}

.pkg-list-client-info {
  flex: 1;
  min-width: 0;
}

.pkg-list-name {
  font-weight: 600;
  font-size: 14px;
}

.pkg-list-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.pkg-list-meta {
  text-align: right;
  flex-shrink: 0;
}

.pkg-list-method {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

.pkg-list-count {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.pkg-list-sessions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #f3f4f6;
}

.pkg-list-session {
  padding: 10px 14px;
  border-right: 1px solid #f3f4f6;
}

.pkg-list-session:last-child {
  border-right: none;
}

.pkg-list-session.done {
  background: #f0fdf4;
}

.pkg-list-session.sched {
  background: #eff6ff;
}

.pkg-list-session-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}

.pkg-list-session-n {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
  flex-shrink: 0;
}

.pkg-list-session.done .pkg-list-session-n {
  background: #16a34a;
  color: white;
}

.pkg-list-session.sched .pkg-list-session-n {
  background: #3b82f6;
  color: white;
}

.pkg-list-session-status {
  font-size: 11px;
  color: #9ca3af;
}

.pkg-list-session.done .pkg-list-session-status {
  color: #16a34a;
}

.pkg-list-session.sched .pkg-list-session-status {
  color: #3b82f6;
}

.pkg-list-session-date {
  font-size: 12px;
  color: #374151;
}

.pkg-list-session.done .pkg-list-session-date {
  color: #15803d;
}

.pkg-list-session.sched .pkg-list-session-date {
  color: #2563eb;
}

.pkg-list-no-date {
  font-size: 12px;
  color: #d1d5db;
}

.pkg-list-empty {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-align: center;
  padding: 40px;
  color: #9ca3af;
}

/* ── Settings Tab ── */
.settings-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  max-width: 800px;
  margin-bottom: 20px;
}

.settings-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-note {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 20px;
  background: #f9fafb;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.settings-note code {
  background: #e5e7eb;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 12px;
  color: #111827;
}

/* Toggle Switch (iOS Style) */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #16a34a;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

/* ── Shared modal base ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 26px;
  color: #9ca3af;
  line-height: 1;
  padding: 0 4px;
  touch-action: manipulation;
}

/* ── Form Styling ── */
.modal-box {
  background: white;
  border-radius: 10px;
  width: 560px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  -webkit-overflow-scrolling: touch;
}

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.modal-header-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
}

.modal-body {
  padding: 18px 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  bottom: 0;
  background: white;
  gap: 8px;
}

.modal-footer-right {
  display: flex;
  gap: 8px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.form-group.full {
  grid-column: span 2;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}

.form-input {
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  width: 100%;
}

.form-input:focus {
  border-color: #6b7280;
}

.btn-cancel {
  padding: 9px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-save {
  padding: 9px 16px;
  background: #111827;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  touch-action: manipulation;
}

.btn-save:hover {
  background: #374151;
}

.btn-save:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.btn-delete-modal {
  padding: 9px 14px;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  background: white;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: #ef4444;
  touch-action: manipulation;
  white-space: nowrap;
}

.btn-delete-modal:hover {
  background: #fef2f2;
}

/* ── Tag chip selectors ── */
.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 32px;
}

.tag-chip-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.tag-chip-label {
  display: inline-block;
  padding: 5px 13px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  color: #374151;
  background: white;
  user-select: none;
}

.tag-chip-label:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.tag-chip-input:checked + .tag-chip-label {
  background: #111827;
  color: white;
  border-color: #111827;
}

.tag-options-empty {
  font-size: 12px;
  color: #d1d5db;
  padding: 6px 0;
}

.add-new-row {
  display: flex;
  gap: 6px;
}

.add-new-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  background: white;
}

.add-new-btn {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  color: #374151;
}

.add-new-btn:hover {
  background: #f3f4f6;
}

/* ── Client detail modal ── */
.detail-section {
  margin-bottom: 18px;
}

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

.detail-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.detail-contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f3f4f6;
}

.detail-contact-row:last-child {
  border-bottom: none;
}

.detail-contact-icon {
  width: 18px;
  font-size: 13px;
  color: #9ca3af;
  flex-shrink: 0;
  text-align: center;
}

.detail-contact-link {
  color: #111827;
  text-decoration: none;
  font-size: 13px;
  word-break: break-all;
}

.detail-contact-text {
  font-size: 13px;
  color: #374151;
}

.detail-schedule-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-schedule-chip {
  padding: 4px 10px;
  background: #f3f4f6;
  border-radius: 20px;
  font-size: 12px;
  color: #374151;
}

.detail-pkg-meta {
  font-size: 13px;
  color: #374151;
  margin-bottom: 10px;
  font-weight: 500;
}

.detail-session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f3f4f6;
}

.detail-session-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
  flex-shrink: 0;
}

.detail-session-num.done {
  background: #16a34a;
  color: white;
}

.detail-session-num.sched {
  background: #3b82f6;
  color: white;
}

.detail-session-date {
  flex: 1;
  font-size: 13px;
  color: #374151;
}

.detail-session-status {
  font-size: 11px;
  color: #9ca3af;
}

.detail-session-status.done {
  color: #16a34a;
}

.detail-session-status.sched {
  color: #3b82f6;
}

.detail-no-pkg {
  padding: 12px 0;
  color: #9ca3af;
  font-size: 13px;
}

.detail-notes {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

/* ── Package modal ── */
.pkg-modal-box {
  background: white;
  border-radius: 10px;
  width: 460px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  -webkit-overflow-scrolling: touch;
}

.pkg-modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.pkg-modal-name {
  font-size: 16px;
  font-weight: 600;
}

.pkg-modal-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.pkg-modal-body {
  padding: 18px 20px;
}

.pkg-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  bottom: 0;
  background: white;
  gap: 8px;
}

.pkg-modal-footer-right {
  display: flex;
  gap: 8px;
}

.pkg-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

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

.pkg-field-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pkg-select {
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: #374151;
  -webkit-appearance: none;
  outline: none;
}

.pkg-date-input {
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: #374151;
  outline: none;
  width: 100%;
  cursor: pointer;
}

.sessions-label {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.session-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.session-item.is-used {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.session-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  flex-shrink: 0;
}

.session-item.is-used .session-num {
  background: #16a34a;
  color: white;
}

.session-date-input {
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: #374151;
  outline: none;
  width: 100%;
  cursor: pointer;
}

.session-used-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.session-used-check {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #16a34a;
  flex-shrink: 0;
}

.session-used-lbl {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}

.session-item.is-used .session-used-lbl {
  color: #15803d;
  font-weight: 500;
}

.new-pkg-panel {
  margin-bottom: 16px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 14px;
}

.new-pkg-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 6px;
}

.new-pkg-panel-note {
  font-size: 12px;
  color: #b45309;
  margin-bottom: 12px;
}

.new-pkg-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.new-pkg-actions {
  display: flex;
  gap: 8px;
}

.pkg-history-toggle {
  font-size: 12px;
  color: #9ca3af;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  padding: 2px 0;
}

.pkg-history-list {
  margin-top: 8px;
  display: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.pkg-history-list.open {
  display: block;
}

.pkg-history-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  gap: 8px;
}

.pkg-hist-del {
  border: none;
  background: none;
  color: #d1d5db;
  cursor: pointer;
  font-size: 14px;
  padding: 3px 6px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.pkg-hist-del:hover {
  color: #ef4444;
  background: #fef2f2;
}

.pkg-empty-state {
  text-align: center;
  padding: 24px 16px;
}

.pkg-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.pkg-empty-text {
  color: #9ca3af;
  font-size: 13px;
  margin-bottom: 16px;
}

.btn-primary-sm {
  padding: 8px 16px;
  background: #111827;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  touch-action: manipulation;
}

/* ── Schedule tab ── */
.schedule-day {
  margin-bottom: 28px;
}

.day-heading {
  font-size: 15px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 10px;
}

.session-block {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.session-time-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
  gap: 8px;
}

.session-time {
  font-weight: 600;
  font-size: 13px;
}

.session-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.session-count {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}

.btn-email-group {
  padding: 5px 10px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: white;
  font-size: 12px;
  color: #374151;
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
}

.athlete-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #f3f4f6;
  gap: 16px;
}

.athlete-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.athlete-name {
  font-weight: 500;
}

.athlete-sub {
  font-size: 12px;
  color: #6b7280;
}

.athlete-right {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
  flex-shrink: 0;
}

.athlete-parent {
  font-size: 13px;
  color: #374151;
}

.athlete-contact {
  font-size: 12px;
  color: #9ca3af;
}

/* ── Floating Settings Save Button ── */
.floating-save-bar {
  position: sticky;
  bottom: 24px;
  display: flex;
  justify-content: flex-end;
  padding: 10px 0;
  z-index: 50;
  max-width: 800px;
  pointer-events: none;
}

.btn-save-floating {
  pointer-events: auto;
  padding: 12px 24px;
  background: #111827;
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-save-floating:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  background: #374151;
}

.btn-save-floating:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── MOBILE RESPONSIVENESS FIXES ── */
@media (max-width: 600px) {
  .content {
    padding: 12px;
  }
  .tab-bar {
    padding: 8px 12px 0;
  }
  .header {
    padding: 0 12px;
  }
  /* Bigger touch targets on phones (Apple/Material recommend ~44px) */
  .tab-btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
  }
  .refresh-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-add {
    min-height: 40px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full {
    grid-column: span 1;
  }
  .athlete-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .athlete-right {
    text-align: left;
  }
  .session-time-bar {
    flex-wrap: wrap;
  }
  /* Toolbar: search takes its own row, filters/button share the next */
  .toolbar {
    gap: 6px;
  }
  .search-input {
    flex: 1 1 100%;
    width: 100%;
  }
  .count-text {
    order: 10;
    width: 100%;
    margin-left: 0;
  }
  .modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
  /* Keep primary actions together when the footer wraps */
  .modal-footer-right {
    margin-left: auto;
  }

  /* Package Modal specific fixes */
  .pkg-info-row {
    grid-template-columns: 1fr;
  }
  .new-pkg-row {
    grid-template-columns: 1fr;
  }
  /* Prevent date box from breaking out */
  .pkg-field {
    max-width: 100%;
    overflow: hidden;
  }
  .pkg-date-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  /* Fix session overlapping */
  .session-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
  }
  .session-num {
    flex-shrink: 0;
  }
  .session-date-input {
    flex: 1;
    min-width: 120px;
  }
  .session-used-wrap {
    width: 100%;
    justify-content: flex-end;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
  }
  .pkg-list-sessions {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── NARROW PHONES (iPhone SE / Mini, small Android) ── */
@media (max-width: 420px) {
  .content {
    padding: 10px;
  }
  .header {
    padding: 0 10px;
  }
  .tab-bar {
    padding: 6px 10px 0;
  }
  /* Settings cards: tighter padding */
  .settings-card {
    padding: 14px;
  }
  /* Modal: full-bleed on tiny screens */
  .modal-overlay {
    padding: 8px;
  }
  .modal-body,
  .pkg-modal-body {
    padding: 14px;
  }
  .modal-header,
  .pkg-modal-header {
    padding: 14px 14px 12px;
  }
  .modal-footer,
  .pkg-modal-footer {
    padding: 12px 14px;
  }
  /* Each filter chip its own row of the second toolbar line */
  .filter-select {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
}

/* ── Waitlist Specific Styles ── */
.badge-waiting {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.badge-notified {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.waitlist-target-group {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-top: 4px;
}

.waitlist-meta-text {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.wl-action-btn {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  font-weight: 500;
}

.wl-action-btn:hover {
  background: #f9fafb;
}

.wl-action-btn.notify-btn {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.wl-action-btn.notify-btn:hover {
  background: #dbeafe;
}

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
  max-width: calc(100% - 32px);
  align-items: center;
}

.toast {
  background: #111827;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  max-width: 100%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background: #16a34a; }
.toast.error   { background: #dc2626; }
.toast.info    { background: #2563eb; }

/* ── Segment chips (smart filters above the clients toolbar) ── */
.segments-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.segments-bar:empty {
  display: none;
}

/* ── Skeleton loaders ── */
.skeleton-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
}

.skeleton-line {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.skeleton-line-name { width: 42%; height: 16px; margin-bottom: 10px; }
.skeleton-line-meta { width: 62%; height: 11px; }
.skeleton-line-pkg  { width: 90px; height: 14px; margin-top: 14px; }

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.segment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: #374151;
  touch-action: manipulation;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.segment-chip:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.segment-chip.active {
  background: #111827;
  color: white;
  border-color: #111827;
}

.segment-chip .segment-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
}

.segment-chip.active .segment-count {
  background: rgba(255, 255, 255, 0.22);
  color: white;
}

/* Variant colors per segment for at-a-glance recognition */
.segment-chip.warn    { border-color: #fde68a; color: #92400e; background: #fffbeb; }
.segment-chip.warn .segment-count    { background: #fde68a; color: #92400e; }
.segment-chip.info    { border-color: #bfdbfe; color: #1d4ed8; background: #eff6ff; }
.segment-chip.info .segment-count    { background: #bfdbfe; color: #1d4ed8; }
.segment-chip.danger  { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.segment-chip.danger .segment-count  { background: #fecaca; color: #b91c1c; }
.segment-chip.success { border-color: #bbf7d0; color: #15803d; background: #f0fdf4; }
.segment-chip.success .segment-count { background: #bbf7d0; color: #15803d; }

.segment-chip.active.warn,
.segment-chip.active.info,
.segment-chip.active.danger,
.segment-chip.active.success {
  background: #111827;
  color: white;
  border-color: #111827;
}

/* ── Next-session line on client cards ── */
.cc-next {
  font-size: 11px;
  color: #2563eb;
  font-weight: 500;
  margin-top: 4px;
}

/* ── Detail modal Send Payment Link button ── */
.detail-action-btn {
  width: 100%;
  text-align: left;
  padding: 10px;
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.detail-action-meta {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
}

/* ── Slot-picker calendar popup ── */
.cal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-month-label {
  font-weight: 600;
  font-size: 15px;
  color: #111827;
}

.cal-weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
  gap: 4px;
}

.cal-weekday {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 0;
  text-transform: uppercase;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  min-height: 52px;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
  background: white;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #d1d5db;
  cursor: default;
  user-select: none;
}

.cal-day-empty {
  background: transparent;
  border: none;
}

.cal-day-tagged {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #15803d;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease;
}

.cal-day-tagged:hover {
  background: #bbf7d0;
}

.cal-day-selected {
  background: #111827;
  border-color: #111827;
  color: white;
}

.cal-day-selected:hover {
  background: #1f2937;
}

.cal-day-past {
  /* Past tagged days are still pickable (for logging older sessions) — just visually muted */
  opacity: 0.55;
}

.cal-day-today {
  outline: 2px solid #fbbf24;
  outline-offset: -2px;
}

.cal-day-num {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.cal-day-time {
  font-size: 10px;
  margin-top: 3px;
  line-height: 1;
  opacity: 0.85;
}

.cal-slot-picker {
  margin-top: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.cal-slot-picker-title {
  font-size: 12px;
  color: #374151;
  margin-bottom: 8px;
  font-weight: 600;
}

.cal-slot-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  margin-bottom: 6px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}

.cal-slot-option:last-child { margin-bottom: 0; }

.cal-slot-option:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.cal-empty-hint {
  text-align: center;
  padding: 20px 12px;
  color: #9ca3af;
  font-size: 13px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px dashed #e5e7eb;
  margin-top: 12px;
}

/* iOS-style date pill button — replaces the dropdown + emoji combo */
.ios-date-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: #111827;
  cursor: pointer;
  text-align: left;
  width: 100%;
  min-width: 0;
  font-weight: 500;
  touch-action: manipulation;
  transition: background 0.12s ease, border-color 0.12s ease;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.ios-date-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.ios-date-btn:active {
  background: #d1d5db;
}

.ios-date-btn:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.ios-date-btn .ios-cal-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #2563eb;
}

.ios-date-btn .ios-date-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  line-height: 1.25;
}

.ios-date-btn.no-date .ios-date-label {
  color: #9ca3af;
  font-weight: 400;
}

.ios-date-btn.is-past {
  background: #fef3c7;
  border-color: #fde68a;
}

.ios-date-btn.is-past:hover {
  background: #fde68a;
}

.session-slot-wrap {
  flex: 1;
  min-width: 0;
}

@media (max-width: 600px) {
  .session-slot-wrap {
    flex: 1;
    min-width: 120px;
  }
  .cal-day {
    min-height: 44px;
  }
  .cal-day-time {
    font-size: 9px;
  }
