/* ========================================
   ORÉESKIN — Dashboard & Auth Styles
   ======================================== */

/* ========================================
   AUTH PAGES
   ======================================== */

.auth-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--off-white);
}

.auth-container {
  width: 100%;
  max-width: 500px;
}

.auth-card {
  background: var(--white);
  padding: 48px 40px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.06);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 400;
  color: var(--primary);
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 14px;
  color: var(--text-light);
}

.auth-btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  position: relative;
  min-height: 48px;
}

.auth-error {
  color: #e53935;
  font-size: 13px;
  margin-bottom: 8px;
  min-height: 20px;
}

.auth-success {
  color: #4caf50;
  font-size: 13px;
  margin-bottom: 8px;
  padding: 12px 16px;
  background: rgba(76,175,80,0.08);
  border: 1px solid rgba(76,175,80,0.2);
}

.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-light);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
}

.auth-divider {
  text-align: center;
  margin: 24px 0;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  background: var(--white);
  padding: 0 16px;
  position: relative;
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.auth-admin-link {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.5px;
}
.auth-admin-link:hover { color: var(--accent); }

/* ========================================
   FORM ELEMENTS (global for auth + dashboard)
   ======================================== */

.form-group {
  margin-bottom: 22px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 8px;
  transition: var(--transition);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.5;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-light);
  opacity: 0.5;
  font-weight: 300;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181,160,142,0.08);
}

.form-group:focus-within label {
  color: var(--accent-dark);
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a8a8a' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 10px;
  padding-right: 40px;
  cursor: pointer;
}

.form-group select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23b5a08e' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
}

.form-group input:disabled,
.form-group select:disabled {
  background: var(--grey-100);
  color: var(--text-light);
  cursor: not-allowed;
  border-color: var(--grey-200);
}

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

.form-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 6px;
}

/* Checkbox & Radio */
.form-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--text);
  margin-bottom: 4px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  width: 18px !important;
  height: 18px !important;
  padding: 0 !important;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.form-check input[type="radio"] {
  border-radius: 50%;
}

.auth-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(76,175,80,0.1);
  color: #4caf50;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================
   DASHBOARD LAYOUT
   ======================================== */

.dash-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 0;
  padding-top: env(safe-area-inset-top, 0px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.admin-nav {
  background: #4d4e53;
  border-bottom: none;
}

.admin-nav .logo-text { color: var(--white); }
.admin-nav .logo-sub { color: var(--accent); }

.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dash-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.admin-nav .dash-user-name { color: #fff; }

.dash-link {
  font-size: 12px;
  color: #1a1a1a;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.dash-link:hover { color: var(--accent); }

.admin-nav .dash-link { color: #fff; font-weight: 600; }
.admin-nav .dash-link:hover { color: var(--accent); }

.dash-layout {
  display: flex;
  min-height: calc(100vh - 70px);
}

/* Sidebar */
.dash-sidebar {
  width: 260px;
  background: var(--primary);
  border-right: 1px solid rgba(255,255,255,0.1);
  padding: 30px 0;
  flex-shrink: 0;
}

.admin-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
}

.dash-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.dash-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  border-radius: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
}

.dash-menu a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.dash-menu a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.admin-sidebar .dash-menu a {
  color: var(--text-light);
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}

.admin-sidebar .dash-menu a:hover {
  background: var(--off-white);
  color: var(--primary);
}

.admin-sidebar .dash-menu a.active {
  background: rgba(174,138,121,0.1);
  color: var(--accent);
}

/* Main */
.dash-main {
  flex: 1;
  padding: 40px;
  background: var(--off-white);
  overflow-y: auto;
}

.dash-tab {
  display: none;
}

.dash-tab.active {
  display: block;
}

.dash-header {
  margin-bottom: 32px;
}

.dash-header h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 4px;
}

.dash-header p {
  font-size: 14px;
  color: var(--text-light);
}

.dash-header-actions {
  margin-top: 16px;
}

/* Stats Row */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.dash-stats-row.four-cols {
  grid-template-columns: repeat(4, 1fr);
}

.dash-stat-card {
  background: var(--white);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.dash-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1;
}

.dash-stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  display: block;
}

/* Sections */
.dash-section {
  margin-bottom: 40px;
}

.dash-section h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 16px;
}

