/* ============================================================
   TerangaSanté Mobile Design System
   Native app look & feel - iOS/Android inspired
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --ts-primary: #0B5FDB;
  --ts-primary-light: #E8F0FE;
  --ts-primary-dark: #0747A6;
  --ts-accent: #00C9A7;
  --ts-accent-light: #E6FAF5;
  --ts-success: #10B981;
  --ts-success-light: #ECFDF5;
  --ts-danger: #EF4444;
  --ts-danger-light: #FEF2F2;
  --ts-warning: #F59E0B;
  --ts-warning-light: #FFFBEB;
  --ts-info: #3B82F6;
  --ts-info-light: #EFF6FF;
  --ts-purple: #8B5CF6;
  --ts-purple-light: #F3F0FF;

  --ts-bg: #F5F7FA;
  --ts-surface: #FFFFFF;
  --ts-surface-secondary: #F0F3F8;
  --ts-border: #E2EAF4;
  --ts-border-light: #F0F3F8;

  --ts-text: #1A2537;
  --ts-text-secondary: #6B7C93;
  --ts-text-muted: #94A3B8;
  --ts-text-inverse: #FFFFFF;

  --ts-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --ts-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --ts-shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --ts-shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

  --ts-radius-sm: 8px;
  --ts-radius: 12px;
  --ts-radius-md: 16px;
  --ts-radius-lg: 20px;
  --ts-radius-xl: 24px;
  --ts-radius-full: 100px;

  --ts-header-height: 56px;
  --ts-bottom-nav-height: 64px;
  --ts-safe-top: env(safe-area-inset-top, 0px);
  --ts-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ts-safe-left: env(safe-area-inset-left, 0px);
  --ts-safe-right: env(safe-area-inset-right, 0px);

  --ts-font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ts-font-mono: 'SF Mono', 'Fira Code', monospace;

  --ts-transition: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ts-transition-fast: 0.15s ease;
  --ts-transition-spring: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  width: 100%;
}

body {
  font-family: var(--ts-font);
  background: var(--ts-bg);
  color: var(--ts-text);
  line-height: 1.5;
  height: 100%;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(var(--ts-header-height) + var(--ts-safe-top));
  padding-bottom: calc(var(--ts-bottom-nav-height) + var(--ts-safe-bottom) + 16px);
}

body.no-bottom-nav {
  padding-bottom: 16px;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: var(--ts-primary); }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* ---------- App Header ---------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--ts-header-height) + var(--ts-safe-top));
  padding-top: var(--ts-safe-top);
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  padding-left: 16px;
  padding-right: 16px;
  z-index: 1000;
  transition: box-shadow var(--ts-transition);
}

.app-header.scrolled {
  box-shadow: 0 0.5px 0 rgba(0,0,0,0.08);
}

.app-header.header-primary {
  background: var(--ts-primary);
  border-bottom: none;
}

.app-header.header-primary .header-title,
.app-header.header-primary .header-action i {
  color: var(--ts-text-inverse);
}

.app-header.header-transparent {
  background: transparent;
  border-bottom: none;
}

.header-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--ts-text);
  font-size: 22px;
  cursor: pointer;
  border-radius: var(--ts-radius-sm);
  margin-right: 8px;
  flex-shrink: 0;
  transition: background var(--ts-transition-fast);
}

.header-back:active {
  background: var(--ts-surface-secondary);
}

.header-primary .header-back {
  color: var(--ts-text-inverse);
}

.header-primary .header-back:active {
  background: rgba(255,255,255,0.15);
}

.header-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: var(--ts-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-subtitle {
  font-size: 12px;
  color: var(--ts-text-secondary);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.header-action {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--ts-text);
  font-size: 20px;
  cursor: pointer;
  border-radius: var(--ts-radius-sm);
  position: relative;
  transition: background var(--ts-transition-fast);
}

.header-action:active {
  background: var(--ts-surface-secondary);
}

.header-action .badge-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  background: var(--ts-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--ts-surface);
}

.header-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--ts-primary);
  letter-spacing: -0.3px;
}

.header-logo span {
  color: var(--ts-accent);
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--ts-bottom-nav-height) + var(--ts-safe-bottom));
  padding-bottom: var(--ts-safe-bottom);
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  z-index: 1000;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  border: none;
  background: none;
  color: var(--ts-text-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color var(--ts-transition-fast);
  text-decoration: none;
  position: relative;
  flex: 1;
  min-width: 0;
}

.bottom-nav-item i {
  font-size: 24px;
  line-height: 1;
  transition: transform var(--ts-transition-spring);
}

.bottom-nav-item.active {
  color: var(--ts-primary);
  font-weight: 600;
}

.bottom-nav-item.active i {
  transform: scale(1.05);
}

.bottom-nav-item .nav-badge {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 6px;
  min-width: 16px;
  height: 16px;
  background: var(--ts-danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- Page Content ---------- */
