/* ============================================================
  Area de Clientes - Estilos
   ============================================================ */

.client-page {
  min-height: 100vh;
  background: var(--bg-main);
}

/* ===== HEADER ===== */
.client-header {
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.client-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.client-header-inner .logo-img {
  height: 55px;
}
.client-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.client-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.client-user i {
  color: var(--primary);
}

/* ===== LOGIN ===== */
.client-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 65px);
  padding: 24px;
}
.client-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.client-login-icon {
  font-size: 56px;
  color: var(--primary);
  margin-bottom: 16px;
}
.client-login-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}
.client-login-card > p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 8px 0 24px;
}
.client-login-card .form-group {
  text-align: left;
  margin-bottom: 20px;
}
.client-login-card .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.client-login-card .form-group input {
  width: 100%;
  height: 52px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  transition: var(--transition-fast);
}
body.light-mode .client-login-card .form-group input {
  background: rgba(0,0,0,0.03);
}
.client-login-card .form-group input:focus {
  border-color: var(--primary);
}
.client-login-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 14px;
  background: rgba(37,99,235,0.05);
  border: 1px solid rgba(37,99,235,0.1);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: left;
}
.client-login-note i {
  color: var(--primary);
  margin-top: 2px;
  flex-shrink: 0;
}

/* ===== DASHBOARD ===== */
.client-dashboard {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px;
}
.client-welcome {
  margin-bottom: 24px;
}
.client-welcome h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}
.client-welcome p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.client-welcome h2 span {
  color: var(--primary);
}

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

.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.client-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.client-card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.client-card-header h3 i {
  color: var(--primary);
}
.client-count {
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 0 6px;
}

.client-list {
  padding: 12px;
  max-height: 600px;
  overflow-y: auto;
}

.client-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
}
.client-empty i {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.client-empty p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== REPAIR CARD ===== */
.client-list-item {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 8px;
  transition: var(--transition-fast);
}
.client-list-item:hover {
  background: rgba(255,255,255,0.04);
}
.client-item-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.client-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(14,165,233,0.15);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.client-item-info {
  flex: 1;
  min-width: 0;
}
.client-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.client-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.client-item-meta i {
  margin-right: 4px;
}
.client-item-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.4;
}
/* ==========================================
   REPAIR CARD HEADER - Estado arriba derecha
   ========================================== */

.repair-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.repair-card-header .client-item-main {
  flex: 1;
  min-width: 0;
}

.status-badge.status-top-right {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 20px;
}

/* Colores de estado mejorados */
.status-badge.status-pending,
.status-badge.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.status-yellow,
.status-badge.status-top-right.status-yellow {
  background: rgba(250, 204, 21, 0.15) !important;
  color: #facc15 !important;
  border: 1px solid rgba(250, 204, 21, 0.3) !important;
}

.status-badge.status-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.status-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.status-info {
  background: rgba(14, 165, 233, 0.15);
  color: #0ea5e9;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

/* ===== REPAIR DETAILS ===== */
.repair-details-toggle {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(37,99,235,0.05);
  border: 1px solid rgba(37,99,235,0.1);
  border-radius: 8px;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  text-align: center;
  transition: var(--transition-fast);
  font-weight: 500;
}
.repair-details-toggle:hover {
  background: rgba(37,99,235,0.1);
}
.repair-details-toggle i {
  margin-right: 6px;
}

.repair-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}

.repair-detail-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.repair-detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.repair-detail-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.repair-detail-section h4 i {
  color: var(--primary);
}

.detail-row {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 3px 0;
}
.detail-row strong {
  color: var(--text-primary);
  display: inline-block;
  width: 140px;
  font-size: 12px;
}
.detail-notes {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  min-height: 40px;
}

/* ===== CHECKLIST TAGS ===== */
.checklist-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.check-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
}
.check-tag.active {
  background: rgba(16,185,129,0.15);
  color: var(--success);
}
.check-tag.warning {
  background: rgba(245,158,11,0.15);
  color: var(--warning);
}
.check-tag.success {
  background: rgba(16,185,129,0.15);
  color: var(--success);
}
.check-tag.info {
  background: rgba(14,165,233,0.15);
  color: var(--secondary);
}
.check-tag.danger {
  background: rgba(220,38,38,0.15);
  color: var(--error);
}
.check-tag i {
  font-size: 10px;
}

/* ===== SALE RECEIPT WARRANTIES ===== */
.sale-receipt-warranties {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.warranty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.warranty-row:first-child {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.warranty-indicator {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}
.warranty-indicator.status-green {
  background: var(--success);
  box-shadow: 0 0 6px rgba(16,185,129,0.4);
}
.warranty-indicator.status-red {
  background: var(--error);
  box-shadow: 0 0 6px rgba(220,38,38,0.4);
}
.warranty-indicator.status-gray {
  background: var(--text-muted);
}
.warranty-label {
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 140px;
}
.warranty-date {
  color: var(--text-primary);
  font-weight: 600;
}
.warranty-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}
.warranty-status.active {
  background: rgba(16,185,129,0.15);
  color: var(--success);
}
.warranty-status.expired {
  background: rgba(220,38,38,0.15);
  color: var(--error);
}

/* ===== WARRANTY DETAILS (legacy) ===== */
.client-item-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}
.warranty-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.warranty-glued {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(245,158,11,0.1);
  color: var(--warning);
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.client-logout {
  margin-top: 32px;
  text-align: center;
}




/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .client-login-card {
    padding: 32px 20px;
  }
  .client-grid {
    grid-template-columns: 1fr;
  }
  .client-dashboard {
    padding: 20px 16px;
  }
  .client-header-inner {
    padding: 12px 16px;
  }
  .detail-row strong {
    display: block;
    width: 100%;
    margin-bottom: 2px;
  }
  .warranty-detail-row {
    flex-direction: column;
    gap: 2px;
  }
  .warranty-row {
    flex-wrap: wrap;
  }
  .warranty-label {
    min-width: auto;
  }
}