.dash-empty {
  color: var(--text-light);
  font-size: 14px;
  padding: 24px;
  text-align: center;
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.dash-empty a { color: var(--accent); font-weight: 600; }

/* Appointment Cards */
.dash-appointments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.appointment-card {
  background: var(--white);
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.appointment-card:hover {
  border-color: var(--accent);
}

.appointment-card.admin-appointment {
  padding: 20px 24px;
  align-items: flex-start;
  gap: 20px;
}

.appointment-card.admin-appointment .appointment-date {
  width: 64px;
  height: 64px;
}

.appointment-card.admin-appointment .appointment-day {
  font-size: 26px;
}

.appointment-card.admin-appointment .appointment-month {
  font-size: 11px;
}

.appointment-card.admin-appointment .appointment-info h4 {
  font-size: 16px;
  margin-bottom: 4px;
}

.appointment-card.admin-appointment .appointment-info p {
  font-size: 13px;
  margin-bottom: 2px;
}

.rdv-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.rdv-reminder-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.appointment-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.appointment-card.admin-appointment .appointment-left {
  align-items: flex-start;
}

.appointment-date {
  width: 56px;
  height: 56px;
  background: var(--off-white);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.appointment-day {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1;
}

.appointment-month {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}

.appointment-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.appointment-info p {
  font-size: 12px;
  color: var(--text-light);
  margin: 0;
}

.appointment-notes {
  font-style: italic;
  opacity: 0.8;
}

.appointment-admin-notes {
  color: var(--accent) !important;
  font-weight: 500;
}

.appointment-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Status Badges */
.status-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.status-pending {
  background: rgba(255,152,0,0.1);
  color: #ff9800;
}

.status-confirmed {
  background: rgba(33,150,243,0.1);
  color: #2196f3;
}

.status-completed {
  background: rgba(76,175,80,0.1);
  color: #4caf50;
}

.status-cancelled {
  background: rgba(244,67,54,0.1);
  color: #f44336;
}

.btn-cancel {
  font-size: 11px;
  color: #f44336;
  background: none;
  border: 1px solid rgba(244,67,54,0.3);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: var(--transition);
}

.btn-cancel:hover {
  background: #f44336;
  color: var(--white);
}

/* Form card */
.dash-form-card {
  background: var(--white);
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 700px;
}

/* ========================================
   ADMIN SPECIFIC
   ======================================== */

.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-action {
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-confirm {
  background: rgba(76,175,80,0.1);
  color: #4caf50;
}
.btn-confirm:hover { background: #4caf50; color: white; }

.btn-reject {
  background: rgba(244,67,54,0.1);
  color: #f44336;
}
.btn-reject:hover { background: #f44336; color: white; }

.btn-complete {
  background: rgba(33,150,243,0.1);
  color: #2196f3;
}
.btn-complete:hover { background: #2196f3; color: white; }

.btn-note {
  background: rgba(181,160,142,0.1);
  color: var(--accent);
}
.btn-note:hover { background: var(--accent); color: white; }

.admin-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-search {
  margin-bottom: 24px;
}

.admin-search input {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 14px;
  border-radius: 8px;
  background: var(--white);
  transition: var(--transition);
}

.admin-search input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Admin Table */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  border-collapse: collapse;
  overflow: hidden;
}

.admin-table thead {
  background: var(--off-white);
}

.admin-table th {
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(181,160,142,0.03);
}

/* Planning Grid */
.planning-grid {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.planning-header {
  display: grid;
  grid-template-columns: 70px repeat(7, 1fr);
  border-bottom: 2px solid var(--border);
}

.planning-time-col {
  padding: 12px;
  background: var(--off-white);
}

.planning-day-col {
  padding: 12px;
  text-align: center;
  background: var(--off-white);
  border-left: 1px solid var(--border);
}

.planning-day-col.today {
  background: rgba(181,160,142,0.1);
}

.planning-day-name {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}

.planning-day-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--primary);
}

.planning-day-col.today .planning-day-num {
  color: var(--accent);
}

.planning-body {
  max-height: 600px;
  overflow-y: auto;
}

.planning-row {
  display: grid;
  grid-template-columns: 70px repeat(7, 1fr);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.planning-time {
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-light);
  background: var(--off-white);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  border-right: 1px solid var(--border);
  height: 40px;
  box-sizing: border-box;
}

.planning-cell {
  min-height: 40px;
  height: 40px;
  border-left: 1px solid rgba(0,0,0,0.04);
  padding: 0 2px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.planning-cell:hover {
  background: rgba(181,160,142,0.08);
}

.planning-row {
  min-height: 40px;
}

.planning-event {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.3;
  cursor: pointer;
  transition: opacity 0.15s;
  position: absolute;
  top: 1px;
  left: 2px;
  right: 2px;
  z-index: 3;
  overflow: hidden;
  box-sizing: border-box;
}

.planning-event:hover {
  opacity: 0.8;
}

.planning-event.pending {
  background: rgba(255,152,0,0.1);
  border-left: 3px solid #ff9800;
  color: #e65100;
}

.planning-event.confirmed {
  background: rgba(33,150,243,0.1);
  border-left: 3px solid #2196f3;
  color: #0d47a1;
}

.planning-event.completed {
  background: rgba(76,175,80,0.1);
  border-left: 3px solid #4caf50;
  color: #1b5e20;
}

.planning-event strong {
  display: block;
  font-weight: 600;
}

.planning-event small {
  display: block;
  opacity: 0.7;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-card {
  background: var(--white);
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  overflow: hidden;
}

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

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 500;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
}
.modal-close:hover { color: var(--primary); }

.modal-body {
  padding: 24px;
}

/* ========================================
   RESPONSIVE DASHBOARD
   ======================================== */

@media (max-width: 1024px) {
  .dash-stats-row.four-cols {
    grid-template-columns: repeat(2, 1fr);
  }

  .client-panel { grid-template-columns: 1fr; }
  .routine-columns { gap: 20px; }
  .photo-gallery { grid-template-columns: repeat(3, 1fr); }
  .bilans-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .rewards-grid { grid-template-columns: repeat(2, 1fr); }
  .conversation-item__preview { max-width: 160px; }
}

@media (max-width: 768px) {
  /* ── Layout ── */
  .dash-layout {
    flex-direction: column;
  }

  .dash-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 8px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dash-menu {
    flex-direction: row;
    gap: 2px;
    padding: 0 8px;
    min-width: max-content;
  }

  .dash-menu a {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 11px;
    gap: 6px;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.08);
  }

  .dash-menu a:last-child {
    border-right: none;
  }

  .dash-menu a svg {
    width: 14px;
    height: 14px;
  }

  .dash-main {
    padding: 20px 14px;
  }

  /* ── Nav ── */
  .dash-nav .container {
    height: 56px;
    padding: 0 12px;
  }

  .dash-nav-right {
    gap: 8px;
  }

  .dash-nav-right .btn {
    padding: 6px 12px;
    font-size: 9px;
  }

  .dash-user-name { display: none; }

  .dash-link {
    font-size: 10px;
  }

  /* ── Header ── */
  .dash-header {
    margin-bottom: 20px;
  }

  .dash-header h1 {
    font-size: 22px;
  }

  .dash-header p {
    font-size: 12px;
  }

  /* ── Stats ── */
  .dash-stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 24px;
  }

  .dash-stats-row.four-cols {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .dash-stat-card {
    padding: 14px 12px;
    gap: 10px;
  }

  .dash-stat-num {
    font-size: 22px;
  }

  .dash-stat-label {
    font-size: 10px;
  }

  .dash-stat-icon {
    width: 36px;
    height: 36px;
  }

  .dash-stat-icon svg {
    width: 18px;
    height: 18px;
  }

  /* ── Appointments ── */
  .appointment-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
    gap: 8px;
  }

  .appointment-left {
    gap: 10px;
  }

  .appointment-date {
    width: 44px;
    height: 44px;
  }

  .appointment-day {
    font-size: 18px;
  }

  .appointment-month {
    font-size: 8px;
  }

  .appointment-info h4 {
    font-size: 13px;
  }

  .appointment-info p {
    font-size: 11px;
  }

  .appointment-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  /* ── Sections ── */
  .dash-section {
    margin-bottom: 24px;
  }

  .dash-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .dash-empty {
    padding: 16px;
    font-size: 13px;
  }

  /* ── Forms ── */
  .dash-form-card {
    padding: 20px 14px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 12px 14px;
    font-size: 13px;
  }

  .form-group label {
    font-size: 10px;
    letter-spacing: 1px;
  }

  .auth-card {
    padding: 24px 16px;
  }

  /* ── Admin specific ── */
  .admin-filters {
    gap: 4px;
  }

  .admin-filters .btn {
    padding: 6px 10px;
    font-size: 9px;
    letter-spacing: 0.5px;
  }

  .admin-actions {
    gap: 4px;
  }

  .btn-action {
    font-size: 11px;
    padding: 6px 10px;
  }

  .admin-search input {
    max-width: 100%;
    padding: 10px 12px;
    font-size: 13px;
  }

  /* ── Admin table ── */
  .admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -14px;
    padding: 0 14px;
  }

  .admin-table {
    font-size: 12px;
    min-width: 500px;
  }

  .admin-table th {
    padding: 10px 12px;
    font-size: 9px;
    letter-spacing: 0.5px;
  }

  .admin-table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  /* ── Planning ── */
  .planning-grid {
    overflow: hidden;
    margin: 0;
  }

  .planning-header,
  .planning-row {
    min-width: 0;
  }

  .planning-time {
    padding: 6px 4px;
    font-size: 10px;
  }

  .planning-day-name {
    font-size: 10px;
  }

  .planning-day-num {
    font-size: 20px;
  }

  .planning-day-col {
    padding: 10px 4px;
  }

  .planning-event {
    font-size: 10px;
    padding: 3px 5px;
  }

  .planning-cell {
    min-height: 40px;
  }

  /* Slider nav */
  .planning-slider-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--off-white);
    border-bottom: 1px solid var(--border);
  }
  .planning-slider-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
  }
  .btn-slider {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 16px;
    cursor: pointer;
    color: var(--primary);
    transition: var(--transition);
  }
  .btn-slider:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
  }
  .btn-slider:disabled {
    opacity: 0.3;
    cursor: default;
  }

  /* ── Modals ── */
  .modal-overlay {
    padding: 10px;
    align-items: flex-start;
    padding-top: 5vh;
  }

  .modal-card {
    max-width: 100% !important;
    max-height: 85vh !important;
    border-radius: 10px;
    overflow-y: auto;
  }

  .modal-header {
    padding: 14px 16px;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 2;
  }

  .modal-header h3 {
    font-size: 17px;
  }

  .modal-body {
    padding: 14px 16px;
  }

  /* ── Bilans ── */
  .bilans-grid { grid-template-columns: 1fr; }
  .bilan-card { padding: 16px; }
  .bilan-card__date { font-size: 11px; }
  .bilan-card__content h4 { font-size: 14px; }
  .bilan-card__content p { font-size: 12px; }
  .bilan-card__thumbs img { width: 48px; height: 48px; }
  .bilan-detail-section h4 { font-size: 16px; }
  .bilan-detail-section p { font-size: 13px; }
  .bilan-form-section { padding-bottom: 16px; margin-bottom: 16px; }
  .bilan-form-section h3 { font-size: 17px; }

  /* ── Client panel ── */
  .client-panel { grid-template-columns: 1fr; }

  /* ── Routine ── */
  .routine-columns { grid-template-columns: 1fr; }
  .routine-title { font-size: 18px; }

  /* ── Documents ── */
  .document-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }

  .document-card .document-icon {
    display: none;
  }

  .document-info h4 {
    font-size: 13px;
  }

  /* ── Chat ── */
  .chat-container { height: 380px; }
  .chat-bubble { max-width: 88%; font-size: 13px; padding: 10px 14px; }
  .chat-input { padding: 10px; }
  .chat-input textarea { font-size: 13px; padding: 8px 12px; }
  .chat-input-row { gap: 6px; }

  /* ── Messagerie Admin Mobile ── */
  .msg-layout {
    grid-template-columns: 1fr !important;
    height: auto;
    min-height: 500px;
  }
  .msg-conv-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 500px;
  }
  .msg-layout.chat-open .msg-conv-list {
    display: none;
  }
  .msg-layout.chat-open .msg-chat-area {
    display: flex;
    height: 500px;
  }
  .msg-layout:not(.chat-open) .msg-chat-area {
    display: none;
  }
  .msg-chat-header {
    display: none;
  }
  .msg-layout.chat-open .msg-chat-header {
    display: flex !important;
  }

  /* ── Points / Loyalty ── */
  .points-display { padding: 24px 16px; }
  .points-display__number { font-size: 48px; }
  .referral-box { flex-direction: column; text-align: center; gap: 10px; }
  .referral-code { font-size: 18px; }
  .rewards-grid { grid-template-columns: 1fr; }
  .reward-card { padding: 16px; }
  .reward-cost { font-size: 22px; }
  .points-row { padding: 10px 12px; font-size: 12px; gap: 8px; }
  .points-row__date { width: 60px; font-size: 11px; }

  /* ── Photo ── */
  .photo-gallery { grid-template-columns: repeat(2, 1fr); }
  .photo-dropzone { padding: 20px 14px; }
  .photo-preview-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }

  /* ── QCM / Contra ── */
  .contra-checklist { grid-template-columns: 1fr; }
  .qcm-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .form-check { font-size: 12px !important; }

  /* ── Product/routine slots — mobile ── */
  .product-slot {
    flex-direction: column;
    align-items: stretch;
    padding: 14px !important;
    margin-bottom: 10px !important;
    border-radius: 8px !important;
  }
  .product-slot .rs-name,
  .product-slot .rs-time {
    font-size: 13px !important;
    padding: 10px 12px !important;
    min-width: 0 !important;
    width: 100% !important;
    flex: unset !important;
  }
  .product-slot .rs-product-search {
    font-size: 15px !important;
    padding: 12px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
  }
  .product-slot > div[style*="position:relative"] {
    width: 100% !important;
    margin: 0 -14px !important;
    padding: 0 14px !important;
    box-sizing: content-box !important;
  }
  .product-slot .rs-note {
    font-size: 13px !important;
    padding: 10px 12px !important;
  }
  .product-slot .rs-product-pill {
    padding: 4px 10px !important;
    font-size: 12px !important;
  }

  /* ── Timeline ── */
  .timeline { padding-left: 28px; }
  .timeline-item::before { left: -21px; width: 10px; height: 10px; }
  .timeline-content { padding: 12px; }
  .timeline-content h4 { font-size: 13px; }
  .timeline-content p { font-size: 12px; }
  .timeline-date { font-size: 11px; }

  /* ── Quick actions ── */
  .dash-quick-actions {
    gap: 6px;
    flex-direction: column;
  }
  .dash-quick-actions .btn {
    font-size: 11px;
    padding: 10px 16px;
    width: 100%;
    justify-content: center;
  }

  /* ── Conversations ── */
  .conversation-list { max-height: none; }
  .conversation-item { padding: 12px 14px; }
  .conversation-item__name { font-size: 13px; }
  .conversation-item__preview { max-width: 200px; font-size: 12px; }

  /* ── Objectives ── */
  .objective-card { padding: 14px; }
  .objective-header h4 { font-size: 14px; }

  /* ── Autocomplete ── */
  .autocomplete-dropdown {
    max-height: 150px !important;
  }
}