.page-content {
  padding: 16px;
  min-height: calc(100vh - var(--ts-header-height) - var(--ts-bottom-nav-height));
}

.page-content.no-padding {
  padding: 0;
}

/* ---------- Section Headers ---------- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ts-text);
}

.section-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--ts-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Cards ---------- */
.ts-card {
  background: var(--ts-surface);
  border-radius: var(--ts-radius-md);
  border: 1px solid var(--ts-border-light);
  overflow: hidden;
  transition: box-shadow var(--ts-transition);
}

.ts-card.card-shadow {
  box-shadow: var(--ts-shadow-sm);
  border: none;
}

.ts-card.card-elevated {
  box-shadow: var(--ts-shadow);
  border: none;
}

.ts-card-body {
  padding: 16px;
}

.ts-card-header {
  padding: 16px 16px 0;
}

.ts-card-footer {
  padding: 0 16px 16px;
}

/* ---------- Stat Cards ---------- */
.stat-card {
  background: var(--ts-surface);
  border-radius: var(--ts-radius-md);
  padding: 16px;
  border: 1px solid var(--ts-border-light);
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--ts-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-card .stat-icon.icon-primary { background: var(--ts-primary-light); color: var(--ts-primary); }
.stat-card .stat-icon.icon-accent { background: var(--ts-accent-light); color: var(--ts-accent); }
.stat-card .stat-icon.icon-success { background: var(--ts-success-light); color: var(--ts-success); }
.stat-card .stat-icon.icon-danger { background: var(--ts-danger-light); color: var(--ts-danger); }
.stat-card .stat-icon.icon-warning { background: var(--ts-warning-light); color: var(--ts-warning); }
.stat-card .stat-icon.icon-purple { background: var(--ts-purple-light); color: var(--ts-purple); }

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--ts-text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--ts-text-secondary);
  font-weight: 500;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

/* ---------- List Items ---------- */
.ts-list {
  background: var(--ts-surface);
  border-radius: var(--ts-radius-md);
  border: 1px solid var(--ts-border-light);
  overflow: hidden;
}

.ts-list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--ts-border-light);
  cursor: pointer;
  transition: background var(--ts-transition-fast);
  text-decoration: none;
  color: inherit;
}

.ts-list-item:last-child {
  border-bottom: none;
}

.ts-list-item:active {
  background: var(--ts-surface-secondary);
}

.ts-list-item .item-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--ts-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ts-list-item .item-content {
  flex: 1;
  min-width: 0;
}

.ts-list-item .item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ts-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-list-item .item-subtitle {
  font-size: 13px;
  color: var(--ts-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.ts-list-item .item-meta .meta-value {
  font-size: 14px;
  font-weight: 600;
}

.ts-list-item .item-meta .meta-label {
  font-size: 11px;
  color: var(--ts-text-muted);
}

.ts-list-item .item-chevron {
  color: var(--ts-text-muted);
  font-size: 16px;
  flex-shrink: 0;
}

/* ---------- Avatar ---------- */
.ts-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--ts-primary);
}

.ts-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.ts-avatar.avatar-xs { width: 32px; height: 32px; font-size: 12px; }
.ts-avatar.avatar-sm { width: 38px; height: 38px; font-size: 14px; }
.ts-avatar.avatar-md { width: 48px; height: 48px; font-size: 18px; }
.ts-avatar.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.ts-avatar.avatar-xl { width: 88px; height: 88px; font-size: 32px; }

