/* PWA Reclamos - Estilos */

:root {
  --primary: #0d6efd;
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  --header-height: 56px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  padding-top: var(--header-height);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--primary);
  color: white;
  padding: 0 16px;
  display: flex;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Status indicator */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online { background: #22c55e; }
.status-dot.offline { background: #ef4444; }
.status-dot.syncing { background: #f59e0b; animation: pulse 1s infinite; }

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

/* Main content */
.app-main {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* Views */
.view {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-radius: 12px;
}

/* Lista de reclamos */
.lista-reclamos {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reclamo-card {
  background: white;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.reclamo-card:active {
  transform: scale(0.98);
}

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

.reclamo-card .cliente {
  font-weight: 600;
  color: #333;
}

.reclamo-card .fecha {
  font-size: 0.75rem;
  color: #666;
}

.reclamo-card .tipo {
  font-size: 0.8rem;
  color: var(--primary);
}

.reclamo-card .obs {
  font-size: 0.85rem;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reclamo-card .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.reclamo-card .badge-pendiente {
  background: var(--warning);
  color: #000;
}

.reclamo-card .badge-enviado {
  background: var(--success);
  color: #fff;
}

/* Slots de imagen */
.img-slot-container {
  position: relative;
}

.img-slot {
  aspect-ratio: 1;
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  background: #f8f9fa;
}

.img-slot.has-image {
  border-style: solid;
  border-color: var(--success);
}

.img-placeholder {
  text-align: center;
  color: #adb5bd;
  padding: 8px;
}

.img-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.btn-img-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #dee2e6;
  background: white;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-img-action:active {
  transform: scale(0.9);
  background: #e9ecef;
}

.img-placeholder small {
  font-size: 0.7rem;
  display: block;
}

.img-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.btn-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  border: none;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Lista de productos en reclamo */
.producto-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  position: relative;
}

.producto-item .nombre {
  font-weight: 600;
  font-size: 0.9rem;
}

.producto-item .detalle {
  font-size: 0.8rem;
  color: #666;
}

.producto-item .btn-remove-prod {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.2rem;
  padding: 0;
  line-height: 1;
}

/* Lista de clientes/productos en búsqueda */
.list-group-item {
  cursor: pointer;
  padding: 10px 12px;
}

.list-group-item:active {
  background: #e9ecef;
}

.list-group-item .main {
  font-weight: 500;
}

.list-group-item .sub {
  font-size: 0.8rem;
  color: #666;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Tabs */
.nav-tabs {
  border-bottom: none;
}

.nav-tabs .nav-link {
  border: none;
  color: #666;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
}

.nav-tabs .nav-link.active {
  background: var(--primary);
  color: white;
}

/* Toast */
.toast {
  background: #333;
  color: white;
}

/* Form improvements */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
}

/* Responsive */
@media (max-width: 576px) {
  .app-main {
    padding: 12px;
  }
  
  .card-body {
    padding: 12px;
  }
}

/* Pull to refresh indicator */
.ptr-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: #aaa;
  z-index: 10;
  text-align: center;
  height: 50px;
  transition: all 0.25s ease;
}

/* Empty state */
#emptyState {
  padding: 40px 20px;
}

/* Avisos fijos (versión nueva, catálogos): encima del contenido, abajo */
.avisos-fijos {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 1080;
}
.avisos-fijos .aviso-fila { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.avisos-fijos .aviso-texto { font-size: .8rem; line-height: 1.2; }
.avisos-fijos .aviso-texto .text-muted { font-size: .7rem; }