@media (max-width: 480px) {
  .dash-main {
    padding: 14px 10px;
  }

  .dash-header h1 {
    font-size: 20px;
  }

  .dash-header p {
    font-size: 11px;
  }

  .dash-menu a {
    padding: 6px 8px;
    font-size: 10px;
    gap: 4px;
  }

  .dash-menu a svg {
    width: 12px;
    height: 12px;
  }

  .dash-stat-card {
    padding: 10px 8px;
    gap: 8px;
  }

  .dash-stat-num {
    font-size: 18px;
  }

  .dash-stat-label {
    font-size: 9px;
  }

  .dash-stat-icon {
    width: 32px;
    height: 32px;
  }

  .appointment-card {
    padding: 12px;
  }

  .appointment-date {
    width: 38px;
    height: 38px;
  }

  .appointment-day {
    font-size: 16px;
  }

  .modal-header h3 {
    font-size: 15px;
  }

  .modal-body {
    padding: 12px;
  }

  .admin-table {
    min-width: 450px;
  }

  .planning-header,
  .planning-row {
    min-width: 0;
  }

  .btn-action {
    font-size: 10px;
    padding: 5px 8px;
  }

  .bilan-form-section h3 {
    font-size: 15px;
  }

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

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px 12px;
    font-size: 13px;
  }

  .chat-container {
    height: 320px;
  }

  .points-display__number {
    font-size: 36px;
  }

  .document-card {
    padding: 10px 12px;
  }

  .product-card {
    padding: 10px;
    gap: 10px;
  }
  .product-card__step { width: 26px; height: 26px; font-size: 10px; }
  .product-card__photo { width: 36px; height: 36px; }
}

