* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variables CSS - Tema negro puro con letras blancas */
:root {
  /* Fondos negros */
  --bg-gradient-start: #000000;
  --bg-gradient-end: #000000;
  --header-bg: #000000;
  --input-bg: #0a0a0a;
  --item-bg: #0a0a0a;
  --modal-bg: #000000;

  /* Textos blancos */
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #a0a0a0;

  /* Bordes grises */
  --border-color: #333333;
  --input-border: #444444;

  /* Acentos One Piece - Rojo y Amarillo */
  --accent-red: #dc2626;
  --accent-red-dark: #991b1b;
  --accent-yellow: #fbbf24;
  --accent-yellow-dark: #d97706;

  /* Stats backgrounds */
  --stat-1-bg: #0a0a0a;
  --stat-2-bg: #0a0a0a;
  --stat-3-bg: #0a0a0a;

  /* Sombras */
  --shadow-color: rgba(220, 38, 38, 0.3);

  /* Cambios de precio */
  --positive-bg: #0a1a0a;
  --positive-text: #22c55e;
  --negative-bg: #1a0a0a;
  --negative-text: #ef4444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.header {
  background: var(--header-bg);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px var(--shadow-color);
  padding: 24px;
  margin-bottom: 24px;
  transition: background 0.3s ease;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title svg {
  color: #ea580c;
}

.title h1 {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.luffy-flag {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(220, 38, 38, 0.4));
}

.header-buttons {
  display: flex;
  gap: 8px;
}

/* Buttons */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-spinner {
  animation: spin 1s linear infinite;
}

.btn-search-prices {
  background: var(--accent-yellow);
  color: #1a0a0a;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.btn-search-prices:hover {
  background: var(--accent-yellow-dark);
}

.btn-search-prices:disabled {
  background: #522c1c;
  cursor: not-allowed;
}

.btn-search-prices.loading svg {
  animation: spin 1s linear infinite;
}

/* Search Progress */
.search-progress {
  background: var(--header-bg);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px var(--shadow-color);
  padding: 20px;
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-yellow);
  transition: width 0.3s;
}

#progressText {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.btn-add {
  background: var(--accent-red);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.btn-add:hover {
  background: var(--accent-red-dark);
}