/* Avatar Colors */
.ts-avatar.bg-1 { background: #3B82F6; }
.ts-avatar.bg-2 { background: #10B981; }
.ts-avatar.bg-3 { background: #8B5CF6; }
.ts-avatar.bg-4 { background: #F59E0B; }
.ts-avatar.bg-5 { background: #EF4444; }
.ts-avatar.bg-6 { background: #EC4899; }
.ts-avatar.bg-7 { background: #06B6D4; }

/* ---------- Buttons ---------- */
.ts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--ts-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ts-transition);
  white-space: nowrap;
  line-height: 1.4;
}

.ts-btn:active {
  transform: scale(0.97);
}

.ts-btn-primary {
  background: var(--ts-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(11, 95, 219, 0.3);
}

.ts-btn-primary:active {
  background: var(--ts-primary-dark);
}

.ts-btn-accent {
  background: var(--ts-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 201, 167, 0.3);
}

.ts-btn-success {
  background: var(--ts-success);
  color: white;
}

.ts-btn-danger {
  background: var(--ts-danger);
  color: white;
}

.ts-btn-outline {
  background: transparent;
  color: var(--ts-primary);
  border: 1.5px solid var(--ts-primary);
}

.ts-btn-outline:active {
  background: var(--ts-primary-light);
}

.ts-btn-ghost {
  background: transparent;
  color: var(--ts-text-secondary);
}

.ts-btn-ghost:active {
  background: var(--ts-surface-secondary);
}

.ts-btn-light {
  background: var(--ts-surface-secondary);
  color: var(--ts-text);
}

.ts-btn-block {
  display: flex;
  width: 100%;
}

.ts-btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--ts-radius-sm);
}

.ts-btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: var(--ts-radius-md);
}

.ts-btn-round {
  border-radius: var(--ts-radius-full);
}

.ts-btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

.ts-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Badges ---------- */
.ts-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--ts-radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.ts-badge-primary { background: var(--ts-primary-light); color: var(--ts-primary); }
.ts-badge-accent { background: var(--ts-accent-light); color: #059669; }
.ts-badge-success { background: var(--ts-success-light); color: var(--ts-success); }
.ts-badge-danger { background: var(--ts-danger-light); color: var(--ts-danger); }
.ts-badge-warning { background: var(--ts-warning-light); color: #B45309; }
.ts-badge-info { background: var(--ts-info-light); color: var(--ts-info); }
.ts-badge-purple { background: var(--ts-purple-light); color: var(--ts-purple); }
.ts-badge-muted { background: var(--ts-surface-secondary); color: var(--ts-text-secondary); }

.ts-badge i { font-size: 12px; }

/* ---------- Forms ---------- */
.ts-form-group {
  margin-bottom: 20px;
}

.ts-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ts-text);
  margin-bottom: 8px;
}

.ts-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--ts-surface);
  border: 1.5px solid var(--ts-border);
  border-radius: var(--ts-radius);
  font-size: 16px;
  color: var(--ts-text);
  outline: none;
  transition: border-color var(--ts-transition), box-shadow var(--ts-transition);
  -webkit-appearance: none;
  appearance: none;
}

.ts-input:focus {
  border-color: var(--ts-primary);
  box-shadow: 0 0 0 3px rgba(11, 95, 219, 0.12);
}

.ts-input::placeholder {
  color: var(--ts-text-muted);
}

.ts-input.input-error {
  border-color: var(--ts-danger);
}

.ts-input.input-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.ts-input-icon {
  position: relative;
}

.ts-input-icon .ts-input {
  padding-left: 44px;
}

.ts-input-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ts-text-muted);
  font-size: 18px;
  pointer-events: none;
}

.ts-input-icon .input-action {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ts-text-muted);
  font-size: 18px;
  padding: 10px;
  cursor: pointer;
}

.ts-textarea {
  min-height: 100px;
  resize: vertical;
}

.ts-select {
  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='%236B7C93' d='M6 8.825c-.2 0-.4-.075-.55-.225l-3.5-3.5c-.3-.3-.3-.8 0-1.1s.8-.3 1.1 0L6 6.95 8.95 4c.3-.3.8-.3 1.1 0s.3.8 0 1.1l-3.5 3.5c-.15.15-.35.225-.55.225z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.ts-form-hint {
  font-size: 12px;
  color: var(--ts-text-muted);
  margin-top: 6px;
}