/* ========================================
   NEW COMPONENTS V2
   ======================================== */

/* Alert Box */
.alert-box {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.5;
}
.alert-warning {
  background: rgba(255,152,0,0.08);
  border: 1px solid rgba(255,152,0,0.2);
  color: #e65100;
}

/* Quick Actions */
.dash-quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

/* Bilan Cards */
.bilans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.bilan-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bilan-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.bilan-card__date { font-size: 12px; color: var(--accent-dark); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.bilan-card__thumbs { display: flex; gap: 6px; }
.bilan-card__thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.bilan-card__content h4 { font-size: 15px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.bilan-card__content p { font-size: 13px; color: var(--text-light); line-height: 1.5; }

/* Bilan Detail Sections */
.bilan-detail-section { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.bilan-detail-section:last-of-type { border-bottom: none; }
.bilan-detail-section h4 { font-family: var(--font-heading); font-size: 18px; font-weight: 500; color: var(--primary); margin-bottom: 8px; }
.bilan-detail-section p { font-size: 14px; line-height: 1.7; color: var(--text); }
.routine-item { padding: 8px 0; border-bottom: 1px solid var(--grey-100, #f5f5f5); font-size: 14px; }
.routine-item:last-child { border-bottom: none; }

/* Photo Gallery */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.photo-gallery__item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}
.photo-gallery__item:hover { transform: scale(1.02); }
.photo-gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.photo-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 10px; background: linear-gradient(transparent, rgba(0,0,0,0.6)); display: flex; justify-content: space-between; align-items: center; }
.photo-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: white; background: rgba(0,0,0,0.4); padding: 2px 8px; border-radius: 3px; }
.photo-date { font-size: 10px; color: rgba(255,255,255,0.8); }

/* Lightbox */
.lightbox-content { display: flex; align-items: center; justify-content: center; position: relative; }

/* Routine Columns */
.routine-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.routine-col { }
.routine-title { font-family: var(--font-heading); font-size: 22px; font-weight: 500; color: var(--primary); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--accent); }
.product-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  transition: var(--transition);
}
.product-card:hover { border-color: var(--accent); }
.product-card__step { width: 32px; height: 32px; background: var(--accent); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.product-card__info { flex: 1; }
.product-card__info h4 { font-size: 14px; font-weight: 600; color: var(--primary); }
.product-card__photo { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; }

/* Timeline */
.timeline { position: relative; padding-left: 40px; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 28px; }
.timeline-item::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); position: absolute; left: -33px; top: 4px; border: 2px solid var(--white); }
.timeline-date { font-size: 12px; color: var(--accent-dark); font-weight: 600; letter-spacing: 0.5px; margin-bottom: 4px; }
.timeline-content { background: var(--white); padding: 16px; border: 1px solid var(--border); border-radius: 8px; }
.timeline-content h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.timeline-content p { font-size: 13px; color: var(--text-light); }