/* Auth Button */
.btn-auth {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.btn-auth:hover {
  background: #2563eb;
}

/* Auth Modal */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal.active {
  display: flex;
}

.auth-content {
  background: var(--header-bg);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.auth-close:hover {
  background: var(--input-bg);
  color: var(--text-primary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form.hidden {
  display: none;
}

.auth-form h2 {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
  margin: 0;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.auth-form form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text-primary);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

.auth-btn {
  background: var(--accent-red);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.auth-btn:hover {
  background: var(--accent-red-dark);
}

.auth-btn-logout {
  background: #404040;
}

.auth-btn-logout:hover {
  background: #522c1c;
}

.auth-footer {
  text-align: center;
}

.auth-footer a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 14px;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.logged-in-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.logged-in-content h2 {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
  color: var(--text-primary);
}

.logged-in-content p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.btn-save {
  background: var(--accent-red);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.btn-save:hover {
  background: var(--accent-red-dark);
}

.btn-cancel {
  background: #404040;
  color: var(--text-secondary);
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.btn-cancel:hover {
  background: #522c1c;
}

.btn-search {
  background: #6b7280;
  color: white;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-search:hover {
  background: #4b5563;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat {
  background: var(--stat-1-bg);
  padding: 16px;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.stat:nth-child(2) {
  background: var(--stat-2-bg);
}

.stat:nth-child(3) {
  background: var(--stat-3-bg);
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #3b82f6;
}

.stat-value.profit {
  color: #22c55e;
}

.stat-value.loss {
  color: #f87171;
}

.stat-value.positive {
  color: var(--positive-text);
  background: var(--positive-bg);
}

.stat-value.negative {
  color: var(--negative-text);
  background: var(--negative-bg);
}

.stat-value#totalChangeContainer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--stat-1-bg);
}

#totalChangeContainer.negative {
  background: var(--stat-1-bg);
}

/* Market Price Box */
.market-sources-inline {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.market-source-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(251, 191, 36, 0.02) 100%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.market-source-item:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(251, 191, 36, 0.05) 100%);
  border-color: rgba(251, 191, 36, 0.4);
  transform: translateY(-1px);
}

.source-name {
  color: #fbbf24;
  font-weight: 500;
}

.source-price {
  color: #f59e0b;
  font-weight: 600;
}

.search-id-label {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  font-style: italic;
}

.api-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 10px;
  color: #22c55e;
  font-weight: 500;
  margin-left: 6px;
}

/* Form */
.form {
  background: var(--header-bg);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px var(--shadow-color);
  padding: 24px;
  margin-bottom: 24px;
  transition: background 0.3s ease;
}

.form h2 {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.full-width {
  grid-column: 1 / -1;
}

.input-with-button {
  display: flex;
  gap: 4px;
}

.input-with-button input {
  flex: 1;
}

input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text-primary);
}

input:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

select.status-select {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text-primary);
  cursor: pointer;
}

select.status-select:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

input.date-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text-primary);
  cursor: pointer;
}

input.date-input:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

/* Color del calendario en input date */
input.date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.textarea-notes {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.textarea-notes:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

.form-buttons {
  display: flex;
  gap: 8px;
}

/* Items - SOLO FILAS */
.items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Asegurar que cada item tenga posición relativa */
.item {
  position: relative;
  z-index: 1;
}

/* Vista de filas */
.items.view-rows {
  display: flex;
  flex-direction: column;
}

/* Vista de grid 2 columnas */
.items.view-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.items.view-grid-2 .item {
  padding: 20px;
}

/* Vista de grid 4 columnas */
.items.view-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* Estilos compactos para grid 4 columnas */
.items.view-grid-4 .item {
  padding: 16px;
  padding-top: 6px;
}

.items.view-grid-4 .item::before {
  font-size: 12px;
  top: 2px;
}

.items.view-grid-4 .item-name {
  font-size: 16px;
  margin-bottom: 6px;
}

.items.view-grid-4 .item-header {
  flex-direction: column;
  gap: 12px;
}

.items.view-grid-4 .item-actions {
  flex-wrap: wrap;
  width: 100%;
  justify-content: center;
}

.items.view-grid-4 .item-details {
  font-size: 12px;
  gap: 8px;
}

.items.view-grid-4 .status-badge,
.items.view-grid-4 .type-badge {
  font-size: 10px;
  padding: 3px 8px;
}

.items.view-grid-4 .market-sources-inline {
  justify-content: center;
}

.items.view-grid-4 .price-input input {
  width: 60px;
  padding: 6px;
  font-size: 13px;
}

.items.view-grid-4 .change-badge {
  padding: 6px 10px;
  font-size: 13px;
}

.items.view-grid-4 .item-date {
  font-size: 10px;
}

/* Ajustes adicionales para grid 4 */
.items.view-grid-4 .btn-edit,
.items.view-grid-4 .btn-delete {
  padding: 6px;
}

.items.view-grid-4 .btn-edit svg,
.items.view-grid-4 .btn-delete svg {
  width: 16px;
  height: 16px;
}

.items.view-grid-4 .item-notes {
  font-size: 12px;
}

.items.view-grid-4 .search-id-label,
.items.view-grid-4 .api-badge {
  font-size: 9px;
}

.item {
  background: var(--item-bg);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px var(--shadow-color);
  padding: 24px;
  padding-top: 8px; /* Espacio para el handle de arrastre */
  transition: box-shadow 0.2s, background 0.3s ease, transform 0.2s, opacity 0.2s;
  border: 1px solid transparent;
  position: relative;
}

/* Indicador de arrastre */
.item::before {
  content: '⋮⋮';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 16px;
  letter-spacing: -2px;
  opacity: 0.5;
  pointer-events: none;
}

.item:hover::before {
  opacity: 1;
  color: var(--accent-yellow);
}

.item:hover {
  box-shadow: 0 10px 15px -3px var(--shadow-color);
}

/* Estados sutiles por tipo de item */
/* Fondos según estado */
.item[data-status="inventory"] {
  background: linear-gradient(135deg, rgba(34, 211, 153, 0.04) 0%, rgba(34, 211, 153, 0.01) 100%);
}

.item[data-status="sold"] {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.15) 0%, rgba(248, 113, 113, 0.05) 100%);
  border-color: rgba(248, 113, 113, 0.4);
}

.item[data-status="forsale"] {
  background: linear-gradient(135deg, rgba(34, 211, 153, 0.12) 0%, rgba(34, 211, 153, 0.04) 100%);
  border-color: rgba(34, 211, 153, 0.35);
}

.item[data-status="stored"] {
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.04) 0%, rgba(251, 146, 60, 0.01) 100%);
}