.ts-form-error {
  font-size: 12px;
  color: var(--ts-danger);
  margin-top: 6px;
}

.ts-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ts-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ts-border);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--ts-primary);
}

/* ---------- Alerts / Toasts ---------- */
.ts-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--ts-radius);
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.ts-alert i { font-size: 20px; flex-shrink: 0; margin-top: 1px; }

.ts-alert-success { background: var(--ts-success-light); color: #065F46; }
.ts-alert-success i { color: var(--ts-success); }
.ts-alert-danger { background: var(--ts-danger-light); color: #991B1B; }
.ts-alert-danger i { color: var(--ts-danger); }
.ts-alert-warning { background: var(--ts-warning-light); color: #92400E; }
.ts-alert-warning i { color: var(--ts-warning); }
.ts-alert-info { background: var(--ts-info-light); color: #1E40AF; }
.ts-alert-info i { color: var(--ts-info); }

/* ---------- Empty States ---------- */
.ts-empty {
  text-align: center;
  padding: 48px 24px;
}

.ts-empty .empty-icon {
  width: 80px;
  height: 80px;
  background: var(--ts-surface-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  color: var(--ts-text-muted);
}

.ts-empty .empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ts-text);
  margin-bottom: 8px;
}

.ts-empty .empty-text {
  font-size: 14px;
  color: var(--ts-text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ---------- Tabs ---------- */
.ts-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--ts-surface-secondary);
  border-radius: var(--ts-radius);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ts-tabs::-webkit-scrollbar { display: none; }

.ts-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--ts-text-secondary);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--ts-radius-sm);
  cursor: pointer;
  transition: all var(--ts-transition-fast);
  white-space: nowrap;
  text-align: center;
}

.ts-tab.active {
  background: var(--ts-surface);
  color: var(--ts-primary);
  box-shadow: var(--ts-shadow-sm);
}

/* ---------- Chips / Tags ---------- */
.ts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ts-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--ts-surface);
  border: 1.5px solid var(--ts-border);
  border-radius: var(--ts-radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--ts-text);
  cursor: pointer;
  transition: all var(--ts-transition-fast);
  white-space: nowrap;
}

.ts-chip:active,
.ts-chip.active {
  background: var(--ts-primary-light);
  border-color: var(--ts-primary);
  color: var(--ts-primary);
}

.ts-chip i { font-size: 14px; }

/* ---------- Appointment Card ---------- */
.rdv-card {
  background: var(--ts-surface);
  border-radius: var(--ts-radius-md);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--ts-border-light);
  display: block;
  color: inherit;
  text-decoration: none;
  transition: box-shadow var(--ts-transition);
}

.rdv-card:active {
  box-shadow: var(--ts-shadow-sm);
}

.rdv-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

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

.rdv-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ts-text);
  margin-bottom: 2px;
}

.rdv-card-spec {
  font-size: 13px;
  color: var(--ts-text-secondary);
}

.rdv-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--ts-text-secondary);
}

.rdv-card-details .detail-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rdv-card-details .detail-item i {
  font-size: 14px;
  color: var(--ts-primary);
}

.rdv-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ts-border-light);
}

/* ---------- Practitioner Card ---------- */
.praticien-card {
  background: var(--ts-surface);
  border-radius: var(--ts-radius-md);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--ts-border-light);
  display: block;
  text-decoration: none;
  color: inherit;
}

.praticien-card:active {
  box-shadow: var(--ts-shadow-sm);
}

.praticien-card-top {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

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

.praticien-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ts-text);
  margin-bottom: 3px;
  line-height: 1.3;
}

.praticien-card-specialty {
  font-size: 13px;
  color: var(--ts-primary);
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
}

.praticien-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.praticien-card-rating .stars {
  color: #F59E0B;
}

.praticien-card-rating .count {
  color: var(--ts-text-muted);
}

.praticien-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.praticien-card-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.praticien-card-price .price {
  font-size: 18px;
  font-weight: 800;
  color: var(--ts-primary);
}

.praticien-card-price .price-label {
  font-size: 12px;
  color: var(--ts-text-muted);
}

/* ---------- Messaging ---------- */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

