/* ============================================
   SISTEMA DE INGRESO DE EQUIPOS - ESTILOS
   ============================================ */

:root {
  /* Colores principales */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #64748b;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;

  /* Colores de fondo y texto (modo claro) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Espaciado */
  --radius: 12px;
  --radius-sm: 8px;

  /* Transiciones */
  --transition: all 0.2s ease;
}

/* Modo oscuro */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --primary-light: #1e3a5f;
  --success-light: #14532d;
  --warning-light: #451a03;
  --danger-light: #450a0a;
  --info-light: #164e63;
}

/* ============= RESET & BASE ============= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============= LAYOUT ============= */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ============= HEADER / NAVBAR ============= */
.navbar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  gap: 1rem;
}

.navbar-header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo {
  height: 28px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  border-radius: 4px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  white-space: nowrap;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
}

.user-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 992px) {
  .navbar {
    padding: 0.6rem 0.85rem;
  }

  .navbar-content {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .navbar-header-row {
    justify-content: space-between;
    width: 100%;
  }

  .navbar-nav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.3rem 0;
    border-top: 1px solid var(--border-color);
  }

  .navbar-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.825rem;
    flex-shrink: 0;
    border-radius: 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
  }

  .nav-link.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
  }

  .user-name {
    max-width: 90px;
  }
}

/* ============= AUTH PAGES ============= */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--bg-primary), var(--primary-light));
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border-color);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.75rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ============= FORMS ============= */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  transition: var(--transition);
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

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

/* ============= BUTTONS ============= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  min-height: 48px;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: #15803d;
}

.btn-warning {
  background-color: var(--warning);
  color: white;
}

.btn-warning:hover {
  background-color: #b45309;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background-color: #475569;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-primary);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  min-height: 36px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

/* ============= CARDS ============= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
}

/* ============= STATS ============= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon.blue { background: var(--primary-light); }
.stat-icon.green { background: var(--success-light); }
.stat-icon.orange { background: var(--warning-light); }
.stat-icon.red { background: var(--danger-light); }
.stat-icon.cyan { background: var(--info-light); }

.stat-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.stat-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* ============= TABLE ============= */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background-color: var(--bg-primary);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.table tbody tr:hover {
  background-color: var(--primary-light);
}

.table tbody tr {
  transition: var(--transition);
}

/* ============= STATUS BADGES ============= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-recibido {
  background: var(--info-light);
  color: var(--info);
}

.badge-en_reparacion {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-listo {
  background: var(--success-light);
  color: var(--success);
}

.badge-entregado {
  background: var(--bg-primary);
  color: var(--text-muted);
}

/* ============= ALERTS ============= */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success);
}

.alert-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.alert-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.alert-info {
  background: var(--info-light);
  color: var(--info);
  border: 1px solid var(--info);
}

/* ============= SEARCH & FILTERS ============= */
.filters-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-input input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: var(--transition);
}

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

.search-input::before {
  content: '🔍';
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
}

.filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 150px;
}

/* ============= DARK MODE TOGGLE ============= */
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

/* ============= MODAL ============= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

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

.modal-header h3 {
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ============= RECEIPT / PRINT ============= */
.receipt {
  background: white;
  color: black;
  padding: 2rem;
  font-family: 'Courier New', monospace;
  max-width: 400px;
  margin: 0 auto;
}

.receipt h2 {
  text-align: center;
  border-bottom: 2px dashed #000;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
}

.receipt-divider {
  border-top: 1px dashed #000;
  margin: 0.75rem 0;
}

@media print {
  body * {
    visibility: hidden;
  }
  .receipt, .receipt * {
    visibility: visible;
  }
  .receipt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }
}

/* ============= EMPTY STATE ============= */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* ============= LOADING ============= */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============= TOAST NOTIFICATIONS ============= */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
  font-size: 0.9rem;
}

.toast.toast-success { border-left: 4px solid var(--success); }
.toast.toast-error { border-left: 4px solid var(--danger); }
.toast.toast-warning { border-left: 4px solid var(--warning); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
  .navbar-content {
    flex-direction: column;
    align-items: stretch;
  }

  .navbar-nav {
    justify-content: center;
  }

  .navbar-actions {
    justify-content: center;
  }

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

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

  .main-content {
    padding: 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  .filters-bar {
    flex-direction: column;
  }

  .search-input {
    width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  .btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .table {
    font-size: 0.8rem;
  }

  .table th,
  .table td {
    padding: 0.65rem 0.5rem;
  }
}

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

  .auth-card {
    padding: 1.25rem 1rem;
  }
}

/* ============= ACTIONS DROPDOWN ============= */
.actions-dropdown {
  position: relative;
  display: inline-block;
}

.actions-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.2rem;
  font-weight: bold;
  min-height: 36px;
}

