  /* Quitar subrayado a enlaces tipo botón */
  a.keystore-btn.primary, a.keystore-btn.primary:visited, a.keystore-btn.primary:hover, a.keystore-btn.primary:active {
    text-decoration: none !important;
  }
  /* Forzar hover correcto en botón primary */
  .keystore-btn.primary:hover {
    background: #6B0F0F !important;
    color: #fff !important;
    border: 1.5px solid #6B0F0F !important;
  }
 
/* Etiquetas de grupo de filtro */
.filter-label {
  color: #fff;
  font-weight: 500;
  margin-bottom: 2px;
}

/* Grupo de búsqueda de filtro */
.filter-search-group {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Input de búsqueda */
.filter-search-group input[type="text"],
#fSearch {
  background: #2a1620;
  color: #fff;
  border: 1px solid #f7931a;
  border-radius: 6px;
  padding: 6px 8px;
  min-width: 200px;
}

/* Alinear checkboxes de filtros por la derecha */
.filters .filter-group label {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
/* Header y navegación */
.main-header {
  width: 100%;
  background: #220F17;
  box-shadow: 0 2px 12px rgba(247,147,26,0.12);
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}
.header-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.project-title {
  color: #f7931a;
  font-size: 1.25em;
  font-weight: bold;
  letter-spacing: 1px;
}
.main-nav {
  display: flex;
  gap: 18px;
}
.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.18s;
}
.main-nav a.active, .main-nav a:hover {
  background: #f7931a;
  color: #220F17;
}
/* Subir la card para que quede más arriba */
.keystore-container {
  margin-top: 16px;
  height: auto;
  min-height: 0;
}
/* History list styles - OPTIMIZED FOR MOBILE */
.history-list { margin-top: 12px; width: 100%; overflow-x: hidden; }
.history-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  background: #2F1D25;
  border: 1px solid rgba(255, 196, 140, 0.25);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  box-sizing: border-box;
}
.filters .filter-group input[type="checkbox"] { accent-color: #f7931a; }
.filters input[type="text"]::placeholder { color:#caa; }
.filters { display:flex; flex-wrap: wrap; gap:8px; align-items:center; width:100%; margin:8px 0; }
.filters .filter-group { display:flex; gap:8px; align-items:center; flex-wrap: wrap; }
.filters .filter-group label { display:inline-flex; gap:6px; align-items:center; color:#fff; white-space: nowrap; }
.filters > div:last-child { margin-left:auto; display:flex; gap:8px; align-items:center; }
#fSearch { background:#2a1620; color:#fff; border:1px solid #f7931a; border-radius:6px; padding:6px 8px; min-width:200px; }
.history-main { display:flex; flex-direction:column; gap:4px; color:#fff; width: 100%; }
.history-meta { display:flex; flex-direction: column; gap:4px; align-items: center; color:rgb(255, 255, 255); font-size:0.9em; width: 100%; }
.history-labels { display: flex; flex-direction: row; gap: 4px; flex-wrap: wrap; justify-content: center; align-items: center; }
.badge { display:inline-block; padding:2px 6px; border-radius: 8px; font-size: 0.75em; white-space: nowrap; }
.badge.pending { background:#3a2a1a; color:#f3b26f; border:1px dashed #f7931a; }
.badge.mined { background:#16321a; color:#83e19a; border:1px solid #2f7f4a; }
.chip { display:inline-block; padding:2px 6px; border-radius: 8px; font-size: 0.75em; background:#3a2630; color:#f7931a; border:1px solid #f7931a; white-space: nowrap; }
/* Chips por tipo de transacción - colores diferenciados */
.chip.received { background: #1a3a2a; color: #5fd3a5; border: 1px solid #2f8a5a; }
.chip.transfer { background: #1a2a3a; color: #5d9dfd; border: 1px solid #2f5a8a; }
.chip.opened { background: #3a1a1a; color: #fd7d5d; border: 1px solid #8a2f2f; }
.chip.returned { background: #3a2a1a; color: #fdb45d; border: 1px solid #8a6a2f; }
.chip.devuelta { background: #3a2a1a; color: #fdb45d; border: 1px solid #8a6a2f; }
.amount { font-weight:600; color:#f7931a; font-size:0.95em; }
.who { color:#fff; }
.txid { color:#F7931A; font-family: monospace; word-break: break-all; }
.muted { color:#bbb; font-size: 0.85em; }
body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: #3A1319;
  background-image:
    url('data:image/svg+xml;utf8,<svg width="192" height="192" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><polygon points="24,4 44,14 44,34 24,44 4,34 4,14" fill="%23FF9800" stroke="%23FF9800" stroke-width="2"/><polygon points="24,4 44,14 24,24 4,14" fill="%23FF9800" opacity="0.85"/><polygon points="24,24 44,14 44,34 24,44" fill="%23FFB74D" opacity="0.7"/><polygon points="24,24 24,44 4,34 4,14" fill="%23A0522D" opacity="0.7"/><rect x="21" y="12" width="6" height="20" rx="3" fill="white" opacity="0.25"/><rect x="23" y="8" width="2" height="6" rx="1" fill="white" opacity="0.25"/></svg>'),
    url('data:image/svg+xml;utf8,<svg width="192" height="192" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><polygon points="24,4 44,14 44,34 24,44 4,34 4,14" fill="%23FF9800" stroke="%23FF9800" stroke-width="2"/><polygon points="24,4 44,14 24,24 4,14" fill="%23FF9800" opacity="0.85"/><polygon points="24,24 44,14 44,34 24,44" fill="%23FFB74D" opacity="0.7"/><polygon points="24,24 24,44 4,34 4,14" fill="%23A0522D" opacity="0.7"/><rect x="21" y="12" width="6" height="20" rx="3" fill="white" opacity="0.25"/><rect x="23" y="8" width="2" height="6" rx="1" fill="white" opacity="0.25"/></svg>');
  background-repeat: repeat;
  background-size: 192px 192px, 192px 192px;
  background-position: 0 0, 96px 96px;
}

.keystore-container {
  width: 100vw;
  box-sizing: border-box;
  /* Eliminado flex para que la card quede arriba */
}

.keystore-card {
  background: #220F17;
  border: none;
  border-radius: 15px;
  padding: 24px 32px;
  box-shadow: 0 8px 32px rgba(247, 147, 26, 0.3);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  min-width: 360px;
  max-width: 480px;
  min-height: 40vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.keystore-header h2 {
  margin: 0 0 8px 0;
  color: #f7931a;
}

.keystore-card p {
  color: #fff;
  margin-bottom: 18px;
}

.card-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.keystore-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: #f7931a;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.keystore-btn.primary {
  background: #f7931a;
  color: #fff !important;
}

.keystore-btn:disabled {
  background: #888;
  color: #ccc;
  cursor: not-allowed;
}

.keystore-status {
  color: #f7931a;
  font-size: 0.95em;
  min-height: 24px;
  text-align: center;
}

label {
  color: #fff;
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
}

input[type="text"], input[type="number"] {
  background: #2a1620;
  color: #fff;
  border: 1px solid #f7931a;
  border-radius: 6px;
  padding: 8px;
  margin-top: 4px;
  width: 100%;
  font-size: 1em;
}

@media (max-width: 700px) {
  body { justify-content: flex-start; align-items: stretch; }
  .header-content { padding: 10px 4vw; }
  .keystore-container { width: 100%; padding: 0 4vw; margin-top: 96px; }
  .keystore-card { max-width: 100%; width: 100%; min-width: 0; margin: 12px 0; padding: 14px 3vw; border-radius: 12px; box-sizing: border-box; }
  .keystore-header h2 { font-size: 1.1rem; text-align: center; }
  .keystore-card p { font-size: 0.9rem; text-align: center; }
  .card-actions, .keystore-actions { flex-direction: column; gap: 10px; width: 100%; }
  .keystore-btn { width: 100%; min-height: 40px; font-size: 0.95em; }
  .keystore-btn:last-child { margin-bottom: 8px; }
  label { font-size: 0.9rem; }
  input[type="text"], input[type="number"], input[type="password"], input[type="file"], select { width: 100%; font-size: 1rem; padding: 10px; }
  .filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start !important; width: 100%; margin: 6px 0; font-size: 0.85em; }
  .filters .filter-group { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-width: auto; flex-wrap: wrap !important; }
  .filters .filter-group label { flex: unset; min-width: unset; font-size: 0.85em; }
  .filters > div:last-child { width: 100% !important; margin-left: 0 !important; }
  #fSearch { width: 100% !important; min-width: 0 !important; box-sizing: border-box; font-size: 0.9rem !important; padding: 8px 6px !important; }
  .history-item { padding: 6px 8px; gap: 4px; }
  .history-labels { gap: 3px; }
  .badge { padding: 1px 5px; font-size: 0.7em; }
  .chip { padding: 1px 5px; font-size: 0.7em; }
  .history-meta { gap: 2px; font-size: 0.85em; }
  .amount { font-size: 0.9em; }
  .who { font-size: 0.85em; }
  .txid { font-size: 0.85em; }
  .history-actions { gap: 6px !important; }
  .keystore-status { font-size: 0.9em; }
}
