/* ============================================================
   SALONIQA — Client Recovery Engine Styles
   Mobile-first
   ============================================================ */

.recovery-body {
  background: var(--bg);
  cursor: auto;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
}

.recovery-body .custom-cursor { display: none; }

.recovery-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ── Header ──────────────────────────────── */
.recovery-header {
  margin-bottom: 24px;
}

.recovery-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  color: var(--ink);
  margin-bottom: 4px;
}

.recovery-header p {
  color: #888;
  font-size: 14px;
}

/* ── Stats Grid ──────────────────────────── */
.recovery-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.recovery-stat {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.recovery-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin-bottom: 6px;
}

.recovery-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
}

.recovery-stat-sub {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.recovery-stat.green .recovery-stat-value { color: var(--emerald-mid); }
.recovery-stat.red .recovery-stat-value { color: var(--danger); }
.recovery-stat.gold .recovery-stat-value { color: var(--gold); }

/* ── Filters ─────────────────────────────── */
.recovery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

.filter-group select,
.filter-group input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--gold);
}

.filter-btn {
  padding: 10px 20px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  transition: background 0.2s;
  align-self: flex-end;
}

.filter-btn:hover { background: var(--gold-dark); }

.filter-clear {
  background: none;
  border: 1px solid #ddd;
  color: #888;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  align-self: flex-end;
}

/* ── Client Cards (mobile-first) ─────────── */
.client-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.client-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 4px solid #ddd;
  transition: box-shadow 0.2s;
}

.client-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.client-card.risk-warm { border-left-color: #f0ad4e; }
.client-card.risk-high { border-left-color: #e67e22; }
.client-card.risk-lost { border-left-color: var(--danger); }
.client-card.recovered { border-left-color: var(--emerald-mid); }

.client-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.client-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  font-family: 'Playfair Display', Georgia, serif;
}

.client-phone {
  font-size: 13px;
  color: var(--gold);
  text-decoration: none;
  display: block;
  margin-top: 2px;
}

.client-phone:hover { text-decoration: underline; }

.risk-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

.risk-badge.warm { background: #fef3e2; color: #c17c1a; }
.risk-badge.high { background: #fde8d6; color: #b85c1a; }
.risk-badge.lost { background: #fde2e2; color: #b71c1c; }
.risk-badge.recovered { background: #d4edda; color: #155724; }

.client-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.client-detail {
  color: #555;
}

.client-detail strong {
  display: block;
  font-size: 12px;
  color: #999;
  font-weight: 500;
  margin-bottom: 2px;
}

.client-detail .value {
  font-weight: 600;
  color: #333;
}

/* ── Action Buttons ──────────────────────── */
.client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-actions .btn {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-wa-recovery { background: var(--wa); color: #fff; }
.btn-wa-recovery:hover { background: #1ebe5d; }

.btn-wa-eid { background: var(--gold); color: #fff; }
.btn-wa-eid:hover { background: var(--gold-dark); }

.btn-wa-birthday { background: #e1306c; color: #fff; }
.btn-wa-birthday:hover { background: #c1275c; }

.btn-wa-seasonal { background: #0a66c2; color: #fff; }
.btn-wa-seasonal:hover { background: #0854a0; }

.btn-mark-recovered {
  background: var(--emerald-mid);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-mark-recovered:hover { background: #1e4f3a; }

/* ── Desktop Table ───────────────────────── */
.client-table-wrapper {
  display: none;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow-x: auto;
}

.client-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.client-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  font-weight: 600;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
}

.client-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
  vertical-align: middle;
}

.client-table tr:last-child td { border-bottom: none; }
.client-table tr:hover { background: #fafafa; }

.client-table .actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.client-table .actions-cell .btn-icon-sm {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  transition: opacity 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-icon-sm.wa { background: var(--wa); color: #fff; }
.btn-icon-sm.eid { background: var(--gold); color: #fff; }
.btn-icon-sm.bday { background: #e1306c; color: #fff; }
.btn-icon-sm.season { background: #0a66c2; color: #fff; }
.btn-icon-sm.recover { background: var(--emerald-mid); color: #fff; }
.btn-icon-sm:hover { opacity: 0.85; }

/* ── Empty state ─────────────────────────── */
.recovery-empty {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.recovery-empty .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.recovery-empty h3 {
  font-size: 18px;
  color: #555;
  margin-bottom: 8px;
}

.recovery-empty p { font-size: 14px; }

/* ── Loading ─────────────────────────────── */
.recovery-loading {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 60px 0;
}

.recovery-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: recBounce 0.8s ease-in-out infinite alternate;
}

.recovery-loading span:nth-child(2) { animation-delay: 0.2s; }
.recovery-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes recBounce {
  from { transform: translateY(0); opacity: 0.4; }
  to { transform: translateY(-8px); opacity: 1; }
}

/* ── Desktop breakpoint ──────────────────── */
@media (min-width: 768px) {
  .recovery-container { padding: 32px 24px; }
  .recovery-stats { grid-template-columns: repeat(4, 1fr); }
  .client-list { display: none; }
  .client-table-wrapper { display: block; }
  .recovery-header h1 { font-size: 28px; }
}

@media (max-width: 767px) {
  .client-table-wrapper { display: none; }
  .client-list { display: flex; }
  .recovery-filters .filter-group { min-width: 100%; }
  .recovery-stat-value { font-size: 24px; }
}