.chat-bubble.sent {
  align-self: flex-end;
  background: var(--ts-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-bubble.received {
  align-self: flex-start;
  background: var(--ts-surface);
  color: var(--ts-text);
  border: 1px solid var(--ts-border-light);
  border-bottom-left-radius: 4px;
}

.chat-time {
  font-size: 11px;
  color: var(--ts-text-muted);
  margin-top: 4px;
}

.chat-time.sent { text-align: right; color: rgba(255,255,255,0.7); }

.chat-input-area {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 16px;
  padding-bottom: calc(8px + var(--ts-safe-bottom));
  background: var(--ts-surface);
  border-top: 1px solid var(--ts-border-light);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 999;
}

.chat-input-area .ts-input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--ts-radius-full);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ts-primary);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- Notification Item ---------- */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ts-border-light);
  cursor: pointer;
}

.notif-item.unread {
  background: var(--ts-primary-light);
}

.notif-item .notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.notif-item .notif-content {
  flex: 1;
  min-width: 0;
}

.notif-item .notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ts-text);
  margin-bottom: 2px;
}

.notif-item .notif-text {
  font-size: 13px;
  color: var(--ts-text-secondary);
  line-height: 1.4;
}

.notif-item .notif-time {
  font-size: 11px;
  color: var(--ts-text-muted);
  margin-top: 4px;
}

/* ---------- Search ---------- */
.search-bar {
  position: relative;
  margin-bottom: 16px;
}

.search-bar .ts-input {
  padding-left: 44px;
  padding-right: 44px;
  border-radius: var(--ts-radius-full);
  background: var(--ts-surface);
}

.search-bar .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ts-text-muted);
  font-size: 18px;
  pointer-events: none;
}

.search-bar .search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ts-surface-secondary);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ts-text-muted);
  font-size: 14px;
  cursor: pointer;
}

/* ---------- Hero / Welcome ---------- */
.welcome-hero {
  background: linear-gradient(135deg, var(--ts-primary) 0%, #0094FF 100%);
  border-radius: var(--ts-radius-lg);
  padding: 24px 20px;
  color: white;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.welcome-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.welcome-hero::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.welcome-hero .welcome-greeting {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.welcome-hero .welcome-name {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.welcome-hero .welcome-subtitle {
  font-size: 14px;
  opacity: 0.85;
  line-height: 1.5;
}

/* ---------- Quick Actions Grid ---------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--ts-surface);
  border-radius: var(--ts-radius-md);
  border: 1px solid var(--ts-border-light);
  text-decoration: none;
  color: inherit;
  transition: all var(--ts-transition-fast);
}

.quick-action:active {
  transform: scale(0.96);
  box-shadow: var(--ts-shadow-sm);
}

.quick-action .qa-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--ts-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.quick-action .qa-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ts-text-secondary);
  text-align: center;
  line-height: 1.3;
}

/* ---------- Horizontal Scroll ---------- */
.horizontal-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.horizontal-scroll::-webkit-scrollbar { display: none; }
.horizontal-scroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* ---------- Modal / Bottom Sheet ---------- */
.ts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--ts-transition);
}

.ts-overlay.show {
  opacity: 1;
  visibility: visible;
}

.ts-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ts-surface);
  border-radius: var(--ts-radius-xl) var(--ts-radius-xl) 0 0;
  padding: 8px 20px 20px;
  padding-bottom: calc(20px + var(--ts-safe-bottom));
  z-index: 2001;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.ts-bottom-sheet.show {
  transform: translateY(0);
}

.ts-bottom-sheet .sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--ts-border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.ts-bottom-sheet .sheet-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--ts-surface-secondary) 25%, #E8ECF2 50%, var(--ts-surface-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--ts-radius-sm);
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card { height: 120px; border-radius: var(--ts-radius-md); margin-bottom: 12px; }
.skeleton-btn { height: 48px; border-radius: var(--ts-radius); }

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

/* ---------- Filter Chips (RDV) ---------- */
.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--ts-surface);
  border: 1.5px solid var(--ts-border);
  border-radius: var(--ts-radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--ts-text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--ts-transition-fast);
}
.filter-chip.active {
  background: var(--ts-primary);
  border-color: var(--ts-primary);
  color: white;
}
.filter-chip i { font-size: 14px; }