/* Bordes según tipo - estilo neón */
.item[data-type="card"] {
  border: 2px solid #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.4),
              inset 0 0 8px rgba(96, 165, 250, 0.05);
}

.item[data-type="display"] {
  border: 2px solid #c084fc;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.4),
              inset 0 0 8px rgba(192, 132, 252, 0.05);
}

.item[data-type="extras"] {
  border: 2px solid #34d399;
  box-shadow: 0 0 8px rgba(34, 211, 153, 0.4),
              inset 0 0 8px rgba(34, 211, 153, 0.05);
}

.item[draggable="true"]:active {
  cursor: grabbing;
}

.item.dragging {
  opacity: 0.5;
  transform: scale(1.02);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.item-info {
  flex: 1;
}

.item-name {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
  margin-bottom: 4px;
}

.status-inventory {
  background: #1a2d1a;
  color: #34d399;
  border: 1px solid #34d399;
}

.status-stored {
  background: #2d2a1a;
  color: #fb923c;
  border: 1px solid #fb923c;
}

.status-forsale {
  background: #2d2d1a;
  color: #fbbf24;
  border: 1px solid #fbbf24;
}

.status-sold {
  background: #2d1a1a;
  color: #f87171;
  border: 1px solid #f87171;
}

/* Type badges */
.type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
  margin-bottom: 4px;
}

.type-card {
  background: #1a1a2d;
  color: #60a5fa;
  border: 1px solid #60a5fa;
}

.type-display {
  background: #2d1a2d;
  color: #c084fc;
  border: 1px solid #c084fc;
}

.type-extras {
  background: #1a2d1a;
  color: #34d399;
  border: 1px solid #34d399;
}

.item-sold {
  opacity: 0.8;
  border: 1px solid #404040;
}

.item-notes {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.item-notes-container {
  margin-bottom: 8px;
}

.estimated-value {
  display: inline-block;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(251, 191, 36, 0.05) 100%);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fbbf24;
  margin-top: 4px;
}

.item-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
}

.item-details span {
  color: var(--text-secondary);
}

.item-details strong {
  color: var(--text-primary);
  margin-left: 4px;
}

.item-details .price-red {
  color: #f87171;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}

.item-actions > *,
.item-actions input,
.item-actions button {
  pointer-events: auto;
}

.price-input {
  pointer-events: auto;
}

.change-badge {
  pointer-events: auto;
}

.price-input {
  display: flex;
  align-items: center;
  gap: 4px;
}

.price-input input {
  width: 80px;
  text-align: center;
  padding: 8px;
}

.change-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: bold;
}

.change-badge.positive {
  background: var(--positive-bg);
  color: var(--positive-text);
}

.change-badge.negative {
  background: var(--negative-bg);
  color: var(--negative-text);
}