/* Re-book button */
.btn-rebook {
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--accent-dark);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 20px;
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.btn-rebook:hover {
  background: var(--accent);
  color: var(--white);
}

/* Objectives / Progress */
.objective-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 12px; }
.objective-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.objective-header h4 { font-size: 15px; font-weight: 600; }
.progress-bar { background: var(--grey-200, #e5e5e5); height: 8px; border-radius: 4px; overflow: hidden; margin: 12px 0 6px; }
.progress-bar__fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.6s ease; }

/* Documents */
.documents-list { display: flex; flex-direction: column; gap: 10px; }
.document-card { display: flex; align-items: center; gap: 16px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 16px 20px; transition: var(--transition); }
.document-card:hover { border-color: var(--accent); }
.document-icon { color: var(--accent); flex-shrink: 0; }
.document-info { flex: 1; }
.document-info h4 { font-size: 14px; font-weight: 600; }

/* Messagerie Layout */
.msg-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 520px;
  background: var(--white);
}
.msg-conv-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.msg-chat-area {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.msg-chat-header {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--off-white);
  font-weight: 600;
  font-size: 14px;
}
.msg-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
  padding: 4px;
  display: flex;
  align-items: center;
}
.msg-chat-area .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Chat / Messagerie */
.chat-container { display: flex; flex-direction: column; height: 500px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.chat-bubble { max-width: 75%; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.chat-bubble--sent { background: var(--primary); color: var(--white); align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-bubble--received { background: var(--grey-100, #f5f5f5); color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-bubble__time { font-size: 10px; opacity: 0.6; margin-top: 4px; }
.chat-input { padding: 16px; border-top: 1px solid var(--border); }
.chat-input-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-input textarea { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-family: var(--font-body); font-size: 13px; resize: none; max-height: 80px; }
.chat-input textarea:focus { outline: none; border-color: var(--accent); }
.chat-input .btn { flex-shrink: 0; }
.btn-attach { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px; cursor: pointer; color: var(--text-light); transition: var(--transition); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.btn-attach:hover { border-color: var(--accent); color: var(--accent); }

/* Points / Loyalty */
.points-display { text-align: center; padding: 40px 20px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 32px; }
.points-display__number { font-family: var(--font-heading); font-size: 64px; font-weight: 600; color: var(--accent); line-height: 1; }
.points-display__label { font-size: 14px; color: var(--text-light); margin-top: 8px; text-transform: uppercase; letter-spacing: 1px; }

.referral-box { display: flex; align-items: center; gap: 16px; background: var(--off-white); padding: 16px 20px; border-radius: 8px; }
.referral-code { font-family: monospace; font-size: 20px; font-weight: 700; letter-spacing: 3px; color: var(--primary); }

.rewards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.reward-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; text-align: center; }
.reward-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.reward-cost { font-family: var(--font-heading); font-size: 28px; font-weight: 600; color: var(--accent); margin: 12px 0; }

.points-table { background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.points-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--grey-100, #f5f5f5); font-size: 13px; }
.points-row:last-child { border-bottom: none; }
.points-row__date { color: var(--text-light); width: 70px; flex-shrink: 0; }
.points-row__reason { flex: 1; }
.points-row__amount { font-weight: 700; flex-shrink: 0; }
.points-row__amount.positive { color: #4caf50; }
.points-row__amount.negative { color: #f44336; }

.referral-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grey-100, #f5f5f5); font-size: 13px; }

/* Badge (notification count) */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; border-radius: 9px; background: #e53935; color: white; font-size: 10px; font-weight: 700; padding: 0 5px; margin-left: 6px; }

/* Text helpers */
.text-light { color: var(--text-light); }
.text-accent { color: var(--accent); font-weight: 600; }

/* Bilan form (admin) */
.bilan-form-section { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.bilan-form-section:last-child { border-bottom: none; }
.bilan-form-section h3 { font-family: var(--font-heading); font-size: 20px; font-weight: 500; margin-bottom: 16px; }

.photo-dropzone { border: 2px dashed var(--border); padding: 40px; text-align: center; cursor: pointer; border-radius: 8px; transition: var(--transition); color: var(--text-light); }
.photo-dropzone:hover { border-color: var(--accent); color: var(--accent); }
.photo-dropzone.dragover { border-color: var(--accent); background: rgba(181,160,142,0.05); }

.photo-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 12px; }
.photo-preview-item { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; }
.photo-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview-item .remove-photo { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; background: rgba(0,0,0,0.6); color: white; border: none; border-radius: 50%; cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; }

.contra-checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.qcm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.product-slot { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.product-slot select { flex: 1; }

/* Upcoming RDV slider */
#upcomingSlider::-webkit-scrollbar { height: 4px; }
#upcomingSlider::-webkit-scrollbar-track { background: transparent; }
#upcomingSlider::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
#upcomingSlider .appointment-card.admin-appointment { margin-bottom: 0; }

/* Autocomplete dropdown */
.autocomplete-dropdown .autocomplete-item:hover { background: var(--off-white); }
.autocomplete-dropdown .autocomplete-item:last-child { border-bottom: none; }

/* Client Panel (admin) */
.client-panel { display: grid; grid-template-columns: 300px 1fr; gap: 32px; }
.client-panel__sidebar { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 24px; }
.client-panel__content { }

/* Admin conversation list */
.conversation-list { display: flex; flex-direction: column; gap: 4px; max-height: 500px; overflow-y: auto; }
.conversation-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; cursor: pointer; transition: var(--transition); }
.conversation-item:hover, .conversation-item.active { background: var(--off-white); }
.conversation-item__name { font-weight: 600; font-size: 13px; }
.conversation-item__preview { font-size: 12px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.conversation-item .badge { flex-shrink: 0; }

/* ========================================
   MOBILE FIXES FOR INLINE STYLES
   ======================================== */

@media (max-width: 768px) {
  /* Fix inline grid-template-columns: repeat(4,1fr) in client profile modal */
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* Fix inline flex-wrap gaps in modals */
  [style*="display:flex"][style*="gap:20px"] {
    gap: 12px !important;
  }

  /* Fix admin header buttons wrapping */
  .dash-header [style*="display:flex"] {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  /* Fix planning header buttons */
  .dash-header .btn-sm {
    padding: 6px 10px !important;
    font-size: 10px !important;
  }

  /* Fix bilan/rdv form inline flex rows */
  [style*="display:flex;gap:8px;align-items:center"] {
    flex-wrap: wrap !important;
  }

  /* Fix inline max-width modals */
  [style*="max-width:700px"],
  [style*="max-width:800px"],
  [style*="max-width:600px"],
  [style*="max-width:500px"] {
    max-width: 100% !important;
  }

  /* Fix inline font sizes that are too large on mobile */
  [style*="font-size:22px;font-weight:700"] {
    font-size: 18px !important;
  }

  /* Fix profile modal header avatar */
  [style*="width:60px;height:60px;border-radius:50%"] {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
  }

  /* Fix inline tables in modals (client profile RDV table) */
  .modal-body table {
    font-size: 11px !important;
  }

  .modal-body table th,
  .modal-body table td {
    padding: 4px 6px !important;
  }

  /* Fix treatment pills wrapping */
  [id*="Pills"] {
    gap: 4px !important;
  }

  /* Fix bilan cards inline styles */
  .modal-body [style*="border-radius:12px;padding:20px"],
  .modal-body [style*="border-radius:12px;padding:16px"] {
    padding: 12px !important;
  }

  /* Ensure scrollable containers in modals */
  .modal-body [style*="max-height:200px"],
  .modal-body [style*="max-height:150px"] {
    max-height: 150px !important;
  }
}

@media (max-width: 480px) {
  /* Client profile stats even smaller */
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  [style*="font-size:22px;font-weight:700"] {
    font-size: 16px !important;
  }

  [style*="font-size:18px"] {
    font-size: 15px !important;
  }

  /* Make modal action buttons stack */
  .modal-body [style*="display:flex;gap:8px;flex-wrap:wrap;margin-top"] {
    flex-direction: column !important;
  }

  .modal-body [style*="display:flex;gap:8px;flex-wrap:wrap;margin-top"] .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Fix inline tables scrollable */
  .modal-body [style*="max-height:200px"] {
    overflow-x: auto !important;
  }

  /* Fix espace-client bilan cards header */
  [style*="display:flex;justify-content:space-between;align-items:flex-start"] {
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* Fix espace-client latest bilan info box */
  [style*="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
}

/* ════════════════════════════════════════════
   CLIENT PROFILE FULL PAGE
   ════════════════════════════════════════════ */

.client-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}

.client-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.client-profile-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.client-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.client-section p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light);
}

.client-section-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* Client profile header */
.client-profile-header {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f9f8f6, #f0ede8);
  border-radius: 12px;
  margin-bottom: 24px;
}

.client-profile-header .client-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  flex-shrink: 0;
}

.client-profile-header .client-info {
  flex: 1;
  min-width: 0;
}

.client-profile-header .client-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

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

@media (max-width: 768px) {
  .client-profile-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .client-profile-header {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 12px;
  }

  .client-profile-header .client-avatar {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }

  .client-profile-header .client-actions {
    justify-content: center;
    width: 100%;
  }

  .client-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .client-stat-card {
    padding: 12px;
  }

  .client-stat-card > div:first-child {
    font-size: 20px !important;
  }

  #tab-client-profile .dash-header {
    flex-wrap: wrap;
  }

  #tab-client-profile .dash-header h1 {
    font-size: 18px;
  }

  .client-section {
    padding: 14px;
  }

  .client-section table {
    font-size: 12px !important;
  }
}

@media (max-width: 480px) {
  .client-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .client-stat-card {
    padding: 10px;
  }

  .client-stat-card > div:first-child {
    font-size: 18px !important;
  }

  .client-profile-header .client-actions .btn {
    font-size: 11px;
    padding: 4px 8px;
  }
}