/* ---------- RDV Detail Sheet ---------- */
.rdv-detail-header {
  text-align: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--ts-border-light);
}
.rdv-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.rdv-detail-row .detail-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--ts-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.rdv-detail-row .detail-label {
  font-size: 12px;
  color: var(--ts-text-muted);
}
.rdv-detail-row .detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ts-text);
}

/* ---------- Agenda Timeline ---------- */
.agenda-header-card {
  background: linear-gradient(135deg, var(--ts-primary) 0%, #0094FF 100%);
  border-radius: var(--ts-radius-lg);
  padding: 20px;
  color: white;
  margin-bottom: 16px;
}
.agenda-header-card .agenda-month {
  font-size: 20px;
  font-weight: 800;
  text-transform: capitalize;
}
.agenda-header-card .agenda-year {
  font-size: 14px;
  opacity: 0.8;
}
.agenda-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.agenda-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}
.agenda-timeline-item {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}
.agenda-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 50px;
  bottom: 0;
  width: 2px;
  background: var(--ts-border-light);
}
.agenda-time-col {
  width: 50px;
  text-align: center;
  flex-shrink: 0;
  padding-top: 12px;
}
.agenda-time-col .time-hour {
  font-size: 16px;
  font-weight: 800;
  color: var(--ts-primary);
}
.agenda-time-col .time-min {
  font-size: 11px;
  color: var(--ts-text-muted);
}
.agenda-event-card {
  flex: 1;
  background: var(--ts-surface);
  border-radius: var(--ts-radius);
  padding: 14px;
  border: 1px solid var(--ts-border-light);
  border-left: 3px solid var(--ts-primary);
  transition: box-shadow var(--ts-transition);
}
.agenda-event-card:active {
  box-shadow: var(--ts-shadow-sm);
}
.agenda-event-card.teleconsult {
  border-left-color: var(--ts-purple);
}
.agenda-event-card .event-patient {
  font-size: 15px;
  font-weight: 700;
  color: var(--ts-text);
  margin-bottom: 4px;
}
.agenda-event-card .event-type {
  font-size: 12px;
  color: var(--ts-text-secondary);
}
.agenda-event-card .event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* ---------- Selfie Verification ---------- */
.selfie-capture-area {
  position: relative;
  border: 2px dashed var(--ts-border);
  border-radius: var(--ts-radius-md);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--ts-transition);
  background: var(--ts-bg);
}
.selfie-capture-area:active {
  border-color: var(--ts-primary);
  background: var(--ts-primary-light);
}
.selfie-capture-area .capture-icon {
  font-size: 40px;
  color: var(--ts-text-muted);
  margin-bottom: 8px;
}
.selfie-capture-area .capture-text {
  font-size: 14px;
  color: var(--ts-text-secondary);
  font-weight: 500;
}
.selfie-capture-area .capture-hint {
  font-size: 12px;
  color: var(--ts-text-muted);
  margin-top: 4px;
}
.selfie-preview {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--ts-radius);
  margin-top: 12px;
  display: none;
}

/* ---------- Divider ---------- */
.ts-divider {
  height: 1px;
  background: var(--ts-border-light);
  margin: 16px 0;
}

.ts-divider-thick {
  height: 8px;
  background: var(--ts-bg);
  margin: 0 -16px;
}

/* ---------- Floating Action Button ---------- */
.ts-fab {
  position: fixed;
  bottom: calc(var(--ts-bottom-nav-height) + var(--ts-safe-bottom) + 16px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ts-primary);
  color: white;
  border: none;
  box-shadow: var(--ts-shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 500;
  transition: all var(--ts-transition-spring);
}

.ts-fab:active {
  transform: scale(0.9);
}

/* ---------- Rating Stars ---------- */
.ts-rating {
  display: flex;
  gap: 2px;
}

.ts-rating i {
  font-size: 14px;
  color: #D1D5DB;
}

.ts-rating i.filled {
  color: #F59E0B;
}

/* ---------- Progress / Stepper ---------- */
.ts-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  padding: 0 16px;
}

.ts-step {
  display: flex;
  align-items: center;
  gap: 0;
}

.ts-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid var(--ts-border);
  color: var(--ts-text-muted);
  background: var(--ts-surface);
  flex-shrink: 0;
}

.ts-step.active .ts-step-circle {
  border-color: var(--ts-primary);
  background: var(--ts-primary);
  color: white;
}