.actions-menu {
  display: none;
  position: fixed;
  min-width: 190px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  padding: 0.4rem 0;
}

.actions-menu.active {
  display: block;
}

.sort-arrow {
  font-size: 0.7rem;
  color: var(--primary);
}

.actions-menu-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
  white-space: nowrap;
}

.actions-menu-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.actions-menu-divider {
  border-top: 1px solid var(--border-color);
  margin: 0.3rem 0;
}

.actions-menu-label {
  padding: 0.4rem 1rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ============= PHOTOS CONTAINER ============= */
.photos-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.photo-slot {
  position: relative;
  aspect-ratio: 1;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
  background: var(--bg-primary);
  min-height: 120px;
}

.photo-slot:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

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

.photo-placeholder {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

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

.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: var(--shadow);
}

@media (max-width: 480px) {
  .photos-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  .photo-slot {
    min-height: 100px;
  }
}

/* ============= BRAND / MODEL PICKER ============= */
.brand-picker,
.model-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.model-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.model-subcategory {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.model-subcategory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.model-subcategory-header:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.subcategory-arrow {
  font-size: 0.7rem;
  transition: var(--transition);
}

.model-subcategory-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.4rem;
  padding: 0.5rem;
  transition: var(--transition);
}

.model-subcategory-items.collapsed {
  display: none;
}

.brand-option,
.model-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-secondary);
  min-height: 80px;
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.model-option {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  flex-direction: row;
  justify-content: flex-start;
}

.brand-option:hover,
.model-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.brand-option.selected,
.model-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.brand-option img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin-bottom: 0.3rem;
  background: #ffffff;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.brand-option span,
.model-option span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.2;
}

.brand-option.selected span,
.model-option.selected span {
  color: var(--primary);
}

@media (max-width: 768px) {
  .brand-picker,
  .model-picker {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

/* ============= UTILITY CLASSES ============= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.hidden { display: none !important; }


/* ============= BOTÓN FLOTANTE WHATSAPP SOPORTE ============= */
.support-whatsapp-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 9998;
  transition: all 0.2s ease;
  cursor: pointer;
}

.support-whatsapp-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.support-whatsapp-btn:active {
  transform: scale(0.95);
}

.support-whatsapp-btn::before {
  content: '¿Necesitas ayuda?';
  position: absolute;
  right: 72px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: var(--shadow);
}

.support-whatsapp-btn:hover::before {
  opacity: 1;
}

@media (max-width: 640px) {
  .support-whatsapp-btn {
    width: 52px;
    height: 52px;
    bottom: 1rem;
    right: 1rem;
  }
  .support-whatsapp-btn svg {
    width: 24px;
    height: 24px;
  }
  .support-whatsapp-btn::before {
    display: none;
  }
}


/* ============= INVENTARIO ============= */
.tabs-container {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.85rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  margin-bottom: -2px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.inv-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.inv-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.inv-card-body {
  padding: 0.85rem;
  flex: 1;
}

.inv-card-body h3 {
  font-size: 1rem;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.inv-card-actions {
  padding: 0.5rem 0.85rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  display: flex;
  gap: 0.3rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.inv-card-actions .btn {
  min-height: 32px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .inventory-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .inv-card-body h3 {
    font-size: 0.9rem;
  }
}

/* ============= AJUSTES DE OPTIMIZACIÓN RESPONSIVA PARA MÓVILES ============= */
@media (max-width: 640px) {
  .main-content {
    padding: 1rem 0.75rem;
  }

  /* Grid de Estadísticas en 2 Columnas Compactas */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }

  .stat-card {
    padding: 0.75rem 0.85rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.25rem !important;
  }

  .stat-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.15rem !important;
  }

  .stat-content h3 {
    font-size: 1.25rem !important;
  }

  .stat-content p {
    font-size: 0.75rem !important;
    line-height: 1.2;
  }

  /* Tarjetas y Contenedores */
  .card-header {
    padding: 0.85rem 1rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .card-body {
    padding: 1rem 0.85rem !important;
  }

  /* Formularios */
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .filters-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  /* Modales en móviles */
  .modal-overlay {
    padding: 0.5rem !important;
  }

  .modal {
    max-height: 94vh !important;
    padding: 1rem !important;
    border-radius: 12px !important;
  }

  .modal-body {
    max-height: 75vh !important;
    overflow-y: auto !important;
  }

  /* Botones en móvil */
  .btn-lg {
    padding: 0.75rem 1.25rem !important;
    font-size: 0.95rem !important;
    min-height: 44px !important;
  }

  /* Acciones rápidas en dashboard */
  .d-flex.gap-2.flex-wrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
  }

  .d-flex.gap-2.flex-wrap .btn {
    font-size: 0.825rem !important;
    padding: 0.6rem 0.5rem !important;
    white-space: normal !important;
    text-align: center !important;
  }
}