.btn-delete {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.btn-delete:hover {
  background: var(--negative-bg);
}

.btn-edit {
  background: none;
  border: none;
  color: #60a5fa;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}

.btn-edit:hover {
  background: #1a1a2d;
}

.item-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Empty state */
.empty-state {
  background: var(--header-bg);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px var(--shadow-color);
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Sub-filter tabs para Abiertos */
.sub-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.sub-filter-tab {
  background: var(--input-bg);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sub-filter-tab:hover {
  background: var(--stat-1-bg);
  border-color: var(--text-muted);
}

.sub-filter-tab.active {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
}

/* ==================== HITS ==================== */
.hit-group {
  background: var(--item-bg);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px var(--shadow-color);
  padding: 20px;
  margin-bottom: 20px;
  border: 2px solid transparent;
}

/* Bordes por tipo de hit-group */
.hit-group[data-type="display"] {
  border: 2px solid #c084fc;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.3),
              inset 0 0 8px rgba(192, 132, 252, 0.05);
}

.hit-group[data-type="card"] {
  border: 2px solid #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.3),
              inset 0 0 8px rgba(96, 165, 250, 0.05);
}

.hit-group[data-type="extras"] {
  border: 2px solid #34d399;
  box-shadow: 0 0 8px rgba(34, 211, 153, 0.3),
              inset 0 0 8px rgba(34, 211, 153, 0.05);
}

.hit-group-header {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.hit-group-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hit-group-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);
  margin: 0;
}

.hit-group-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.hit-group-type-display {
  border-color: #c084fc;
  color: #c084fc;
}

.hit-group-type-card {
  border-color: #60a5fa;
  color: #60a5fa;
}

.hit-group-type-extras {
  border-color: #34d399;
  color: #34d399;
}

.hit-group-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.profit-green {
  color: #22c55e;
}

.profit-red {
  color: #ef4444;
}

.hits-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hit-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

.hit-sold {
  opacity: 0.6;
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
}

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

.hit-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.hit-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  margin-right: 8px;
}

.hit-status-kept {
  background: #1a2d1a;
  color: #34d399;
  border: 1px solid #34d399;
}

.hit-status-sold {
  background: #2d1a1a;
  color: #f87171;
  border: 1px solid #f87171;
}

.hit-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.hit-notes {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 4px;
}

.hit-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-hit-edit,
.btn-hit-sold,
.btn-hit-delete {
  background: none;
  border: 1px solid var(--input-border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.btn-hit-edit:hover {
  border-color: #60a5fa;
  color: #60a5fa;
}

.btn-hit-sold {
  border-color: #34d399;
  color: #34d399;
}

.btn-hit-sold:hover {
  background: rgba(52, 211, 153, 0.1);
}

.btn-hit-delete:hover {
  border-color: #f87171;
  color: #f87171;
}

.hit-sold-info {
  font-size: 12px;
  color: #22c55e;
  font-weight: 500;
  margin-top: 4px;
}

.hit-parent-selector {
  max-height: 400px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hit-parent-option {
  background: var(--input-bg);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.hit-parent-option:hover {
  border-color: var(--accent-yellow);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(251, 191, 36, 0.2);
}

.hit-parent-option h4 {
  font-size: 14px;
  margin: 0 0 8px 0;
  color: var(--text-primary);
}

.hit-parent-type {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
}

.hit-parent-type-display {
  background: #2d1a2d;
  color: #c084fc;
  border: 1px solid #c084fc;
}

.hit-parent-type-card {
  background: #1a1a2d;
  color: #60a5fa;
  border: 1px solid #60a5fa;
}

.hit-parent-type-extras {
  background: #1a1a2d;
  color: #34d399;
  border: 1px solid #34d399;
}

.hit-parent-price {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* View Selector */
.view-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--header-bg);
  border-radius: 8px;
  align-self: flex-start;
}

.view-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.view-btn {
  background: var(--input-bg);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.view-btn:hover {
  background: var(--stat-1-bg);
  border-color: var(--text-muted);
}

.view-btn.active {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

.view-btn svg {
  width: 18px;
  height: 18px;
}

.filter-tab {
  background: var(--input-bg);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  background: var(--stat-1-bg);
  border-color: var(--text-muted);
}

.filter-tab.active {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--border-color);
}

.empty-state p:first-of-type {
  font-size: 18px;
  margin-bottom: 4px;
}

.empty-state p:last-child {
  font-size: 14px;
}

@media (max-width: 768px) {
  .items {
    grid-template-columns: 1fr;
  }

  .items.view-grid-2,
  .items.view-grid-4 {
    grid-template-columns: 1fr;
  }

  .header-content {
    flex-direction: column;
    gap: 16px;
  }

  .header-buttons {
    width: 100%;
    flex-direction: column;
  }

  .header-buttons button {
    width: 100%;
    justify-content: center;
  }

  .item-header {
    flex-direction: column;
  }

  .item-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .view-selector {
    width: 100%;
    justify-content: space-between;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .items.view-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== ITEMS WITH HITS (NUEVA VISTA ABIERTOS) ==================== */
.item-with-hits {
  padding: 24px;
}

.item-hits-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  margin: 16px 0;
}

.item-hits-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  margin: 16px 0;
}

.hit-stat-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hit-stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.hit-stat-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.hit-stat-investment {
  color: #f87171;
}

.hit-stat-kept {
  color: #22c55e;
}

.hit-stat-sold {
  color: #3b82f6;
}

.hit-stat-positive {
  color: #22c55e;
}

.hit-stat-negative {
  color: #ef4444;
}

.btn-add-hit-inline {
  background: #22c55e;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.btn-add-hit-inline:hover {
  background: #16a34a;
}

.hits-list-inline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.hit-item-inline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s ease;
}

.hit-item-inline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.hit-sold {
  opacity: 0.6;
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
}

.hit-inline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.hit-inline-info {
  flex: 1;
}

.hit-inline-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.hit-inline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hit-inline-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.hit-inline-details strong {
  color: var(--text-primary);
}

.no-hits-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  color: var(--text-muted);
}

.no-hits-message p {
  margin: 0;
  font-size: 14px;
}