.ts-step.completed .ts-step-circle {
  border-color: var(--ts-success);
  background: var(--ts-success);
  color: white;
}

.ts-step-line {
  width: 40px;
  height: 2px;
  background: var(--ts-border);
  flex-shrink: 0;
}

.ts-step.completed + .ts-step .ts-step-line,
.ts-step.completed .ts-step-line {
  background: var(--ts-success);
}

/* ---------- Profile Header ---------- */
.profile-header {
  text-align: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, var(--ts-primary) 0%, #0094FF 100%);
  margin: -16px -16px 20px;
  color: white;
}

.profile-header .ts-avatar {
  margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,0.3);
}

.profile-header .profile-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-header .profile-email {
  font-size: 13px;
  opacity: 0.8;
}

/* ---------- Calendar ---------- */
.calendar-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 0;
  -webkit-overflow-scrolling: touch;
}

.calendar-strip::-webkit-scrollbar { display: none; }

.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--ts-radius);
  min-width: 50px;
  cursor: pointer;
  transition: all var(--ts-transition-fast);
  border: 1.5px solid transparent;
}

.calendar-day .day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ts-text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.calendar-day .day-number {
  font-size: 18px;
  font-weight: 700;
  color: var(--ts-text);
}

.calendar-day.active {
  background: var(--ts-primary);
  border-color: var(--ts-primary);
}

.calendar-day.active .day-name,
.calendar-day.active .day-number {
  color: white;
}

.calendar-day.today {
  border-color: var(--ts-primary);
}

.calendar-day.has-events .day-number::after {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ts-accent);
  margin: 4px auto 0;
}

/* ---------- Time Slots ---------- */
.time-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.time-slot {
  padding: 10px;
  text-align: center;
  border: 1.5px solid var(--ts-border);
  border-radius: var(--ts-radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ts-text);
  cursor: pointer;
  transition: all var(--ts-transition-fast);
  background: var(--ts-surface);
}

.time-slot:active,
.time-slot.selected {
  border-color: var(--ts-primary);
  background: var(--ts-primary-light);
  color: var(--ts-primary);
}

.time-slot.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- Toggle Switch ---------- */
.ts-toggle {
  position: relative;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.ts-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ts-toggle .toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--ts-border);
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--ts-transition);
}

.ts-toggle .toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform var(--ts-transition-spring);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.ts-toggle input:checked + .toggle-slider {
  background: var(--ts-primary);
}

.ts-toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* ---------- Spacers ---------- */
.spacer-xs { height: 8px; }
.spacer-sm { height: 12px; }
.spacer { height: 16px; }
.spacer-md { height: 20px; }
.spacer-lg { height: 32px; }

/* ---------- Text Utilities ---------- */
.text-primary { color: var(--ts-primary) !important; }
.text-accent { color: var(--ts-accent) !important; }
.text-success { color: var(--ts-success) !important; }
.text-danger { color: var(--ts-danger) !important; }
.text-warning { color: var(--ts-warning) !important; }
.text-muted { color: var(--ts-text-muted) !important; }
.text-secondary { color: var(--ts-text-secondary) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 18px; }
.text-bold { font-weight: 700; }
.text-semibold { font-weight: 600; }
.text-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Flex Utilities ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; min-width: 0; }

/* ---------- Spacing Utilities ---------- */
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.p-16 { padding: 16px; }

/* ---------- Width Utilities ---------- */
.w-full { width: 100%; }

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fadeInUp {
  animation: fadeInUp 0.4s ease-out both;
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out both;
}

.animate-delay-1 { animation-delay: 0.05s; }
.animate-delay-2 { animation-delay: 0.1s; }
.animate-delay-3 { animation-delay: 0.15s; }
.animate-delay-4 { animation-delay: 0.2s; }
.animate-delay-5 { animation-delay: 0.25s; }

/* ---------- Page Transitions ---------- */
.page-enter {
  animation: fadeInUp 0.3s ease-out;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(11, 95, 219, 0.2);
}

/* ---------- iOS / Capacitor Specific ---------- */
.ios-padding {
  padding-top: var(--ts-safe-top);
}

/* Prevent double-tap zoom */
* {
  touch-action: manipulation;
}

/* Prevent callout on long press */
img, a {
  -webkit-touch-callout: none;
}
