/* =============================================
   App Ventas - Custom Styles
   ============================================= */

/* Spinner animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-lg {
  width: 3rem;
  height: 3rem;
  border-width: 3px;
}

/* Skeleton loader */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.375rem;
}

/* Card hover effect */
.card-hover {
  transition: transform 0.2s, box-shadow 0.2s;
}
.card-hover:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* Table styles */
.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.app-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.app-table td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.app-table tr:hover td {
  background: #f9fafb;
}
.app-table tr.row-anulado td {
  background-color: rgba(239, 68, 68, 0.07);
}
.app-table tr.row-anulado:hover td {
  background-color: rgba(239, 68, 68, 0.12);
}
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Select custom */
.app-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.25rem;
  padding-right: 2rem !important;
}

/* Form styles */
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: #111827;
}
.form-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-input:disabled {
  background: #f9fafb;
  cursor: not-allowed;
  opacity: 0.7;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  border: none;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-primary {
  background: #111827;
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: #374151;
}
.btn-outline {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}
.btn-outline:hover:not(:disabled) {
  background: #f9fafb;
}
.btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
}

/* Card styles */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem 0.5rem;
}
.card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}
.card-content {
  padding: 0.5rem 1.25rem 1.25rem;
}

/* Tabs */
.tabs-list {
  display: flex;
  gap: 0.25rem;
  background: #f3f4f6;
  padding: 0.25rem;
  border-radius: 0.5rem;
  width: fit-content;
  margin-bottom: 1rem;
}
.tab-trigger {
  padding: 0.375rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #6b7280;
  transition: all 0.15s;
}
.tab-trigger.active {
  background: white;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Navigation */
.desktop-nav {
  display: none;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 40;
}
@media (min-width: 768px) {
  .desktop-nav { display: block; }
}
.mobile-nav {
  display: block;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) {
  .mobile-nav { display: none; }
  #app-content { padding-bottom: 0 !important; }
}
.mobile-nav ul {
  display: flex;
  justify-content: space-around;
  list-style: none;
  margin: 0;
  padding: 0;
}
.mobile-nav a, .mobile-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  font-size: 0.65rem;
  color: #6b7280;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  min-width: 3.5rem;
}
.mobile-nav a.active, .mobile-nav a:hover {
  color: #2563eb;
}
.mobile-nav svg { width: 1.5rem; height: 1.5rem; }

/* Chart container */
.chart-container {
  position: relative;
  height: 400px;
  width: 100%;
}
.chart-container-sm {
  position: relative;
  height: 220px;
  width: 100%;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

/* Modal */
.modal-box {
  max-height: 90vh;
  overflow-y: auto;
}

/* Real-time indicator */
.rt-indicator {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}
.rt-indicator.active {
  background: #22c55e;
  animation: pulse-green 2s infinite;
}
.rt-indicator.inactive {
  background: #9ca3af;
}
@keyframes pulse-green {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Cobros list */
.cobro-item {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
}
.cobro-item:hover {
  background: #f9fafb;
}

/* Sticky content padding for mobile nav */
#app-content {
  padding-bottom: 4rem;
}
@media (min-width: 768px) {
  #app-content { padding-bottom: 0; }
}

/* Checkbox */
.app-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
  cursor: pointer;
}

/* Scroll area */
.scroll-area {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Alert */
.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #f9fafb;
  color: #374151;
  font-size: 0.875rem;
}