/* ===== BOTONES DE ORDEN ===== */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  height: 32px;
}
.repair-detail-section img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.repair-detail-section .btn {
  margin-top: 4px;
}

@media (max-width: 480px) {
  .client-login-icon {
    font-size: 40px;
  }
  .client-login-card h2 {
    font-size: 20px;
  }
  .client-item-meta {
    gap: 6px;
  }
  .checklist-display {
    gap: 4px;
  }
  .check-tag {
    font-size: 10px;
    padding: 3px 8px;
  }
  .repair-detail-section .btn {
    width: 100%;
    margin-bottom: 6px;
  }
}


/* ===== PRO BADGE CLIENTE ===== */
.pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #f59e0b 100%);
  color: #78350f;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255,255,255,0.3);
  border: 1px solid rgba(245, 158, 11, 0.4);
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.pro-badge i {
  font-size: 12px;
  color: #92400e;
}

/* ===== PRO BADGE ADMIN (mismo estilo que panel admin) ===== */
.pro-badge-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #f59e0b 100%);
  color: #78350f;
  font-size: 13px;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255,255,255,0.3);
  border: 1px solid rgba(245, 158, 11, 0.4);
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  color: #92400e !important;

}
.pro-badge-admin i {
  font-size: 12px;
  color: #92400e;
}

/* ===== WARRANTY INDICATORS ===== */
.warranty-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.warranty-indicator.status-green {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.4);
}
.warranty-indicator.status-red {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239,68,68,0.4);
}
.warranty-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}
.warranty-status.active {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.warranty-status.expired {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}

.status-badge.status-danger-strong,
.status-danger-strong {
  background: rgba(220, 38, 38, 0.35) !important;
  color: #ff3333 !important;
  border: 2px solid rgba(255, 50, 50, 0.8) !important;
  font-weight: 800 !important;
  text-shadow: 0 0 10px rgba(255, 50, 50, 0.6), 0 0 20px rgba(220, 38, 38, 0.3) !important;
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.25), inset 0 0 10px rgba(255, 50, 50, 0.1) !important;
  letter-spacing: 0.8px !important;
}

body.light-mode .status-badge.status-danger-strong,
body.light-mode .status-danger-strong {
  background: rgba(220, 38, 38, 0.2) !important;
  color: #dc2626 !important;
  border: 2px solid rgba(220, 38, 38, 0.6) !important;
  text-shadow: 0 0 6px rgba(220, 38, 38, 0.3) !important;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.15) !important;
}

/* ===== SECCION DE IMAGENES DE COMPROBANTE ===== */
.receipt-images-section {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.receipt-image-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}

.receipt-image-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.receipt-image-toggle:hover {
  background: rgba(37,99,235,0.05);
  color: var(--primary);
}

.receipt-image-toggle i:first-child {
  margin-right: 8px;
  color: var(--primary);
}

.toggle-icon {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.receipt-image-wrapper {
  padding: 0 16px 16px;
  animation: fadeIn 0.3s ease;
}

/* ===== IMAGENES CLICKEABLES ===== */
.receipt-image-wrapper img,
.receipt-viewer-img,
#product-images-wrapper img {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.receipt-image-wrapper img:hover,
.receipt-viewer-img:hover,
#product-images-wrapper img:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.receipt-viewer-img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #000;
  display: block;
}

/* Botones Ver en grande / Descargar dentro del wrapper */
.receipt-image-wrapper .btn-group {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.receipt-image-wrapper .btn-group .btn {
  flex: 1;
  justify-content: center;
}

/* ===== IMAGE VIEWER MODAL ===== */
.image-viewer-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5000;
  align-items: center;
  justify-content: center;
}

.image-viewer-modal.active {
  display: flex;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.image-viewer-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-content img {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.image-viewer-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.image-viewer-close:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

.image-viewer-close:active {
  transform: scale(0.95);
}

/* ===== DUAL IMAGE VIEWER ===== */
.dual-image-viewer-content {
  max-width: 95vw;
  max-height: 95vh;
  width: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dual-images-container {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 85vh;
  padding: 20px;
}

.dual-image-wrapper {
  flex: 1;
  max-width: 45vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  overflow: hidden;
}

.dual-image-wrapper img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.dual-image-wrapper img:hover {
  transform: scale(1.02);
}

/* Responsive para mobile */
@media (max-width: 768px) {
  .dual-images-container {
    flex-direction: column;
    gap: 12px;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .dual-image-wrapper {
    max-width: 85vw;
    max-height: 45vh;
  }
  
  .dual-image-wrapper img {
    max-height: 45vh;
  }
}

@media (max-width: 480px) {
  .dual-images-container {
    padding: 10px;
    gap: 8px;
  }
  
  .dual-image-wrapper {
    max-width: 90vw;
  }
  
  .receipt-viewer-img {
    max-height: 350px;
  }
  
  .receipt-image-wrapper .btn-group {
    flex-direction: column;
  }
}

/* Light mode para seccion de imagenes */
body.light-mode .receipt-image-item {
  background: rgba(0,0,0,0.02);
  border-color: #e5e7eb;
}

body.light-mode .receipt-image-toggle:hover {
  background: rgba(0,0,0,0.04);
}

body.light-mode .receipt-viewer-img {
  border-color: #e5e7eb;
}